From 61995f0587d27d82c2d91c02f9ecbdc74fb3502a Mon Sep 17 00:00:00 2001 From: Markus Date: Fri, 1 Nov 2019 20:06:56 +0100 Subject: [PATCH] =?UTF-8?q?v3.6.1:=20extra=20ausgabe=20f=C3=BCr=20ung?= =?UTF-8?q?=C3=BCltige=20link=20vorallem=20beu=20snew4=20url?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parameterManager.h | 2 +- programManager.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/parameterManager.h b/parameterManager.h index 03ec74b..7fae31c 100644 --- a/parameterManager.h +++ b/parameterManager.h @@ -63,7 +63,7 @@ struct Settings { proxy_ip = "127.0.0.1", languages = "GerDub,GerSub,Eng,", genaueHoster = "", - version = "3.6.0", + version = "3.6.1", defaultFileVersion="1.6", outputFilePath = "", default_checkPath = "", diff --git a/programManager.cpp b/programManager.cpp index 8324d4e..4438c53 100644 --- a/programManager.cpp +++ b/programManager.cpp @@ -1402,10 +1402,13 @@ int ProgramManager::convertLink(std::string redirectLink, AccountManager * accou for (int i = 1; i <= 3; ++i) { std::string newUrl = pageManager.getUrlAfterRedirect("https://s.to" + redirectLink); + //wenn function fehl schlug beende das Programm if (newUrl == "-1") { if(settings->debugMode) std::cerr << ">>> Debug In " << __FUNCTION__ << ": getUrlAfterRedirect f() failed." << std::endl; return 102; + + // wenn nach der Umwandlung immern och ein redirect vorhanden ist, also wenn z.B.: account gewechselt werden muss } else if(newUrl.find("/s.to/redirect/") != std::string::npos ) { if(settings->debugMode) std::cout << "Warnung: Redirect Link nach umwandlung (Capcha?) --> Neuer Account" << std::endl; @@ -1416,6 +1419,17 @@ int ProgramManager::convertLink(std::string redirectLink, AccountManager * accou } continue; + //wenn nach der Umwandlung https://s.to/ vorhanden ist, die ist wenn der Link Ungültig war: + } else if (newUrl == "https://s.to/") { + std::cout << " => " << red << folgenID << ( (folgenID == "") ? "" : ": " ) << "Ungültige Url: 'https://s.to" << redirectLink << "'\033[0m" << std::endl; + if(settings->outputFilePath != "") + if(pageManager.writeToFile(settings->outputFilePath, folgenID + ( (folgenID == "") ? "" : ": " ) + "Ungültige Url: https://s.to" + redirectLink) != 0) { + if(settings->debugMode) + std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl; + return 108; + } + return 0; + //sonst war die umwandlung erfolgreich } else { std::cout << " => " << folgenID << ( (folgenID == "") ? "" : ": " ) << green << newUrl << "\033[0m" << std::endl; if(settings->outputFilePath != "") @@ -1427,6 +1441,8 @@ int ProgramManager::convertLink(std::string redirectLink, AccountManager * accou return 0; } } + + //nach 3temn Versuch gib error aus: std::cout << " => " << folgenID << ( (folgenID == "") ? "" : ": " ) << red << "https://s.to" << redirectLink << "\033[0m" << std::endl; if(settings->outputFilePath != "") { if(pageManager.writeToFile(settings->outputFilePath, folgenID + ( (folgenID == "") ? "" : ": " ) + redirectLink) != 0) {