forked from markus/S_New4
v5.0.2: fix error with login
This commit is contained in:
parent
0342d9db01
commit
7dd40d64e8
@ -259,12 +259,12 @@ int PageManager::downLoadToFile(std::string filePath, std::string url)
|
|||||||
return (failed) ? 10 : 0;
|
return (failed) ? 10 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int PageManager::login(PAGE page, Account account)
|
int PageManager::login(PAGE page, Account account, std::string cookieFilePath)
|
||||||
{
|
{
|
||||||
if(debugMode)
|
if(debugMode)
|
||||||
std::cout << " > Melde mit neuem Account an: Email: " << account.Email << " Passowort: " << account.Password << std::endl;
|
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;
|
std::string html = reply.html;
|
||||||
|
|
||||||
if(html == "" )
|
if(html == "" )
|
||||||
|
@ -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 = "");
|
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 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);
|
Reply getUrlAfterRedirect(std::string Url, std::string cookieFilePath);
|
||||||
checkNameRply checkName(std::vector<PAGE> pages, std::string Name, bool useFirstPage);
|
checkNameRply checkName(std::vector<PAGE> pages, std::string Name, bool useFirstPage);
|
||||||
std::string getLinks(std::string HTML);
|
std::string getLinks(std::string HTML);
|
||||||
|
@ -127,7 +127,7 @@ void * threadFunction(void * data) {
|
|||||||
} else if(newUrl.find("/" + myThreadData->page.url + "/redirect/") != std::string::npos ) {
|
} else if(newUrl.find("/" + myThreadData->page.url + "/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()) != 0) {
|
if(myThreadData->pageManager->login(myThreadData->page, myThreadData->accountManager->getNextAccount(), myThreadData->settings->cookieFilePath + "_" + myThreadData->page.name_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);
|
||||||
@ -1820,7 +1820,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
} else if(newUrl.find("/" + page.url + "/redirect/") != std::string::npos ) {
|
} else if(newUrl.find("/" + page.url + "/redirect/") != std::string::npos ) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cout << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl;
|
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)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": login f() failed." << std::endl;
|
std::cerr << ">>> Debug In " << __FUNCTION__ << ": login f() failed." << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
|
Loading…
Reference in New Issue
Block a user