v5.0.2: fix error with login

This commit is contained in:
Markus 2021-03-03 17:23:48 +01:00
parent 0342d9db01
commit 7dd40d64e8
3 changed files with 5 additions and 5 deletions

View File

@ -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 == "" )

View File

@ -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<PAGE> pages, std::string Name, bool useFirstPage);
std::string getLinks(std::string HTML);

View File

@ -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;