diff --git a/src/pageManager.cpp b/src/pageManager.cpp index 5b57bb5..5015ec0 100644 --- a/src/pageManager.cpp +++ b/src/pageManager.cpp @@ -312,7 +312,7 @@ Reply PageManager::getUrlAfterRedirect( std::string p,std::string Url, std::stri return getServerRequest(p , Url, true, "", false, true, cookieFilePath); } -checkNameRply PageManager::checkName(std::vector &pages, std::string Name, bool useFirstPage, std::vector &outPutFilePaths) +checkNameRply PageManager::checkName(std::vector &pages, std::string Name, bool useFirstPage, std::vector &outPutFilePaths, std::string &checkFilePath) { if(pages.size() < 1) { std::cout << " => Error Keine Internet Seiten vorhanden." << std::endl; @@ -367,7 +367,8 @@ checkNameRply PageManager::checkName(std::vector &pages, std::string Name, if( count == 1 ) { for( auto &path : outPutFilePaths) path = replace(path, "%URLNAME%", name); - std::cout << "\33[2K\r > Serie: " << Name << std::endl; + checkFilePath = replace(checkFilePath, "%URLNAME%", name); + std::cout << "\33[2K\r > Serie: " << Name << " (" << name << ")" << std::endl; return checkNameRply(name, Page, checkNameRply::SUCCESS);; } else if ( count > 1) { diff --git a/src/pageManager.h b/src/pageManager.h index 0b819ff..ba1eefa 100644 --- a/src/pageManager.h +++ b/src/pageManager.h @@ -58,7 +58,7 @@ public: int login(PAGE page, Account account, std::string cookieFilePath); Reply getUrlAfterRedirect(std::string p, std::string Url, std::string cookieFilePath); - checkNameRply checkName(std::vector &pages, std::string Name, bool useFirstPage, std::vector &outPutFilePaths /*for replacement*/); + checkNameRply checkName(std::vector &pages, std::string Name, bool useFirstPage, std::vector &outPutFilePaths /*for replacement*/, std::string &checkFilePath ); std::string getLinks(std::string HTML); std::string chooseHosterLink(std::string HosterList, std::string Hoster_with_Highst_Priority_at_First, std::string languages_with_highst_priority_at_first, bool withWarnMsg); std::string getLinkAfterHosterBasedOperation(std::string url); diff --git a/src/parameterManager.cpp b/src/parameterManager.cpp index f677fed..d7b2844 100644 --- a/src/parameterManager.cpp +++ b/src/parameterManager.cpp @@ -1871,7 +1871,7 @@ int setUpInternetPages(Settings &settings, std::string optarg) } if( !found ) { std::cout << " => Error: Unbekannte Internetseiten: " << value << " - Bitte überprüfen sie ihr Default File oder ggf. Parameter -i" << std::endl; - return 2154; + continue; } } if(settings.pagesInUse.size() < 1) { diff --git a/src/parameterManager.h b/src/parameterManager.h index 0ff8faf..5d94750 100644 --- a/src/parameterManager.h +++ b/src/parameterManager.h @@ -27,7 +27,7 @@ #define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files=" #define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files=" -#define VERSION "5.3.0" +#define VERSION "5.3.1" #define DEFAULT_FILE_VERSION "2.3" //default, anime, normal, diff --git a/src/programManager.cpp b/src/programManager.cpp index 1e7fe24..7ac8e87 100644 --- a/src/programManager.cpp +++ b/src/programManager.cpp @@ -362,7 +362,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, settings->useFirstPage, settings->outputFilePaths); + finds, settings->useFirstPage, settings->outputFilePaths, settings->default_checkPath ); if(ret.status == ret.FAILED || ret.status == ret.MULTIPLE_OPTIONS) return 23; else if( ret.status == ret.NOTHING_FOUND ) { @@ -556,21 +556,8 @@ int ProgramManager::defaultModus(Settings *settings) } - //Liste alle Dateien in dem Ornder von -C auf und speichere diese - std::string dirFiles; - if(settings->default_checkPath != "") - if(listDir(dirFiles, settings->default_checkPath, settings->default_maxDirs, settings->debugMode ) != 0) { - if(settings->debugMode) - std::cerr << ">>> Debug In " << __FUNCTION__ << ": listDir failed." << std::endl; - return 28; - } - if(dirFiles.length() > 0) //Entferne von der liste das \n am ende - dirFiles.pop_back(); - - - //Führe Function aus, die überprüft ob die serie existiert (einmal???) - auto retVal = pageManager.checkName(settings->pagesInUse, settings->name, settings->useFirstPage, settings->outputFilePaths); + auto retVal = pageManager.checkName(settings->pagesInUse, settings->name, settings->useFirstPage, settings->outputFilePaths, settings->default_checkPath); if(retVal.status == retVal.FAILED) return 67; @@ -593,6 +580,21 @@ int ProgramManager::defaultModus(Settings *settings) PAGE page = retVal.pageInUse; AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath, page, settings->pagesALL); + + + //Liste alle Dateien in dem Ornder von -C auf und speichere diese + std::string dirFiles; + if(settings->default_checkPath != "") + if(listDir(dirFiles, settings->default_checkPath, settings->default_maxDirs, settings->debugMode ) != 0) { + if(settings->debugMode) + std::cerr << ">>> Debug In " << __FUNCTION__ << ": listDir failed." << std::endl; + return 28; + } + if(dirFiles.length() > 0) //Entferne von der liste das \n am ende + dirFiles.pop_back(); + + + /* Wenn multihtreading seaktiviert ist, normal login sonst bereite threads vor if(settings->maxThreads == 0) { // melde bei seriens tream.sx an und speicher cookies. @@ -1047,7 +1049,7 @@ int ProgramManager::infoModus(Settings *settings) } //Führe Function aus, die überprüft ob die serie existiert - auto retV = pageManager.checkName(settings->pagesInUse, settings->name, settings->useFirstPage, settings->outputFilePaths); + auto retV = pageManager.checkName(settings->pagesInUse, settings->name, settings->useFirstPage, settings->outputFilePaths, settings->default_checkPath ); if(retV.status == retV.FAILED) return 145; else if(retV.status == retV.NOTHING_FOUND || retV.status == retV.MULTIPLE_OPTIONS ) { @@ -1067,7 +1069,7 @@ int ProgramManager::infoModus(Settings *settings) std::string nameInUrl = retV.name; PAGE page = retV.pageInUse; - std::cout << "Serie: " + settings->name + " (" + nameInUrl + ")" << std::endl; +// std::cout << "Serie: " + settings->name + " (" + nameInUrl + ")" << std::endl; //write Name to file if(pageManager.writeToFile(settings->outputFilePaths, "\n\nSerie: " + settings->name + " (" + nameInUrl + ")") != 0)