forked from markus/S_New4
make default modus stabil
This commit is contained in:
parent
37afa24186
commit
0162441d26
@ -1,13 +1,14 @@
|
||||
#include "accountManager.h"
|
||||
|
||||
AccountManager::AccountManager(std::string pathToFile, std::string pathToAccountNumberFile)
|
||||
: pathToAccountNumberFile(pathToAccountNumberFile)
|
||||
AccountManager::AccountManager(std::string pathToFil, std::string pathToAccountNumberFile, PAGE page)
|
||||
: pathToAccountNumberFile(pathToAccountNumberFile + "_" + page.name_id), pageInUse(page)
|
||||
{
|
||||
std::ifstream ifs(pathToFile);
|
||||
std::string pathToAccountsFile = pathToFil + "_" + page.name_id;
|
||||
std::ifstream ifs(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
if(writeDefault(pathToFile) != 0)
|
||||
if(writeDefault(pathToAccountsFile) != 0)
|
||||
exit(12);
|
||||
ifs.open(pathToFile);
|
||||
ifs.open(pathToAccountsFile);
|
||||
if(!ifs.is_open()) {
|
||||
std::cout << " => Error: Konnte Account File nicht öffnen" << std::endl;
|
||||
exit(13);
|
||||
@ -66,98 +67,113 @@ int AccountManager::writeDefault(std::string path)
|
||||
std::cout << " => Erstelle Datei mit Accounts unter: " << path << "..." <<std::endl;
|
||||
ofs << "# <- Am Anfang der Zeile deaktiviert diese." << std::endl;
|
||||
ofs << "#Email/Passwort - Falls diese gleich sind, geht auch nur Email oder Passwort" << std::endl;
|
||||
{
|
||||
ofs << "EntzueckendPackenderSkorpion@oida.icu" << std::endl;
|
||||
ofs << "HumorvollWundervollerDelfin@spam.care/HumorvollWundervollerDelfin@spam.care" << std::endl;
|
||||
ofs << "ExzellentPackenderHirsch@muell.icu/ExzellentPackenderHirsch@muell.icu" << std::endl;
|
||||
ofs << "GrandiosLeuchtenderPanda@papierkorb.me" << std::endl;
|
||||
ofs << "AttraktivPositiverSteinbock@magspam.net" << std::endl;
|
||||
ofs << "FreundlichKostbarerSteinbock@spam.care" << std::endl;
|
||||
ofs << "FabelhaftSelbstsichererUhu@spam.care" << std::endl;
|
||||
ofs << "HumorvollSinnlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "AnspruchsvollTraumhafterPavian@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendRiskanterLuchs@magspam.net" << std::endl;
|
||||
ofs << "BeruehmtMystischerPanda@ultra.fyi" << std::endl;
|
||||
ofs << "CharmantRasanterLoewe@existiert.net" << std::endl;
|
||||
ofs << "BedeutendLuesternerAal@existiert.net" << std::endl;
|
||||
ofs << "ElegantSelbstsichererAdler@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendKoeniglicherBaer@spam.care" << std::endl;
|
||||
ofs << "CharmantKostbarerLoewe@magspam.net" << std::endl;
|
||||
ofs << "BedeutendPrallerSkorpion@muellemail.com" << std::endl;
|
||||
ofs << "FreundlichPerfekterRochen@muellmail.com" << std::endl;
|
||||
ofs << "AusgelassenKostbarerBasilisk@magspam.net" << std::endl;
|
||||
ofs << "FabelhaftLebhafterSchakal@ultra.fyi" << std::endl;
|
||||
ofs << "ExzellentSchoenerSteinbock@existiert.net" << std::endl;
|
||||
ofs << "ErhellendLustvollerAdler@muell.icu" << std::endl;
|
||||
ofs << "ExzellentIdealerSchakal@muell.icu" << std::endl;
|
||||
ofs << "BrillantVitalerSalamander@spam.care" << std::endl;
|
||||
ofs << "BezauberndRiesigerSchakal@oida.icu" << std::endl;
|
||||
ofs << "DynamischWarmerBaer@magspam.net" << std::endl;
|
||||
ofs << "EmotionalLeidenschaftlicherBaer@oida.icu" << std::endl;
|
||||
ofs << "BewundernswertWarmerSchwan@oida.icu" << std::endl;
|
||||
ofs << "HuebschUnfassbarerAal@papierkorb.me" << std::endl;
|
||||
ofs << "FroehlichWundervollerBiber@muellmail.com" << std::endl;
|
||||
ofs << "BefreiendWilderDelfin@spam.care" << std::endl;
|
||||
ofs << "FreundlichStilvollerTiger@oida.icu" << std::endl;
|
||||
ofs << "EchtKoeniglicherStorch@existiert.net" << std::endl;
|
||||
ofs << "BefluegeltPrallerSchwan@spam.care" << std::endl;
|
||||
ofs << "ErhellendSeltenerSeeloewe@ultra.fyi" << std::endl;
|
||||
ofs << "FreundlichZuverlaessigerSchwan@spam.care" << std::endl;
|
||||
ofs << "HervorragendWundervollerReiher@oida.icu" << std::endl;
|
||||
ofs << "AnspruchsvollStilvollerUhu@magspam.net" << std::endl;
|
||||
ofs << "AnmutigTraumhafterHai@muellemail.com" << std::endl;
|
||||
ofs << "AtemberaubendIdealerTapir@ultra.fyi" << std::endl;
|
||||
ofs << "GeheimLeuchtenderLuchs@muellemail.com" << std::endl;
|
||||
ofs << "DuftendKlarerTapir@muellmail.com" << std::endl;
|
||||
ofs << "GeheimUnwiderstehlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "ExtravagantSpektakulaererAdler@spam.care" << std::endl;
|
||||
ofs << "BildlichWarmerLoewe@oida.icu" << std::endl;
|
||||
ofs << "AktivKlarerHai@spam.care" << std::endl;
|
||||
ofs << "AktivKostbarerElch@oida.icu" << std::endl;
|
||||
ofs << "Strust1991@jourrapide.com" << std::endl;
|
||||
ofs << "Natchoughe1928@dayrep.com" << std::endl;
|
||||
ofs << "zweirot@einrot.com" << std::endl;
|
||||
ofs << "AktivMagischerFrosch@existiert.net" << std::endl;
|
||||
ofs << "ErhellendPerfekterDachs@existiert.net" << std::endl;
|
||||
ofs << "ojfvwj.fgf@existiert.net" << std::endl;
|
||||
ofs << "lusiouae@wegwerfemail.de" << std::endl;
|
||||
ofs << "fraiwrou@wegwerfemail.de" << std::endl;
|
||||
ofs << "driotean@wegwerfemail.de" << std::endl;
|
||||
ofs << "tiaprour@wegwerfemail.de" << std::endl;
|
||||
ofs << "FeurigWarmerPapagei@existiert.net" << std::endl;
|
||||
ofs << "FrischStilvollerPavian@magspam.net" << std::endl;
|
||||
ofs << "FeurigZaghafterLoewe@muellmail.com" << std::endl;
|
||||
ofs << "GigantischKoeniglicherSchwan@magspam.net" << std::endl;
|
||||
ofs << "FreizuegigPersoenlicherLemming@spam.care" << std::endl;
|
||||
ofs << "BelebtIntelligenterHusky@papierkorb.me" << std::endl;
|
||||
ofs << "FreundlichMaximalerSpecht@muellmail.com" << std::endl;
|
||||
ofs << "FreundlichStarkerHirsch@ultra.fyi" << std::endl;
|
||||
ofs << "ErstklassigRasanterElch@oida.icu" << std::endl;
|
||||
ofs << "FreundlichStarkerPavian@ultra.fyi" << std::endl;
|
||||
ofs << "EinfuehlsamRiskanterPapagei@oida.icu" << std::endl;
|
||||
ofs << "FantastischPositiverHirsch@existiert.net" << std::endl;
|
||||
ofs << "GeborgenIndividuellerOtter@muell.icu" << std::endl;
|
||||
ofs << "HervorragendSensibelerWal@oida.icu" << std::endl;
|
||||
ofs << "HerrlichIndividuellerPelikan@spam.care" << std::endl;
|
||||
ofs << "HerrlichLeuchtenderTapir@muellmail.com" << std::endl;
|
||||
ofs << "ErstaunlichIntensiverEsel@magspam.net" << std::endl;
|
||||
ofs << "ExtravagantPraechtigerWal@muellemail.com" << std::endl;
|
||||
ofs << "GravierendWundervollerFalke@spam.care" << std::endl;
|
||||
ofs << "EntzueckendLebhafterFlamingo@magspam.net" << std::endl;
|
||||
ofs << "GeheimSprachloserStorch@existiert.net" << std::endl;
|
||||
ofs << "GravierendVitalerOtter@spam.care" << std::endl;
|
||||
ofs << "GrenzenlosInteressanterElch@oida.icu" << std::endl;
|
||||
ofs << "HellPackenderGoldfisch@muellemail.com" << std::endl;
|
||||
ofs << "AbenteuerlichSelbstloserFalke@muell.icu" << std::endl;
|
||||
ofs << "EmotionalZaghafterPapagei@magspam.net" << std::endl;
|
||||
ofs << "HellLiebenswerterElefant@muellemail.com" << std::endl;
|
||||
ofs << "BildlichImponierenderEsel@muellemail.com" << std::endl;
|
||||
ofs << "ErstaunlichSprachloserPapagei@ultra.fyi" << std::endl;
|
||||
ofs << "BerauschendLebendigerDelfin@ultra.fyi" << std::endl;
|
||||
ofs << "GravierendIntensiverHase@oida.icu" << std::endl;
|
||||
ofs << "BerauschendUnglaublicherGorilla@oida.icu" << std::endl;
|
||||
ofs << "GenuesslichPraechtigerDachs@spam.care" << std::endl;
|
||||
|
||||
if( pageInUse.url == "serienstream.sx" || pageInUse.url == "s.to" ) {
|
||||
ofs << "EntzueckendPackenderSkorpion@oida.icu" << std::endl;
|
||||
ofs << "HumorvollWundervollerDelfin@spam.care/HumorvollWundervollerDelfin@spam.care" << std::endl;
|
||||
ofs << "ExzellentPackenderHirsch@muell.icu/ExzellentPackenderHirsch@muell.icu" << std::endl;
|
||||
ofs << "GrandiosLeuchtenderPanda@papierkorb.me" << std::endl;
|
||||
ofs << "AttraktivPositiverSteinbock@magspam.net" << std::endl;
|
||||
ofs << "FreundlichKostbarerSteinbock@spam.care" << std::endl;
|
||||
ofs << "FabelhaftSelbstsichererUhu@spam.care" << std::endl;
|
||||
ofs << "HumorvollSinnlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "AnspruchsvollTraumhafterPavian@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendRiskanterLuchs@magspam.net" << std::endl;
|
||||
ofs << "BeruehmtMystischerPanda@ultra.fyi" << std::endl;
|
||||
ofs << "CharmantRasanterLoewe@existiert.net" << std::endl;
|
||||
ofs << "BedeutendLuesternerAal@existiert.net" << std::endl;
|
||||
ofs << "ElegantSelbstsichererAdler@ultra.fyi" << std::endl;
|
||||
ofs << "FaszinierendKoeniglicherBaer@spam.care" << std::endl;
|
||||
ofs << "CharmantKostbarerLoewe@magspam.net" << std::endl;
|
||||
ofs << "BedeutendPrallerSkorpion@muellemail.com" << std::endl;
|
||||
ofs << "FreundlichPerfekterRochen@muellmail.com" << std::endl;
|
||||
ofs << "AusgelassenKostbarerBasilisk@magspam.net" << std::endl;
|
||||
ofs << "FabelhaftLebhafterSchakal@ultra.fyi" << std::endl;
|
||||
ofs << "ExzellentSchoenerSteinbock@existiert.net" << std::endl;
|
||||
ofs << "ErhellendLustvollerAdler@muell.icu" << std::endl;
|
||||
ofs << "ExzellentIdealerSchakal@muell.icu" << std::endl;
|
||||
ofs << "BrillantVitalerSalamander@spam.care" << std::endl;
|
||||
ofs << "BezauberndRiesigerSchakal@oida.icu" << std::endl;
|
||||
ofs << "DynamischWarmerBaer@magspam.net" << std::endl;
|
||||
ofs << "EmotionalLeidenschaftlicherBaer@oida.icu" << std::endl;
|
||||
ofs << "BewundernswertWarmerSchwan@oida.icu" << std::endl;
|
||||
ofs << "HuebschUnfassbarerAal@papierkorb.me" << std::endl;
|
||||
ofs << "FroehlichWundervollerBiber@muellmail.com" << std::endl;
|
||||
ofs << "BefreiendWilderDelfin@spam.care" << std::endl;
|
||||
ofs << "FreundlichStilvollerTiger@oida.icu" << std::endl;
|
||||
ofs << "EchtKoeniglicherStorch@existiert.net" << std::endl;
|
||||
ofs << "BefluegeltPrallerSchwan@spam.care" << std::endl;
|
||||
ofs << "ErhellendSeltenerSeeloewe@ultra.fyi" << std::endl;
|
||||
ofs << "FreundlichZuverlaessigerSchwan@spam.care" << std::endl;
|
||||
ofs << "HervorragendWundervollerReiher@oida.icu" << std::endl;
|
||||
ofs << "AnspruchsvollStilvollerUhu@magspam.net" << std::endl;
|
||||
ofs << "AnmutigTraumhafterHai@muellemail.com" << std::endl;
|
||||
ofs << "AtemberaubendIdealerTapir@ultra.fyi" << std::endl;
|
||||
ofs << "GeheimLeuchtenderLuchs@muellemail.com" << std::endl;
|
||||
ofs << "DuftendKlarerTapir@muellmail.com" << std::endl;
|
||||
ofs << "GeheimUnwiderstehlicherRabe@muell.icu" << std::endl;
|
||||
ofs << "ExtravagantSpektakulaererAdler@spam.care" << std::endl;
|
||||
ofs << "BildlichWarmerLoewe@oida.icu" << std::endl;
|
||||
ofs << "AktivKlarerHai@spam.care" << std::endl;
|
||||
ofs << "AktivKostbarerElch@oida.icu" << std::endl;
|
||||
ofs << "Strust1991@jourrapide.com" << std::endl;
|
||||
ofs << "Natchoughe1928@dayrep.com" << std::endl;
|
||||
ofs << "zweirot@einrot.com" << std::endl;
|
||||
ofs << "AktivMagischerFrosch@existiert.net" << std::endl;
|
||||
ofs << "ErhellendPerfekterDachs@existiert.net" << std::endl;
|
||||
ofs << "ojfvwj.fgf@existiert.net" << std::endl;
|
||||
ofs << "lusiouae@wegwerfemail.de" << std::endl;
|
||||
ofs << "fraiwrou@wegwerfemail.de" << std::endl;
|
||||
ofs << "driotean@wegwerfemail.de" << std::endl;
|
||||
ofs << "tiaprour@wegwerfemail.de" << std::endl;
|
||||
ofs << "FeurigWarmerPapagei@existiert.net" << std::endl;
|
||||
ofs << "FrischStilvollerPavian@magspam.net" << std::endl;
|
||||
ofs << "FeurigZaghafterLoewe@muellmail.com" << std::endl;
|
||||
ofs << "GigantischKoeniglicherSchwan@magspam.net" << std::endl;
|
||||
ofs << "FreizuegigPersoenlicherLemming@spam.care" << std::endl;
|
||||
ofs << "BelebtIntelligenterHusky@papierkorb.me" << std::endl;
|
||||
ofs << "FreundlichMaximalerSpecht@muellmail.com" << std::endl;
|
||||
ofs << "FreundlichStarkerHirsch@ultra.fyi" << std::endl;
|
||||
ofs << "ErstklassigRasanterElch@oida.icu" << std::endl;
|
||||
ofs << "FreundlichStarkerPavian@ultra.fyi" << std::endl;
|
||||
ofs << "EinfuehlsamRiskanterPapagei@oida.icu" << std::endl;
|
||||
ofs << "FantastischPositiverHirsch@existiert.net" << std::endl;
|
||||
ofs << "GeborgenIndividuellerOtter@muell.icu" << std::endl;
|
||||
ofs << "HervorragendSensibelerWal@oida.icu" << std::endl;
|
||||
ofs << "HerrlichIndividuellerPelikan@spam.care" << std::endl;
|
||||
ofs << "HerrlichLeuchtenderTapir@muellmail.com" << std::endl;
|
||||
ofs << "ErstaunlichIntensiverEsel@magspam.net" << std::endl;
|
||||
ofs << "ExtravagantPraechtigerWal@muellemail.com" << std::endl;
|
||||
ofs << "GravierendWundervollerFalke@spam.care" << std::endl;
|
||||
ofs << "EntzueckendLebhafterFlamingo@magspam.net" << std::endl;
|
||||
ofs << "GeheimSprachloserStorch@existiert.net" << std::endl;
|
||||
ofs << "GravierendVitalerOtter@spam.care" << std::endl;
|
||||
ofs << "GrenzenlosInteressanterElch@oida.icu" << std::endl;
|
||||
ofs << "HellPackenderGoldfisch@muellemail.com" << std::endl;
|
||||
ofs << "AbenteuerlichSelbstloserFalke@muell.icu" << std::endl;
|
||||
ofs << "EmotionalZaghafterPapagei@magspam.net" << std::endl;
|
||||
ofs << "HellLiebenswerterElefant@muellemail.com" << std::endl;
|
||||
ofs << "BildlichImponierenderEsel@muellemail.com" << std::endl;
|
||||
ofs << "ErstaunlichSprachloserPapagei@ultra.fyi" << std::endl;
|
||||
ofs << "BerauschendLebendigerDelfin@ultra.fyi" << std::endl;
|
||||
ofs << "GravierendIntensiverHase@oida.icu" << std::endl;
|
||||
ofs << "BerauschendUnglaublicherGorilla@oida.icu" << std::endl;
|
||||
ofs << "GenuesslichPraechtigerDachs@spam.care" << std::endl;
|
||||
|
||||
} else if( pageInUse.url == "anicloud.io" ) {
|
||||
ofs << "C322334ark1954@teleworm.us/C322334ark1954@teleworm.us" << std::endl;
|
||||
ofs << "wemixex225@iconmle.com/wemixex225@iconmle.com" << std::endl;
|
||||
ofs << "Thw86757utary@teleworm.us" << std::endl;
|
||||
ofs << "thw811ssssutary@teleworm.us" << std::endl;
|
||||
ofs << "Leonardoutary@teleworm.us" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
ofs << "" << std::endl;
|
||||
|
||||
} else {
|
||||
std::cout << " => WARNUNG: Keine standart Accounts für die Url '" << pageInUse.url << "' vorhanden." <<std::endl;
|
||||
}
|
||||
|
||||
ofs.close();
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,6 +5,12 @@
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
|
||||
#include "parameterManager.h"
|
||||
|
||||
|
||||
|
||||
struct Account {
|
||||
std::string Email,
|
||||
Password;
|
||||
@ -14,13 +20,14 @@ struct Account {
|
||||
class AccountManager
|
||||
{
|
||||
public:
|
||||
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile);
|
||||
AccountManager(std::string pathToFile, std::string pathToAccountNumberFile, PAGE page);
|
||||
Account getNextAccount();
|
||||
size_t getLastAccountNumber();
|
||||
|
||||
private:
|
||||
std::vector<Account> accounts;
|
||||
std::string pathToAccountNumberFile;
|
||||
PAGE pageInUse;
|
||||
int setLastAccountNumber(size_t number);
|
||||
int writeDefault(std::string path);
|
||||
|
||||
|
@ -64,8 +64,8 @@ void PageManager::get_terminal_size(int& width) {
|
||||
#if defined(_WIN32)
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
if( GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi) == 0 ) {
|
||||
if ( debugMode )
|
||||
std::cout << " => WARNING: GetConsoleScreenBufferInfo failed => Use 9999 as max Msg-Length" << std::endl;
|
||||
//if ( debugMode )
|
||||
//std::cout << " => WARNING: GetConsoleScreenBufferInfo failed => Use 9999 as max Msg-Length" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -300,13 +300,13 @@ checkNameRply PageManager::checkName(std::vector<PAGE> pages, std::string Name)
|
||||
//für jede Seite
|
||||
for ( const auto &p : pages ) {
|
||||
|
||||
std::string html = getServerRequest("https://" + p.url +"/serie/stream/" + name).html;
|
||||
std::string html = getServerRequest("https://" + p.url + p.UrlDir + name).html;
|
||||
if(html.find("Die gewünschte Serie wurde nicht gefunden oder ist im Moment deaktiviert.") != std::string::npos) {
|
||||
continue;
|
||||
|
||||
} else if (html.find("404 - Seite nicht gefunden") != std::string::npos) {
|
||||
std::cout << "\33[2K\r => Ungültiger Name: '" << Name << "'" << std::endl;
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NEEDHELP);
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NOTHING_FOUND);
|
||||
|
||||
} else if (html == "-1" || html == "") {
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::FAILED);
|
||||
@ -325,10 +325,10 @@ checkNameRply PageManager::checkName(std::vector<PAGE> pages, std::string Name)
|
||||
return checkNameRply(name, Page, checkNameRply::SUCCESS);;
|
||||
} else if ( count > 1) {
|
||||
std::cout << "\33[2K\r => Die Serie existiert auf mehreren Seiten " << pagesonExist << ": '" << name << "'" << std::endl;
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NEEDHELP);;
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NOTHING_FOUND);; //MULTIPLE OPTIONS FOUND!!!!
|
||||
} else {
|
||||
std::cout << "\33[2K\r => Die gewünschte Serie wurde nicht gefunden oder ist im Moment deaktiviert: '" << Name << "'" << std::endl;
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NEEDHELP);;
|
||||
return checkNameRply("", PAGE("", ""), checkNameRply::NOTHING_FOUND);;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,15 @@
|
||||
#ifndef MANAGEPAGE_H
|
||||
#define MANAGEPAGE_H
|
||||
|
||||
|
||||
#include "accountManager.h"
|
||||
#include "curl/curl.h"
|
||||
#include "parameterManager.h" // for isNumber
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <sstream>
|
||||
#include <unistd.h> // sleep
|
||||
#include <algorithm>
|
||||
@ -22,7 +27,7 @@ struct Reply {
|
||||
struct checkNameRply {
|
||||
std::string name;
|
||||
PAGE pageInUse;
|
||||
enum STATUS { SUCCESS, FAILED, NEEDHELP } status;
|
||||
enum STATUS { SUCCESS, FAILED, NOTHING_FOUND, MULTIPLE_OPTIONS_FOUND } status;
|
||||
|
||||
checkNameRply(const std::string &name, const PAGE &p, const checkNameRply::STATUS &s )
|
||||
: name(name), pageInUse(p), status(s) {}
|
||||
|
@ -1007,6 +1007,7 @@ void unterOption_clean(Settings * settings, int argc, char **argv)
|
||||
return;
|
||||
}
|
||||
|
||||
//Um altes zeug zu löschen
|
||||
unsigned count = 0;
|
||||
if(fileExists(settings->cookieFilePath)) {
|
||||
if(remove(settings->cookieFilePath.c_str()) != 0) {
|
||||
@ -1024,6 +1025,27 @@ void unterOption_clean(Settings * settings, int argc, char **argv)
|
||||
++count;
|
||||
}
|
||||
}
|
||||
//UM sachen nach multipage update zu löschen
|
||||
for ( const auto &p : settings->pages ) {
|
||||
if(fileExists(settings->cookieFilePath + "_" + p.name_id)) {
|
||||
if(remove((settings->cookieFilePath + "_" + p.name_id).c_str()) != 0) {
|
||||
perror(( " => Error: Das löschen von " + settings->cookieFilePath + "_" + p.name_id + " ist fehlgeschlagen: ").c_str());
|
||||
return;
|
||||
} else
|
||||
++count;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < UINT_MAX && fileExists(settings->cookieFilePath + "_" + p.name_id + std::to_string(i)); ++i) {
|
||||
if(remove( (settings->cookieFilePath + "_" + p.name_id + std::to_string(i)).c_str() ) != 0) {
|
||||
perror((" => Error: Das löschen von " + settings->cookieFilePath + "_" + p.name_id + std::to_string(i) + " ist fehlgeschlagen: ").c_str());
|
||||
return;
|
||||
} else {
|
||||
++count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(count == 0)
|
||||
std::cout << " => Nichts zu tun: Keine Cookies vorhanden." << std::endl;
|
||||
|
@ -7,6 +7,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#include <iostream>
|
||||
#include <getopt.h>
|
||||
#include <string.h> // strlen
|
||||
@ -19,11 +20,9 @@
|
||||
#include <unistd.h> // readlink()
|
||||
#include <dirent.h>
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include "logger.h"
|
||||
|
||||
#define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files="
|
||||
#define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files="
|
||||
@ -56,12 +55,6 @@ struct PAGE {
|
||||
url;
|
||||
std::string urlAlphabetSerienList,
|
||||
UrlDir;
|
||||
|
||||
|
||||
std::string accountFileName = "",
|
||||
accountNumberFileName= "",
|
||||
cookieFileName = "",
|
||||
serienListName = "";
|
||||
};
|
||||
|
||||
struct Settings {
|
||||
@ -115,6 +108,10 @@ struct Settings {
|
||||
#endif
|
||||
|
||||
std::vector<PAGE> pages;
|
||||
enum MULTIPAGEFOUND_HANDLE { STOP, USE_PAGE_PRIORITY_HIGHEST, MANUEL_HANDLE } mpfH = MANUEL_HANDLE;
|
||||
std::string pagePriority;
|
||||
|
||||
|
||||
std::string name,
|
||||
accountFilePath = "",
|
||||
accountNumberPath= "",
|
||||
@ -131,7 +128,7 @@ struct Settings {
|
||||
languages = "GerDub,GerSub,Eng,",
|
||||
genaueHoster = "",
|
||||
version = VERSION,
|
||||
defaultFileVersion="1.8",
|
||||
defaultFileVersion="2.0",
|
||||
default_checkPath = "",
|
||||
default_Searchmuster = "S%Staffel%E%Folge%";
|
||||
|
||||
|
@ -311,8 +311,6 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
||||
}
|
||||
|
||||
}
|
||||
std::cout << "NAME: " << finds << std::endl;
|
||||
|
||||
|
||||
//suche Seite aus sucheregbnis in settings...
|
||||
bool found = false;
|
||||
@ -338,7 +336,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana
|
||||
auto ret = pageManager.checkName( pages /*settings->pages dann glaub ich immer fehler, wenn serie auf 2 seiten excistiert*/, finds);
|
||||
if(ret.status == ret.FAILED)
|
||||
return 23;
|
||||
else if( ret.status == ret.NEEDHELP ) {
|
||||
else if( ret.status == ret.NOTHING_FOUND ) {
|
||||
std::cout << " => Error: Konnte die von der Suche vorgeschlagene Serie nicht finden." << std::endl;
|
||||
if(settings->debugMode)
|
||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": Extracted Name from searchModus is invalid." << std::endl;
|
||||
@ -394,7 +392,6 @@ int ProgramManager::checkLastUpdate(Settings *settings, ssize_t *days = nullptr)
|
||||
|
||||
int ProgramManager::defaultModus(Settings *settings)
|
||||
{
|
||||
AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath);
|
||||
|
||||
//Wenn kein Name mit -n Angegeben wurde:
|
||||
if(settings->name == "") {
|
||||
@ -447,7 +444,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
||||
|
||||
if(retVal.status == retVal.FAILED)
|
||||
return 67;
|
||||
else if(retVal.status == retVal.NEEDHELP) {
|
||||
else if(retVal.status == retVal.NOTHING_FOUND) {
|
||||
//Wenn nicht, dann fühe noch eine Suche nach ähnlichen durch && Wenn nur 1ne dacnn frag ob es diese ist.
|
||||
int res = 0;
|
||||
if( ( res = sucheNach_1_Serien(settings, pageManager, retVal) ) != 0) {
|
||||
@ -455,10 +452,28 @@ int ProgramManager::defaultModus(Settings *settings)
|
||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien failed or found more options." << std::endl;
|
||||
return (res == -10101) ? 0 : 202;
|
||||
}
|
||||
} else if (retVal.status == retVal.MULTIPLE_OPTIONS_FOUND) {
|
||||
switch (settings->mpfH) {
|
||||
case Settings::STOP:
|
||||
break;
|
||||
case Settings::MANUEL_HANDLE: {
|
||||
int res = 0;
|
||||
if( ( res = sucheNach_1_Serien(settings, pageManager, retVal) ) != 0) {
|
||||
if(settings->debugMode)
|
||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien failed or found more options." << std::endl;
|
||||
return (res == -10101) ? 0 : 202;
|
||||
}
|
||||
break;
|
||||
} case Settings::USE_PAGE_PRIORITY_HIGHEST:
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
std::string nameInUrl = retVal.name;
|
||||
PAGE page = retVal.pageInUse;
|
||||
|
||||
AccountManager accountManager(settings->accountFilePath + "_" + page.name_id, settings->accountNumberPath + "_" + page.name_id, page);
|
||||
pageManager.setCookieFilePath(settings->cookieFilePath + "_" + page.name_id);
|
||||
|
||||
|
||||
/* Wenn multihtreading seaktiviert ist, normal login sonst bereite threads vor
|
||||
@ -470,16 +485,16 @@ int ProgramManager::defaultModus(Settings *settings)
|
||||
|
||||
if(settings->maxThreads > 0) {
|
||||
for (unsigned i = 0; i < settings->maxThreads; ++i) {
|
||||
if(dirExists(settings->cookieFilePath + std::to_string( i ))) {
|
||||
if(dirExists(settings->cookieFilePath + "_" + page.name_id + std::to_string( i ))) {
|
||||
std::cout << " => Error: Kann Cokkie-File nicht erstellen: Es existiert bereits ein Ordner mit diesem Namen: \n '"
|
||||
<< settings->cookieFilePath + std::to_string( i ) << "'." << std::endl;
|
||||
<< settings->cookieFilePath + "_" + page.name_id + std::to_string( i ) << "'." << std::endl;
|
||||
return 174;
|
||||
}
|
||||
PageManager * pm = new PageManager(settings->proxy_ip + ":" + std::to_string(settings->proxy_port), settings->cookieFilePath + std::to_string( i ));
|
||||
PageManager * pm = new PageManager(settings->proxy_ip + ":" + std::to_string(settings->proxy_port), settings->cookieFilePath + "_" + page.name_id + std::to_string( i ));
|
||||
pm->setDebugMode(settings->debugMode);
|
||||
|
||||
//pm->setProxy(settings->proxy_ip, settings->proxy_port);
|
||||
//pm->setCookieFilePath(settings->cookieFilePath + std::to_string( i ));
|
||||
//pm->setCookieFile Path(settings->cookieFile Path + std::to_string( i ));
|
||||
|
||||
ThreadData * newThreadData = new ThreadData(i, 0, nameInUrl, -1, settings, &accountManager, pm, page);
|
||||
threadList.push_back(newThreadData);
|
||||
@ -669,7 +684,7 @@ int ProgramManager::defaultModus(Settings *settings)
|
||||
|
||||
int ProgramManager::directLinkModus(Settings *settings)
|
||||
{
|
||||
AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath);
|
||||
AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath, PAGE("", ""));
|
||||
|
||||
if(settings->name == "") {
|
||||
std::cout << " => Kein(e) Link(s) angegeben." << std::endl;
|
||||
@ -854,13 +869,13 @@ int ProgramManager::infoModus(Settings *settings)
|
||||
auto retV = pageManager.checkName(settings->pages, settings->name);
|
||||
if(retV.status == retV.FAILED)
|
||||
return 145;
|
||||
else if(retV.status == retV.NEEDHELP) {
|
||||
else if(retV.status == retV.NOTHING_FOUND) {
|
||||
//Wenn nicht, dann fühe noch eine Suche nach ähnlichen durch.
|
||||
int res = 0;
|
||||
if( ( res = sucheNach_1_Serien(settings, pageManager, retV) ) != 0) {
|
||||
if(settings->debugMode)
|
||||
std::cerr << ">>> Debug In " << __FUNCTION__ << ": sucheNach_1_Serien function failed." << std::endl;
|
||||
return (res = -10101) ? 0 : 28;
|
||||
return (res == -10101) ? 0 : 28;
|
||||
}
|
||||
}
|
||||
std::string nameInUrl = retV.name;
|
||||
|
@ -1,6 +1,7 @@
|
||||
#ifndef MANAGEPROGRAM_H
|
||||
#define MANAGEPROGRAM_H
|
||||
|
||||
|
||||
#include "pageManager.h"
|
||||
#include "parameterManager.h"
|
||||
#include "accountManager.h"
|
||||
|
Loading…
Reference in New Issue
Block a user