diff --git a/src/pageManager.cpp b/src/pageManager.cpp index 335303e..5048b15 100644 --- a/src/pageManager.cpp +++ b/src/pageManager.cpp @@ -259,12 +259,12 @@ int PageManager::downLoadToFile(std::string filePath, std::string url) return (failed) ? 10 : 0; } -int PageManager::login(PAGE page, Account account) +int PageManager::login(PAGE page, Account account, std::string cookieFilePath) { if(debugMode) std::cout << " > Melde mit neuem Account an: Email: " << account.Email << " Passowort: " << account.Password << std::endl; - auto reply = getServerRequest("https://" + page.url + "/login", false, std::string("email=" + account.Email + "&password=" + account.Password), true ); + auto reply = getServerRequest("https://" + page.url + "/login", false, std::string("email=" + account.Email + "&password=" + account.Password), true, false, cookieFilePath ); std::string html = reply.html; if(html == "" ) diff --git a/src/pageManager.h b/src/pageManager.h index 0673ad2..75209c7 100644 --- a/src/pageManager.h +++ b/src/pageManager.h @@ -48,7 +48,7 @@ public: Reply getServerRequest(std::string Url, bool useCookies = false, std::string data = "", bool generateCookieFile = false, bool UrlAfterRedirectOnlyNeeded = false, std::string cookieFilePath = ""); int downLoadToFile(std::string filePath, std::string url); - int login(PAGE page, Account account); + int login(PAGE page, Account account, std::string cookieFilePath); Reply getUrlAfterRedirect(std::string Url, std::string cookieFilePath); checkNameRply checkName(std::vector pages, std::string Name, bool useFirstPage); std::string getLinks(std::string HTML); diff --git a/src/programManager.cpp b/src/programManager.cpp index 451c9c2..dc45426 100644 --- a/src/programManager.cpp +++ b/src/programManager.cpp @@ -127,7 +127,7 @@ void * threadFunction(void * data) { } else if(newUrl.find("/" + myThreadData->page.url + "/redirect/") != std::string::npos ) { if(myThreadData->settings->debugMode) std::cout << " > Thread " << myThreadData->id << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl; - if(myThreadData->pageManager->login(myThreadData->page, myThreadData->accountManager->getNextAccount()) != 0) { + if(myThreadData->pageManager->login(myThreadData->page, myThreadData->accountManager->getNextAccount(), myThreadData->settings->cookieFilePath + "_" + myThreadData->page.name_id) != 0) { if(myThreadData->settings->debugMode) std::cerr << " => Debug: In Thread: "<< myThreadData->id << ": login Function failed." << std::endl; return myThreadData->setState(17); @@ -1820,7 +1820,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana } else if(newUrl.find("/" + page.url + "/redirect/") != std::string::npos ) { if(settings->debugMode) std::cout << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl; - if(pageManager.login(page, accountManager->getNextAccount()) != 0) { + if(pageManager.login(page, accountManager->getNextAccount(), settings->cookieFilePath + "_" + page.name_id) != 0) { if(settings->debugMode) std::cerr << ">>> Debug In " << __FUNCTION__ << ": login f() failed." << std::endl; return -1;