forked from markus/S_New4
fix clean methode && cookie file in multi thread -> for each one ,one
This commit is contained in:
parent
9fbc4f28e5
commit
8dc9b101b1
@ -1220,18 +1220,18 @@ void unterOption_clean(Settings * settings, int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//UM sachen nach multipage update zu löschen
|
//UM sachen nach multipage update zu löschen
|
||||||
for ( const auto &p : settings->pagesInUse ) {
|
for ( const auto &p : settings->pagesALL ) {
|
||||||
if(fileExists(settings->cookieFilePath + "_" + p.name_id)) {
|
if(fileExists(settings->cookieFilePath + "_" + p.url)) {
|
||||||
if(remove((settings->cookieFilePath + "_" + p.name_id).c_str()) != 0) {
|
if(remove((settings->cookieFilePath + "_" + p.url).c_str()) != 0) {
|
||||||
perror(( " => Error: Das löschen von " + settings->cookieFilePath + "_" + p.name_id + " ist fehlgeschlagen: ").c_str());
|
perror(( " => Error: Das löschen von " + settings->cookieFilePath + "_" + p.url + " ist fehlgeschlagen: ").c_str());
|
||||||
return;
|
return;
|
||||||
} else
|
} else
|
||||||
++count;
|
++count;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned i = 0; i < UINT_MAX && fileExists(settings->cookieFilePath + "_" + p.name_id + std::to_string(i)); ++i) {
|
for (unsigned i = 0; i < UINT_MAX && fileExists(settings->cookieFilePath + "_" + p.url + std::to_string(i)); ++i) {
|
||||||
if(remove( (settings->cookieFilePath + "_" + p.name_id + std::to_string(i)).c_str() ) != 0) {
|
if(remove( (settings->cookieFilePath + "_" + p.url + std::to_string(i)).c_str() ) != 0) {
|
||||||
perror((" => Error: Das löschen von " + settings->cookieFilePath + "_" + p.name_id + std::to_string(i) + " ist fehlgeschlagen: ").c_str());
|
perror((" => Error: Das löschen von " + settings->cookieFilePath + "_" + p.url + std::to_string(i) + " ist fehlgeschlagen: ").c_str());
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
++count;
|
++count;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
||||||
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
||||||
#define VERSION "5.2.0"
|
#define VERSION "5.2.1"
|
||||||
#define DEFAULT_FILE_VERSION "2.3"
|
#define DEFAULT_FILE_VERSION "2.3"
|
||||||
|
|
||||||
//default, anime, normal,
|
//default, anime, normal,
|
||||||
|
@ -117,7 +117,7 @@ void * threadFunction(void * data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= 3; ++i) {
|
for (int i = 1; i <= 3; ++i) {
|
||||||
auto REPLy = myThreadData->pageManager->getUrlAfterRedirect( myThreadData->page.protocol, myThreadData->page.url + Link, myThreadData->settings->cookieFilePath + "_" + myThreadData->page.url);
|
auto REPLy = myThreadData->pageManager->getUrlAfterRedirect( myThreadData->page.protocol, myThreadData->page.url + Link, myThreadData->settings->cookieFilePath + "_" + myThreadData->page.url + std::to_string(myThreadData->id));
|
||||||
std::string newUrl = REPLy.url;
|
std::string newUrl = REPLy.url;
|
||||||
if (newUrl == "-1") {
|
if (newUrl == "-1") {
|
||||||
if(myThreadData->settings->debugMode)
|
if(myThreadData->settings->debugMode)
|
||||||
@ -133,7 +133,7 @@ void * threadFunction(void * data) {
|
|||||||
} else if(newUrl.find("/redirect/") != std::string::npos ) {
|
} else if(newUrl.find("/redirect/") != std::string::npos ) {
|
||||||
if(myThreadData->settings->debugMode)
|
if(myThreadData->settings->debugMode)
|
||||||
std::cout << " > Thread " << myThreadData->id << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl;
|
std::cout << " > Thread " << myThreadData->id << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl;
|
||||||
if(myThreadData->pageManager->login(myThreadData->page, myThreadData->accountManager->getNextAccount(), myThreadData->settings->cookieFilePath + "_" + myThreadData->page.url) != 0) {
|
if(myThreadData->pageManager->login(myThreadData->page, myThreadData->accountManager->getNextAccount(), myThreadData->settings->cookieFilePath + "_" + myThreadData->page.url + std::to_string(myThreadData->id)) != 0) {
|
||||||
if(myThreadData->settings->debugMode)
|
if(myThreadData->settings->debugMode)
|
||||||
std::cerr << " => Debug: In Thread: "<< myThreadData->id << ": login Function failed." << std::endl;
|
std::cerr << " => Debug: In Thread: "<< myThreadData->id << ": login Function failed." << std::endl;
|
||||||
return myThreadData->setState(17);
|
return myThreadData->setState(17);
|
||||||
|
Loading…
Reference in New Issue
Block a user