forked from markus/S_New4
v5.3.1: add %URLANME% to -check-file
This commit is contained in:
parent
e5c5ae8d42
commit
44950eefc9
@ -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<PAGE> &pages, std::string Name, bool useFirstPage, std::vector<std::string> &outPutFilePaths)
|
||||
checkNameRply PageManager::checkName(std::vector<PAGE> &pages, std::string Name, bool useFirstPage, std::vector<std::string> &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<PAGE> &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) {
|
||||
|
@ -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<PAGE> &pages, std::string Name, bool useFirstPage, std::vector<std::string> &outPutFilePaths /*for replacement*/);
|
||||
checkNameRply checkName(std::vector<PAGE> &pages, std::string Name, bool useFirstPage, std::vector<std::string> &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);
|
||||
|
@ -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) {
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user