v5.3.1: add %URLANME% to -check-file

This commit is contained in:
Your Name 2022-04-17 22:26:07 +02:00
parent e5c5ae8d42
commit 44950eefc9
5 changed files with 25 additions and 22 deletions

View File

@ -312,7 +312,7 @@ Reply PageManager::getUrlAfterRedirect( std::string p,std::string Url, std::stri
return getServerRequest(p , Url, true, "", false, true, cookieFilePath); 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) { if(pages.size() < 1) {
std::cout << " => Error Keine Internet Seiten vorhanden." << std::endl; 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 ) { if( count == 1 ) {
for( auto &path : outPutFilePaths) for( auto &path : outPutFilePaths)
path = replace(path, "%URLNAME%", name); 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);; return checkNameRply(name, Page, checkNameRply::SUCCESS);;
} else if ( count > 1) { } else if ( count > 1) {

View File

@ -58,7 +58,7 @@ public:


int login(PAGE page, Account account, std::string cookieFilePath); int login(PAGE page, Account account, std::string cookieFilePath);
Reply getUrlAfterRedirect(std::string p, std::string Url, 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 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 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); std::string getLinkAfterHosterBasedOperation(std::string url);

View File

@ -1871,7 +1871,7 @@ int setUpInternetPages(Settings &settings, std::string optarg)
} }
if( !found ) { if( !found ) {
std::cout << " => Error: Unbekannte Internetseiten: " << value << " - Bitte überprüfen sie ihr Default File oder ggf. Parameter -i" << std::endl; 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) { if(settings.pagesInUse.size() < 1) {

View File

@ -27,7 +27,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 "5.3.0" #define VERSION "5.3.1"
#define DEFAULT_FILE_VERSION "2.3" #define DEFAULT_FILE_VERSION "2.3"


//default, anime, normal, //default, anime, normal,

View File

@ -362,7 +362,7 @@ int ProgramManager::sucheNach_1_Serien(Settings *settings, PageManager &pageMana


auto ret = pageManager.checkName( pages /*settings->pages dann glaub auto ret = pageManager.checkName( pages /*settings->pages dann glaub
ich immer fehler, wenn serie auf 2 seiten excistiert*/, 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) if(ret.status == ret.FAILED || ret.status == ret.MULTIPLE_OPTIONS)
return 23; return 23;
else if( ret.status == ret.NOTHING_FOUND ) { 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???) //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) if(retVal.status == retVal.FAILED)
return 67; return 67;
@ -593,6 +580,21 @@ int ProgramManager::defaultModus(Settings *settings)
PAGE page = retVal.pageInUse; PAGE page = retVal.pageInUse;
AccountManager accountManager(settings->accountFilePath, settings->accountNumberPath, page, settings->pagesALL); 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 /* Wenn multihtreading seaktiviert ist, normal login sonst bereite threads vor
if(settings->maxThreads == 0) { if(settings->maxThreads == 0) {
// melde bei seriens tream.sx an und speicher cookies. // 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 //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) if(retV.status == retV.FAILED)
return 145; return 145;
else if(retV.status == retV.NOTHING_FOUND || retV.status == retV.MULTIPLE_OPTIONS ) { 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; std::string nameInUrl = retV.name;
PAGE page = retV.pageInUse; PAGE page = retV.pageInUse;


std::cout << "Serie: " + settings->name + " (" + nameInUrl + ")" << std::endl; // std::cout << "Serie: " + settings->name + " (" + nameInUrl + ")" << std::endl;


//write Name to file //write Name to file
if(pageManager.writeToFile(settings->outputFilePaths, "\n\nSerie: " + settings->name + " (" + nameInUrl + ")") != 0) if(pageManager.writeToFile(settings->outputFilePaths, "\n\nSerie: " + settings->name + " (" + nameInUrl + ")") != 0)