forked from markus/S_New4
v6.3.1: fix missing replace SZ in new,popular & info modus + fix 403
error when loading pages
This commit is contained in:
parent
b326752b24
commit
6ead42c6c8
@ -226,12 +226,11 @@ Reply PageManager::getServerRequest(std::string protocol, std::string Url, bool
|
|||||||
} else
|
} else
|
||||||
returnUrl=url;
|
returnUrl=url;
|
||||||
|
|
||||||
|
|
||||||
/* always cleanup */ /* Mach den Griff zu, schreib die Kekse! */
|
/* always cleanup */ /* Mach den Griff zu, schreib die Kekse! */
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
|
|
||||||
|
|
||||||
if(returnUrl.find("/_ray/pow") != std::string::npos) {
|
if(returnUrl.find("/_ray/pow") != std::string::npos || readBuffer.find("<head><title>403 Forbidden</title></head>") != std::string::npos ) {
|
||||||
std::cout << " \33[2K\r => CLOUD FLARE PROTECTION (Try " << rek_num << "/15)..." << std::flush;
|
std::cout << " \33[2K\r => CLOUD FLARE PROTECTION (Try " << rek_num << "/15)..." << std::flush;
|
||||||
usleep(400000);
|
usleep(400000);
|
||||||
|
|
||||||
@ -521,7 +520,7 @@ checkNameRply PageManager::checkName(std::vector<PAGE> &pages, std::string Name,
|
|||||||
|
|
||||||
if(useFirstPage) {
|
if(useFirstPage) {
|
||||||
if(debugMode)
|
if(debugMode)
|
||||||
std::cerr << "Nimm gleiche diese Seite, da useFirstPage auf true ist: " << pages.at(i).url << std::endl;
|
std::cout << "Nimm gleiche diese Seite, da useFirstPage auf true ist: " << pages.at(i).url << std::endl;
|
||||||
break; // nimm gleich das erste
|
break; // nimm gleich das erste
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -574,7 +573,7 @@ std::string PageManager::getLinks(std::string HTML)
|
|||||||
std::cerr << " => WARNUNG KONNTE Punkt' " << e << "' nicht nach den Links finden; nächster Versuch..." << std::endl;
|
std::cerr << " => WARNUNG KONNTE Punkt' " << e << "' nicht nach den Links finden; nächster Versuch..." << std::endl;
|
||||||
} else {
|
} else {
|
||||||
if(debugMode && b > 1)
|
if(debugMode && b > 1)
|
||||||
std::cerr << " => INFO: Punkt' " << e << "' gefunden an: " << pos << std::endl;
|
std::cout << " => INFO: Punkt' " << e << "' gefunden an: " << pos << std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1100,13 +1100,13 @@ int unterOption_info(Settings *settings, int argc, char **argv)
|
|||||||
{"socks5-proxy", required_argument, nullptr, 'p'},
|
{"socks5-proxy", required_argument, nullptr, 'p'},
|
||||||
{"output-file", required_argument, nullptr, 'o'},
|
{"output-file", required_argument, nullptr, 'o'},
|
||||||
{"internet-pages", required_argument, nullptr, 'i'},
|
{"internet-pages", required_argument, nullptr, 'i'},
|
||||||
{"lade-bild-herunter", required_argument, nullptr, 'i'},
|
{"lade-bild-herunter", required_argument, nullptr, 'l'},
|
||||||
|
|
||||||
{"use-first-page", no_argument, nullptr, 'f'},
|
{"use-first-page", no_argument, nullptr, 'f'},
|
||||||
{"help", no_argument, nullptr, 'h'},
|
{"help", no_argument, nullptr, 'h'},
|
||||||
{"colorless", no_argument, nullptr, 'c'},
|
{"colorless", no_argument, nullptr, 'c'},
|
||||||
{"debug-mode", no_argument, nullptr, 'd'},
|
{"debug-mode", no_argument, nullptr, 'd'},
|
||||||
{"skip-episoden-names", no_argument, nullptr, 'l'},
|
{"skip-episoden-names", no_argument, nullptr, 's'},
|
||||||
{"no-log", no_argument, nullptr, 'n'},
|
{"no-log", no_argument, nullptr, 'n'},
|
||||||
|
|
||||||
{nullptr, no_argument, nullptr, 0}
|
{nullptr, no_argument, nullptr, 0}
|
||||||
|
@ -24,7 +24,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 "6.3.0"
|
#define VERSION "6.3.1"
|
||||||
#define DEFAULT_FILE_VERSION "2.5"
|
#define DEFAULT_FILE_VERSION "2.5"
|
||||||
|
|
||||||
|
|
||||||
|
@ -213,12 +213,12 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
//Führe unterfunction zum suchen von Serien aus, aber ohne suche auszugeben und speichere datein in variable
|
//Führe unterfunction zum suchen von Serien aus, aber ohne suche auszugeben und speichere datein in variable
|
||||||
if(searchModus(settings, &finds, true) != 0) {
|
if(searchModus(settings, &finds, true) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Function searchModus returned error." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Function searchModus returned error." << std::endl;
|
||||||
return 24;
|
return 24;
|
||||||
|
|
||||||
} else if( finds == "" ) {
|
} else if( finds == "" ) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": ERROR:?? searchModus's returnValue = '' => Nothing found!" << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": ERROR:?? searchModus's returnValue = '' => Nothing found!" << std::endl;
|
||||||
|
|
||||||
|
|
||||||
return NO_ERROR_BUT_EXIT_RETURN;
|
return NO_ERROR_BUT_EXIT_RETURN;
|
||||||
@ -226,7 +226,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
// Wenn der Rückgabe wert ungültig ist brich ab...
|
// Wenn der Rückgabe wert ungültig ist brich ab...
|
||||||
else if( finds.find("|/") == std::string::npos ) { // ||
|
else if( finds.find("|/") == std::string::npos ) { // ||
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": searchModus's returnValue contains no / or | => error " << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": searchModus's returnValue contains no / or | => error " << std::endl;
|
||||||
|
|
||||||
return 121; // error -10101 (NO_ERROR_BUT_EXIT_RETURN);
|
return 121; // error -10101 (NO_ERROR_BUT_EXIT_RETURN);
|
||||||
|
|
||||||
@ -296,7 +296,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
|
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Return value from searchModus.subStr(pos(/)-> next |, after /) is ''." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Return value from searchModus.subStr(pos(/)-> next |, after /) is ''." << std::endl;
|
||||||
return 48;
|
return 48;
|
||||||
}
|
}
|
||||||
hasNewName = true;
|
hasNewName = true;
|
||||||
@ -327,7 +327,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
if ( line != "") {
|
if ( line != "") {
|
||||||
std::cout << " => Abbruch..." << std::endl;
|
std::cout << " => Abbruch..." << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": User tipped an Value => wrong serie." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": User tipped an Value => wrong serie." << std::endl;
|
||||||
return NO_ERROR_BUT_EXIT_RETURN;
|
return NO_ERROR_BUT_EXIT_RETURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +335,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
if ( (finds = finds.substr( finds.find("|/") + 2, finds.find("|", finds.find("|/") + 2) - finds.find("|/") -2) ) == "" ) {
|
if ( (finds = finds.substr( finds.find("|/") + 2, finds.find("|", finds.find("|/") + 2) - finds.find("|/") -2) ) == "" ) {
|
||||||
std::cout << " => Error: Konnte den Namen aus der zurückgegebenen Zeile nicht extrahieren." << std::endl;
|
std::cout << " => Error: Konnte den Namen aus der zurückgegebenen Zeile nicht extrahieren." << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Return value from searchModus.subStr(pos(/)-> next |, after /) is ''." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Return value from searchModus.subStr(pos(/)-> next |, after /) is ''." << std::endl;
|
||||||
return 46;
|
return 46;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
if( !found ) {
|
if( !found ) {
|
||||||
std::cout << " => Error: Konnte '" << gewollteSeitenUrl << "' nicht als Valide Seite erkennen!" << std::endl;
|
std::cout << " => Error: Konnte '" << gewollteSeitenUrl << "' nicht als Valide Seite erkennen!" << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ":failed to search url in pagesList from setings object" << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ":failed to search url in pagesList from setings object" << std::endl;
|
||||||
return 45;
|
return 45;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -370,12 +370,12 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
else if( ret.status == ret.NOTHING_FOUND ) {
|
else if( ret.status == ret.NOTHING_FOUND ) {
|
||||||
std::cout << " => Error: Konnte die von der Suche vorgeschlagene Serie nicht finden." << std::endl;
|
std::cout << " => Error: Konnte die von der Suche vorgeschlagene Serie nicht finden." << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Extracted Name from searchModus is invalid." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Extracted Name from searchModus is invalid." << std::endl;
|
||||||
return 47;
|
return 47;
|
||||||
} else if( ret.status == ret.NO_WORKING_PAGE ) {
|
} else if( ret.status == ret.NO_WORKING_PAGE ) {
|
||||||
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -384,7 +384,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
|||||||
newNameAndPage.correct_name = ret.correct_name;
|
newNameAndPage.correct_name = ret.correct_name;
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Use new SerienName: '" << ret.correct_name << "' (" << ret.url_name << ")." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Use new SerienName: '" << ret.correct_name << "' (" << ret.url_name << ")." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ int ProgramManager::checkLastProgrammUpdate(Settings *settings)
|
|||||||
//Wenn die Funktion deaktiviert ist brich ab, wenn nicht nur diffdays verlangt wird
|
//Wenn die Funktion deaktiviert ist brich ab, wenn nicht nur diffdays verlangt wird
|
||||||
if(settings->programmUpdateWarningDays == 0) {
|
if(settings->programmUpdateWarningDays == 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": In settings: Programm --- upDateWaring is deaktivated(seted to 0)." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": In settings: Programm --- upDateWaring is deaktivated(seted to 0)." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -405,18 +405,18 @@ int ProgramManager::checkLastProgrammUpdate(Settings *settings)
|
|||||||
if(!ofs2.is_open()) {
|
if(!ofs2.is_open()) {
|
||||||
perror(("Konnte die Datei '" + settings->lastProgrammUpdateDateFilePath + "' nicht öffnen").c_str());
|
perror(("Konnte die Datei '" + settings->lastProgrammUpdateDateFilePath + "' nicht öffnen").c_str());
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Failed to create Last Programm Update Date File:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Failed to create Last Programm Update Date File:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Ordfolgreich Last Programm UpdateTime Save File erstellt:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Ordfolgreich Last Programm UpdateTime Save File erstellt:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
||||||
ofs2 << "0" << std::endl;
|
ofs2 << "0" << std::endl;
|
||||||
ofs2.close();
|
ofs2.close();
|
||||||
ifs.open(settings->lastProgrammUpdateDateFilePath);
|
ifs.open(settings->lastProgrammUpdateDateFilePath);
|
||||||
if(!ifs.is_open()) {
|
if(!ifs.is_open()) {
|
||||||
perror(("Konnte die Datei '" + settings->lastProgrammUpdateDateFilePath + "' nicht öffnen").c_str());
|
perror(("Konnte die Datei '" + settings->lastProgrammUpdateDateFilePath + "' nicht öffnen").c_str());
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Failed to open Last Programm Update Date File:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Failed to open Last Programm Update Date File:'" << settings->lastProgrammUpdateDateFilePath << "'." << std::endl;
|
||||||
return 4545;
|
return 4545;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -426,7 +426,7 @@ int ProgramManager::checkLastProgrammUpdate(Settings *settings)
|
|||||||
if(!std::getline(ifs, line).good()) {
|
if(!std::getline(ifs, line).good()) {
|
||||||
perror("GetLine from Date failed");
|
perror("GetLine from Date failed");
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Get the first Line of the Last Programm UpdateDate File failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Get the first Line of the Last Programm UpdateDate File failed." << std::endl;
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
} else if( ( ( difDays = static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) )) >= settings->programmUpdateWarningDays) {
|
} else if( ( ( difDays = static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) )) >= settings->programmUpdateWarningDays) {
|
||||||
@ -464,7 +464,7 @@ int ProgramManager::checkLastProgrammUpdate(Settings *settings)
|
|||||||
std::cout << "Letzte Update Suche vor " << difDays << " tagen!" << std::endl;
|
std::cout << "Letzte Update Suche vor " << difDays << " tagen!" << std::endl;
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Exit with success." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Exit with success." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ int ProgramManager::checkLastUpdate(Settings *settings, ssize_t *days = nullptr)
|
|||||||
//Wenn die Funktion deaktiviert ist brich ab, wenn nicht nur diffdays verlangt wird
|
//Wenn die Funktion deaktiviert ist brich ab, wenn nicht nur diffdays verlangt wird
|
||||||
if(settings->updateWarningDays == 0 && !days) {
|
if(settings->updateWarningDays == 0 && !days) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": In settings: upDateWaring is deaktivated(seted to 0)." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": In settings: upDateWaring is deaktivated(seted to 0)." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -484,18 +484,18 @@ int ProgramManager::checkLastUpdate(Settings *settings, ssize_t *days = nullptr)
|
|||||||
if(!ofs2.is_open()) {
|
if(!ofs2.is_open()) {
|
||||||
perror(("Konnte die Datei '" + settings->lastUpdateDateFilePath + "' nicht öffnen").c_str());
|
perror(("Konnte die Datei '" + settings->lastUpdateDateFilePath + "' nicht öffnen").c_str());
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Failed to create Last Update Date File:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Failed to create Last Update Date File:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
} else {
|
} else {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Ordfolgreich LastUpdateTime Save File erstellt:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Ordfolgreich LastUpdateTime Save File erstellt:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
||||||
ofs2 << "0" << std::endl;
|
ofs2 << "0" << std::endl;
|
||||||
ofs2.close();
|
ofs2.close();
|
||||||
ifs.open(settings->lastUpdateDateFilePath);
|
ifs.open(settings->lastUpdateDateFilePath);
|
||||||
if(!ifs.is_open()) {
|
if(!ifs.is_open()) {
|
||||||
perror(("Konnte die Datei '" + settings->lastUpdateDateFilePath + "' nicht öffnen").c_str());
|
perror(("Konnte die Datei '" + settings->lastUpdateDateFilePath + "' nicht öffnen").c_str());
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Failed to open Last Update Date File:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Failed to open Last Update Date File:'" << settings->lastUpdateDateFilePath << "'." << std::endl;
|
||||||
return 4545;
|
return 4545;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -505,7 +505,7 @@ int ProgramManager::checkLastUpdate(Settings *settings, ssize_t *days = nullptr)
|
|||||||
if(!std::getline(ifs, line).good()) {
|
if(!std::getline(ifs, line).good()) {
|
||||||
perror("GetLine from Date failed");
|
perror("GetLine from Date failed");
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Get the first Line of the LastUpdateDate File failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Get the first Line of the LastUpdateDate File failed." << std::endl;
|
||||||
return 2;
|
return 2;
|
||||||
|
|
||||||
} else if( ( ( difDays = static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) )) >= settings->updateWarningDays) {
|
} else if( ( ( difDays = static_cast<long long>(pageManager.getDate()) - atoll(line.c_str()) )) >= settings->updateWarningDays) {
|
||||||
@ -520,7 +520,7 @@ int ProgramManager::checkLastUpdate(Settings *settings, ssize_t *days = nullptr)
|
|||||||
*days = difDays;
|
*days = difDays;
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Exit with success." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Exit with success." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -570,13 +570,13 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
if( ( res = sucheNach_1_Serien(settings, pageManager, retVal) ) != 0) {
|
if( ( res = sucheNach_1_Serien(settings, pageManager, retVal) ) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien failed or found more options." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien failed or found more options." << std::endl;
|
||||||
return (res == -10101) ? 0 : 202;
|
return (res == -10101) ? 0 : 202;
|
||||||
}
|
}
|
||||||
} else if( retVal.status == retVal.NO_WORKING_PAGE ) {
|
} else if( retVal.status == retVal.NO_WORKING_PAGE ) {
|
||||||
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -592,7 +592,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->default_checkPath != "")
|
if(settings->default_checkPath != "")
|
||||||
if(listDir(dirFiles, settings->default_checkPath, settings->default_maxDirs, settings->debugMode ) != 0) {
|
if(listDir(dirFiles, settings->default_checkPath, settings->default_maxDirs, settings->debugMode ) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": listDir failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": listDir failed." << std::endl;
|
||||||
return 28;
|
return 28;
|
||||||
}
|
}
|
||||||
if(dirFiles.length() > 0) //Entferne von der liste das \n am ende
|
if(dirFiles.length() > 0) //Entferne von der liste das \n am ende
|
||||||
@ -629,7 +629,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->outputFilePaths.size() != 0 && !fileExists( settings->default_checkPath ))
|
if(settings->outputFilePaths.size() != 0 && !fileExists( settings->default_checkPath ))
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths, "Serie: " + settings->name + " (" + nameInUrl + ")" ) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths, "Serie: " + settings->name + " (" + nameInUrl + ")" ) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile Function fails when write Name." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile Function fails when write Name." << std::endl;
|
||||||
return 31;
|
return 31;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -657,7 +657,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->maxThreads != 0)
|
if(settings->maxThreads != 0)
|
||||||
if(waitForThreads() != 0) {
|
if(waitForThreads() != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
||||||
return 261;
|
return 261;
|
||||||
}
|
}
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
@ -669,7 +669,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
//Find out number of all episodes
|
//Find out number of all episodes
|
||||||
if( (tmp_reply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel))).html == "-1") {
|
if( (tmp_reply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel))).html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download season page." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download season page." << std::endl;
|
||||||
return 40;
|
return 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -687,7 +687,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->maxThreads != 0)
|
if(settings->maxThreads != 0)
|
||||||
if(waitForThreads() != 0) {
|
if(waitForThreads() != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
||||||
return 261;
|
return 261;
|
||||||
}
|
}
|
||||||
std::cout << " > Fertig, da Folge " << folge << " größer ist als Stopfolge " << settings->stopEpisode << "."<< std::endl;
|
std::cout << " > Fertig, da Folge " << folge << " größer ist als Stopfolge " << settings->stopEpisode << "."<< std::endl;
|
||||||
@ -699,7 +699,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->maxThreads != 0)
|
if(settings->maxThreads != 0)
|
||||||
if(waitForThreads() != 0) {
|
if(waitForThreads() != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
||||||
return 267;
|
return 267;
|
||||||
}
|
}
|
||||||
std::cout << " > Fertig, da Folge " << folge << " größer ist als Stopfolge " << settings->stopEpisode << std::endl
|
std::cout << " > Fertig, da Folge " << folge << " größer ist als Stopfolge " << settings->stopEpisode << std::endl
|
||||||
@ -726,14 +726,14 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(pthread_create(&threadList[nextThread]->thread, nullptr, threadFunction, reinterpret_cast<void*>(threadList[nextThread])) != 0 ) {
|
if(pthread_create(&threadList[nextThread]->thread, nullptr, threadFunction, reinterpret_cast<void*>(threadList[nextThread])) != 0 ) {
|
||||||
perror("pthread_creat failed");
|
perror("pthread_creat failed");
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Create thread for redirect converting failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Create thread for redirect converting failed." << std::endl;
|
||||||
return 48;
|
return 48;
|
||||||
}
|
}
|
||||||
++nextThread;
|
++nextThread;
|
||||||
} else { // Sonnst warte bis alle Fertig sind und restarte die Folge
|
} else { // Sonnst warte bis alle Fertig sind und restarte die Folge
|
||||||
if(waitForThreads() != 0) {
|
if(waitForThreads() != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
||||||
return 231;
|
return 231;
|
||||||
}
|
}
|
||||||
nextThread=0;
|
nextThread=0;
|
||||||
@ -747,7 +747,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
tmp_reply =pageManager.getServerRequest( page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel) + "/episode-" + std::to_string(folge));
|
tmp_reply =pageManager.getServerRequest( page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel) + "/episode-" + std::to_string(folge));
|
||||||
if(tmp_reply.html == "-1") {
|
if(tmp_reply.html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download episoden page." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest failed when download episoden page." << std::endl;
|
||||||
return 50;
|
return 50;
|
||||||
}
|
}
|
||||||
std::string allLinks = pageManager.getLinks(tmp_reply.html);
|
std::string allLinks = pageManager.getLinks(tmp_reply.html);
|
||||||
@ -767,13 +767,13 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
line.erase(line.find("\""));
|
line.erase(line.find("\""));
|
||||||
if(convertLink(page, line, &accountManager, settings, staffel, folge, allLinks) != 0) {
|
if(convertLink(page, line, &accountManager, settings, staffel, folge, allLinks) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": convertLink failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": convertLink failed." << std::endl;
|
||||||
return 51;
|
return 51;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Stop beacause same episode every account can only 2 videos not 10-12
|
//Stop beacause same episode every account can only 2 videos not 10-12
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Stop Program, because '*'-Hoster is inperformatnt: Every Account can only 2 Vidoes not 10-12." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Stop Program, because '*'-Hoster is inperformatnt: Every Account can only 2 Vidoes not 10-12." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -783,7 +783,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
std::cout << allLinks << std::endl << ( (Link == "") ? "" : " -> Link: 'https://" + page.url) << Link << ( (Link == "") ? "" : "'\n" );
|
std::cout << allLinks << std::endl << ( (Link == "") ? "" : " -> Link: 'https://" + page.url) << Link << ( (Link == "") ? "" : "'\n" );
|
||||||
if(convertLink(page, Link, &accountManager, settings, staffel, folge, allLinks) != 0) {
|
if(convertLink(page, Link, &accountManager, settings, staffel, folge, allLinks) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": convert Link failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": convert Link failed." << std::endl;
|
||||||
return 51;
|
return 51;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -798,7 +798,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
|||||||
if(settings->maxThreads != 0)
|
if(settings->maxThreads != 0)
|
||||||
if(waitForThreads() != 0) {
|
if(waitForThreads() != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Wait for the Threads failed." << std::endl;
|
||||||
return 292;
|
return 292;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,13 +869,13 @@ int ProgramManager::directLinkModus(Settings *settings)
|
|||||||
|
|
||||||
if(convertLink(page, redL, &accountManager, settings) != 0) {
|
if(convertLink(page, redL, &accountManager, settings) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": convert Link failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": convert Link failed." << std::endl;
|
||||||
return 78;
|
return 78;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Success." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Success." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,7 +929,7 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no
|
|||||||
std::cout << "Erfolgreich geupdatet: Die Serienliste ist nun auf dem neusten Stand." << std::endl;
|
std::cout << "Erfolgreich geupdatet: Die Serienliste ist nun auf dem neusten Stand." << std::endl;
|
||||||
if (settings->name == "") {
|
if (settings->name == "") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Stop after Update: No Name => Only Updating." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Stop after Update: No Name => Only Updating." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -951,7 +951,7 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no
|
|||||||
//Check for last Update.. (glaub hier nocghmal die funktion, um datei zu erstellen, auch wenn ausgabe deaktiviert is, kann aber auch sein dass der teil ghier weg gehört)
|
//Check for last Update.. (glaub hier nocghmal die funktion, um datei zu erstellen, auch wenn ausgabe deaktiviert is, kann aber auch sein dass der teil ghier weg gehört)
|
||||||
if(checkLastUpdate(settings) != 0) {
|
if(checkLastUpdate(settings) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": checkLastUpdate function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": checkLastUpdate function failed." << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -961,7 +961,7 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no
|
|||||||
std::cout << " => Keine SerienListe vorhanden. Erstelle eine neue..." << std::endl;
|
std::cout << " => Keine SerienListe vorhanden. Erstelle eine neue..." << std::endl;
|
||||||
if(searchModus_update(settings) != 0) {
|
if(searchModus_update(settings) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": searchModus_update function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": searchModus_update function failed." << std::endl;
|
||||||
return 354;
|
return 354;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -1130,7 +1130,7 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no
|
|||||||
|
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": success." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": success." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1152,13 +1152,13 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
if( ( res = sucheNach_1_Serien(settings, pageManager, retV) ) != 0) {
|
if( ( res = sucheNach_1_Serien(settings, pageManager, retV) ) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien function failed." << std::endl;
|
||||||
return (res == -10101) ? 0 : 28;
|
return (res == -10101) ? 0 : 28;
|
||||||
}
|
}
|
||||||
} else if( retV.status == retV.NO_WORKING_PAGE ) {
|
} else if( retV.status == retV.NO_WORKING_PAGE ) {
|
||||||
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << " => Error: Keine Funktionierende Internetseite!" << std::endl;
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": Keine Funktionierende Internetseite!" << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
std::string nameInUrl = retV.url_name;
|
std::string nameInUrl = retV.url_name;
|
||||||
@ -1171,7 +1171,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
if( !settings->no_log && pageManager.writeToFile(settings->outputFilePaths, "\n\nSerie: " + settings->name + " (" + nameInUrl + ")") != 0)
|
if( !settings->no_log && pageManager.writeToFile(settings->outputFilePaths, "\n\nSerie: " + settings->name + " (" + nameInUrl + ")") != 0)
|
||||||
{
|
{
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 100;
|
return 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1180,7 +1180,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
Reply tmp_reply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl);
|
Reply tmp_reply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl);
|
||||||
if(tmp_reply.html == "-1") {
|
if(tmp_reply.html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed: at homepage." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed: at homepage." << std::endl;
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1204,7 +1204,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
Reply tmpReply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel));
|
Reply tmpReply = pageManager.getServerRequest(page.protocol, page.url + page.UrlDir + nameInUrl + "/staffel-" + std::to_string(staffel));
|
||||||
if(tmpReply.html == "-1") {
|
if(tmpReply.html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed: at season page." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed: at season page." << std::endl;
|
||||||
return 40;
|
return 40;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1216,7 +1216,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
+ " hat " + std::to_string(folgen) + " Folge" + ((folgen > 1) ? "n" : "") + ".\n") != 0)
|
+ " hat " + std::to_string(folgen) + " Folge" + ((folgen > 1) ? "n" : "") + ".\n") != 0)
|
||||||
{
|
{
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 110;
|
return 110;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1261,7 +1261,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
+ std::to_string(gesammtFolge) + " ( S" + ( (staffel < 10) ? "0" : "" ) + std::to_string(staffel) + "E"
|
+ std::to_string(gesammtFolge) + " ( S" + ( (staffel < 10) ? "0" : "" ) + std::to_string(staffel) + "E"
|
||||||
+ ( ( atoi( line.substr(0, pos).c_str() ) < 10) ? "0" : "" ) + line.substr(0, pos) + " ):" ) != 0) {
|
+ ( ( atoi( line.substr(0, pos).c_str() ) < 10) ? "0" : "" ) + line.substr(0, pos) + " ):" ) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 105;
|
return 105;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1279,7 +1279,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
std::cout << lila << " > Titel 1: " << Lightyellow << titel << white << std::endl;
|
std::cout << lila << " > Titel 1: " << Lightyellow << titel << white << std::endl;
|
||||||
if(!settings->no_log && pageManager.writeToFile(settings->outputFilePaths, " > Titel 1: " + titel) != 0) {
|
if(!settings->no_log && pageManager.writeToFile(settings->outputFilePaths, " > Titel 1: " + titel) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 110;
|
return 110;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1298,7 +1298,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
std::cout << lila << " > Titel 2: " << Darkyellow << titel << white << std::endl;
|
std::cout << lila << " > Titel 2: " << Darkyellow << titel << white << std::endl;
|
||||||
if(!settings->no_log && pageManager.writeToFile(settings->outputFilePaths, " > Titel 2: " + titel) != 0) {
|
if(!settings->no_log && pageManager.writeToFile(settings->outputFilePaths, " > Titel 2: " + titel) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 120;
|
return 120;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1358,16 +1358,9 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
}
|
}
|
||||||
std::string description = replace( replace( tmp_reply.html.substr(pos + 23, pos2 - pos - 23), "\n", "" ), "<br />", "" );
|
std::string description = replace( replace( tmp_reply.html.substr(pos + 23, pos2 - pos - 23), "\n", "" ), "<br />", "" );
|
||||||
|
|
||||||
//remove bug text:
|
//remove html special characters in text:
|
||||||
description = replace(description, "&quot;", "\""); //
|
description = replace(description, "&quot;", "\""); //
|
||||||
|
pageManager.replaceSZ(description);
|
||||||
description = replace(description, "&", "&"); //
|
|
||||||
description = replace(description, "<", "<"); //
|
|
||||||
description = replace(description, ">", ">"); //
|
|
||||||
|
|
||||||
description = replace(description, "<br />", " "); //
|
|
||||||
description = replace(description, """, "\""); //
|
|
||||||
description = replace(description, "'", "'"); //
|
|
||||||
|
|
||||||
|
|
||||||
//Genres
|
//Genres
|
||||||
@ -1401,7 +1394,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
|
|
||||||
std::cout << lila << "\nProduktion von " << blue << startStopDates[0] << lila << " bis " << blue << startStopDates[1] << lila << std::endl
|
std::cout << lila << "\nProduktion von " << blue << startStopDates[0] << lila << " bis " << blue << startStopDates[1] << lila << std::endl
|
||||||
<< "FSK: " << blue << fsk << lila << std::endl
|
<< "FSK: " << blue << fsk << lila << std::endl
|
||||||
<< "Cover Bild: " << green << coverLink << lila << std::endl
|
<< "Cover Bild: " << green << page.protocol + page.url + coverLink << lila << std::endl
|
||||||
<< "Genre(s): " << blue << std::flush;
|
<< "Genre(s): " << blue << std::flush;
|
||||||
for( const auto &e : genres)
|
for( const auto &e : genres)
|
||||||
std::cout << e << " ";
|
std::cout << e << " ";
|
||||||
@ -1419,7 +1412,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
"\nBeschreibung: " + description + "\n") != 0)
|
"\nBeschreibung: " + description + "\n") != 0)
|
||||||
{
|
{
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 130;
|
return 130;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1432,7 +1425,7 @@ int ProgramManager::infoModus(Settings *settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": success exit." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": success exit." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1450,7 +1443,7 @@ int ProgramManager::newsModus(Settings *settings)
|
|||||||
std::string html = pageManager.getServerRequest(page.protocol, page.url +"/neue-episoden").html;
|
std::string html = pageManager.getServerRequest(page.protocol, page.url +"/neue-episoden").html;
|
||||||
if(html == "-1") {
|
if(html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1483,6 +1476,7 @@ int ProgramManager::newsModus(Settings *settings)
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
std::string name = line.substr(pos + 8, pos2 - pos - 8);
|
std::string name = line.substr(pos + 8, pos2 - pos - 8);
|
||||||
|
pageManager.replaceSZ(name);
|
||||||
|
|
||||||
if( (pos = line.find("blue2\">")) == std::string::npos) {
|
if( (pos = line.find("blue2\">")) == std::string::npos) {
|
||||||
std::cout << " => Error: Konnte Position von 'blue2\">' nicht finden" <<std::endl;
|
std::cout << " => Error: Konnte Position von 'blue2\">' nicht finden" <<std::endl;
|
||||||
@ -1813,10 +1807,10 @@ int ProgramManager::printPopularSeries(Settings *settings)
|
|||||||
std::cout << " => Error Keine Internet Seiten vorhanden." << std::endl;
|
std::cout << " => Error Keine Internet Seiten vorhanden." << std::endl;
|
||||||
return -12;
|
return -12;
|
||||||
}
|
}
|
||||||
std::cout << "Pages: " << std::endl;
|
// std::cout << "Pages: " << std::endl;
|
||||||
for( const auto &page : settings->pagesInUse ) {
|
// for( const auto &page : settings->pagesInUse ) {
|
||||||
std::cout << page.name_id << std::endl;
|
// std::cout << page.name_id << std::endl;
|
||||||
}
|
// }
|
||||||
|
|
||||||
for( const auto &page : settings->pagesInUse ) {
|
for( const auto &page : settings->pagesInUse ) {
|
||||||
std::cout << ((settings->colorless) ? "" : "\033[93m") << "Auf '" << page.url << "'..." << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
std::cout << ((settings->colorless) ? "" : "\033[93m") << "Auf '" << page.url << "'..." << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
||||||
@ -1826,7 +1820,7 @@ int ProgramManager::printPopularSeries(Settings *settings)
|
|||||||
|
|
||||||
if(html == "-1") {
|
if(html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1879,6 +1873,8 @@ int ProgramManager::printPopularSeries(Settings *settings)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
std::string name = line.substr(pos + 4, pos2 - pos - 4);
|
std::string name = line.substr(pos + 4, pos2 - pos - 4);
|
||||||
|
pageManager.replaceSZ(name);
|
||||||
|
|
||||||
|
|
||||||
std::cout << " > Serie: " << ((settings->colorless) ? "" : "\033[96m") << name << ((settings->colorless) ? "" : "\033[0m") << ": "
|
std::cout << " > Serie: " << ((settings->colorless) ? "" : "\033[96m") << name << ((settings->colorless) ? "" : "\033[0m") << ": "
|
||||||
<< ((settings->colorless) ? "" : "\033[92m") << "(" + replace(href,page.UrlDir, "") + ")" << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
<< ((settings->colorless) ? "" : "\033[92m") << "(" + replace(href,page.UrlDir, "") + ")" << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
||||||
@ -1915,7 +1911,7 @@ int ProgramManager::searchModus_update(Settings *settings)
|
|||||||
|
|
||||||
if(reply.html == "-1") {
|
if(reply.html == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed." << std::endl;
|
||||||
else
|
else
|
||||||
std::cout << " -> Warnung: " << page.UrlDir << " ist fehlgeschlagen! " << std::endl;
|
std::cout << " -> Warnung: " << page.UrlDir << " ist fehlgeschlagen! " << std::endl;
|
||||||
continue;
|
continue;
|
||||||
@ -1933,7 +1929,7 @@ int ProgramManager::searchModus_update(Settings *settings)
|
|||||||
for ( auto t : tests ) {
|
for ( auto t : tests ) {
|
||||||
if(reply.html.find( t ) == std::string::npos) {
|
if(reply.html.find( t ) == std::string::npos) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": html doesnt contain:'" << t << "' after preparing." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": html doesnt contain:'" << t << "' after preparing." << std::endl;
|
||||||
std::cout << " -> Warnung: Überspringe: " << page.name_id << std::endl;
|
std::cout << " -> Warnung: Überspringe: " << page.name_id << std::endl;
|
||||||
cont = true;;
|
cont = true;;
|
||||||
}
|
}
|
||||||
@ -2128,7 +2124,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
std::cout << " => " << red << "KEINEN Hoster für die Folge " << replace(folgenID, "E", " E") << " gefunden." << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
std::cout << " => " << red << "KEINEN Hoster für die Folge " << replace(folgenID, "E", " E") << " gefunden." << ((settings->colorless) ? "" : "\033[0m") << std::endl;
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths, std::string("KEINEN Hoster für die Folge ") + replace(folgenID, "E", " E") + std::string(" gefunden.")) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths, std::string("KEINEN Hoster für die Folge ") + replace(folgenID, "E", " E") + std::string(" gefunden.")) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 130;
|
return 130;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -2138,7 +2134,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
"data-lang-key=\"2\"", "language=\"Eng\"" ), "data-lang-key=\"3\"", "language=\"GerSub\"") << std::endl;
|
"data-lang-key=\"2\"", "language=\"Eng\"" ), "data-lang-key=\"3\"", "language=\"GerSub\"") << std::endl;
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths, std::string("Keinen PASSENDEN Hoster für die Folge ") + replace(folgenID, "E", " E") + std::string(" gefunden.")) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths, std::string("Keinen PASSENDEN Hoster für die Folge ") + replace(folgenID, "E", " E") + std::string(" gefunden.")) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 138;
|
return 138;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2153,7 +2149,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
//wenn function fehl schlug beende das Programm
|
//wenn function fehl schlug beende das Programm
|
||||||
if (newUrl == "-1") {
|
if (newUrl == "-1") {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getUrlAfterRedirect f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": getUrlAfterRedirect f() failed." << std::endl;
|
||||||
return 102;
|
return 102;
|
||||||
|
|
||||||
//wenn nach der Umwandlung https://seriens tream.sx/ vorhanden ist, die ist wenn der Link Ungültig war:
|
//wenn nach der Umwandlung https://seriens tream.sx/ vorhanden ist, die ist wenn der Link Ungültig war:
|
||||||
@ -2163,7 +2159,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
if(settings->outputFilePaths.size() != 0)
|
if(settings->outputFilePaths.size() != 0)
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths, replace(folgenID, "E", " E") + ( (folgenID == "") ? "" : ": " ) + "Ungültige Url: https://" + page.url + redirectLink) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths, replace(folgenID, "E", " E") + ( (folgenID == "") ? "" : ": " ) + "Ungültige Url: https://" + page.url + redirectLink) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 108;
|
return 108;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2173,7 +2169,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
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(), settings->cookieFilePath + "_" + page.url) != 0) {
|
if(pageManager.login(page, accountManager->getNextAccount(), settings->cookieFilePath + "_" + page.url) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": login f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": login f() failed." << std::endl;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@ -2189,7 +2185,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
if(settings->outputFilePaths.size() != 0)
|
if(settings->outputFilePaths.size() != 0)
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths,folgenID + ( (folgenID == "") ? "" : ": " ) + newUrl) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths,folgenID + ( (folgenID == "") ? "" : ": " ) + newUrl) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 108;
|
return 108;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@ -2201,7 +2197,7 @@ int ProgramManager::convertLink(PAGE page, std::string redirectLink, AccountMana
|
|||||||
if(settings->outputFilePaths.size() != 0) {
|
if(settings->outputFilePaths.size() != 0) {
|
||||||
if(pageManager.writeToFile(settings->outputFilePaths, replace(folgenID, "E", " E") + ( (folgenID == "") ? "" : ": " ) + redirectLink) != 0) {
|
if(pageManager.writeToFile(settings->outputFilePaths, replace(folgenID, "E", " E") + ( (folgenID == "") ? "" : ": " ) + redirectLink) != 0) {
|
||||||
if(settings->debugMode)
|
if(settings->debugMode)
|
||||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
std::cout << ">>> Debug In " << __FUNCTION__ << ": writeToFile f() failed." << std::endl;
|
||||||
return 114;
|
return 114;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user