forked from markus/S_New4
chjeckt ... default
This commit is contained in:
parent
24254f93d3
commit
4cbac6cbca
@ -44,16 +44,25 @@ int ProgramManager::defaultModus(Settings *settings)
|
||||
std::cout << " > Use Path for Name: " << settings->default_checkDirPath << " -> " << settings->name << std::endl;
|
||||
}
|
||||
} if(settings->name == "") {
|
||||
std::cout << " => Error: Kein Name angegeben: Missing Parameter -n [Name]." << std::endl;
|
||||
std::cout << " => Error: Kein Name angegeben." << std::endl;
|
||||
std::cout << "Aufruf: " << getProgramName(settings->argv0.c_str()) << " default [PARAMETER]" << std::endl;
|
||||
std::cout << "„" << getProgramName(settings->argv0.c_str()) << " default --help“ liefert weitere Informationen." << std::endl;
|
||||
return 27;
|
||||
}
|
||||
}
|
||||
|
||||
//Überprüfe ob ein Muster existiert:
|
||||
if(settings->default_Searchmuster == "") {
|
||||
std::cout << " => Error: [-m]: Kein Muster angegeben." << std::endl;
|
||||
return 31;
|
||||
}
|
||||
|
||||
//Liste alle Dateien in dem Ornder von -C auf und speichere diese
|
||||
std::string dirFiles;
|
||||
if(settings->default_checkDirPath != "")
|
||||
if(listDir(dirFiles, settings->default_checkDirPath, settings->default_maxDirs ) != 0)
|
||||
return 28;
|
||||
|
||||
//Entferne von der liste das \n am ende
|
||||
if(dirFiles.length() > 0)
|
||||
dirFiles.pop_back();
|
||||
@ -218,7 +227,7 @@ int ProgramManager::searchModus(Settings *settings)
|
||||
|
||||
//Ausgabe
|
||||
if(finds == "") {
|
||||
std::cout << " => Für '" << settings->name << "' wurde nichts gefunden." << std::endl;
|
||||
std::cout << " => Für '" << settings->name << "' wurde(n) keine Serie(n) gefunden." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
std::stringstream strstream(finds);
|
||||
@ -357,7 +366,8 @@ int ProgramManager::convertLink(std::string redirectLink, AccountManager * accou
|
||||
else {
|
||||
std::cout << " => " << orange << "Keinen PASSENDEN Hoster für die Folge " << folgenID << " gefunden." << "\033[0m" << std::endl
|
||||
<< "Alle Links:" << std::endl
|
||||
<< allLinks << std::endl;
|
||||
<< pageManager.replace( pageManager.replace( pageManager.replace( allLinks, "data-lang-key=\"1\"", "language=\"GerDub\"" ),
|
||||
"data-lang-key=\"2\"", "language=\"Eng\"" ), "data-lang-key=\"3\"", "language=\"GerSub\"") << std::endl;
|
||||
if(pageManager.writeToFile(settings->outputFilePath, std::string("Keinen PASSENDEN Hoster für die Folge ") + folgenID + std::string(" gefunden.")) != 0)
|
||||
return 138;
|
||||
}
|
||||
@ -378,14 +388,14 @@ int ProgramManager::convertLink(std::string redirectLink, AccountManager * accou
|
||||
} else {
|
||||
std::cout << " => " << folgenID << ( (folgenID == "") ? "" : ": " ) << green << newUrl << "\033[0m" << std::endl;
|
||||
if(settings->outputFilePath != "")
|
||||
if(pageManager.writeToFile(settings->outputFilePath,folgenID + newUrl) != 0)
|
||||
if(pageManager.writeToFile(settings->outputFilePath,folgenID + ( (folgenID == "") ? "" : ": " ) + newUrl) != 0)
|
||||
return 108;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
std::cout << " => " << folgenID << ( (folgenID == "") ? "" : ": " ) << red << "https://s.to" << redirectLink << "\033[0m" << std::endl;
|
||||
if(settings->outputFilePath != "")
|
||||
if(pageManager.writeToFile(settings->outputFilePath, folgenID + redirectLink) != 0)
|
||||
if(pageManager.writeToFile(settings->outputFilePath, folgenID + ( (folgenID == "") ? "" : ": " ) + redirectLink) != 0)
|
||||
return 114;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user