This commit is contained in:
Your Name 2021-04-28 08:27:55 +02:00
commit faf52da7e0
7 changed files with 72 additions and 23 deletions

2
.gitignore vendored
View File

@ -74,7 +74,7 @@ Thumbs.db
#Own adds: #Own adds:
g++/ g++/
build* build*

src/lib/


Makefile Makefile
S_New4 S_New4

View File

@ -1,10 +1,22 @@
QT -= gui QT -= gui






#INCLUDEPATH += -L$${_PRO_FILE_PWD_}\openssl-android-arm64-v8a\include

LIBS += -L$${_PRO_FILE_PWD_}\lib -lssl
LIBS += -L$${_PRO_FILE_PWD_}\lib -lcrypto
LIBS += -L$${_PRO_FILE_PWD_}\lib -lcurl



#Linux: #Linux:
unix: LIBS += -lcurl #unix: LIBS += -lcurl


#Windows #Windows
win32: LIBS += -L$${_PRO_FILE_PWD_}\curl -lcurl #win32: LIBS += -L$${_PRO_FILE_PWD_}\curl -lcurl




CONFIG += c++14 console CONFIG += c++14 console

View File

@ -89,7 +89,7 @@ Reply PageManager::getServerRequest(std::string Url, bool useCookies, std::strin


int width; int width;
get_terminal_size(width); get_terminal_size(width);
if(width <= 0) if(width < 1)
width = 999999; width = 999999;


//info ausgabe //info ausgabe
@ -314,7 +314,7 @@ checkNameRply PageManager::checkName(std::vector<PAGE> pages, std::string Name,
continue; continue;


} else if (html.find("404 - Seite nicht gefunden") != std::string::npos) { } else if (html.find("404 - Seite nicht gefunden") != std::string::npos) {
std::cout << "\33[2K\r => Ungültiger Name: '" << Name << "'" << std::endl; std::cout << "\33[2K\r" <<" => Ungültiger Name: '" << Name << "'" << std::endl;
return checkNameRply("", PAGE(), checkNameRply::NOTHING_FOUND); return checkNameRply("", PAGE(), checkNameRply::NOTHING_FOUND);


} else if (html == "-1" || html == "") { } else if (html == "-1" || html == "") {

View File

@ -3,7 +3,10 @@




#include "accountManager.h" #include "accountManager.h"
#include "curl/curl.h" //#include "curl/curl.h"

#include "lib/curl.h"

#include "parameterManager.h" // for isNumber #include "parameterManager.h" // for isNumber


#ifdef _WIN32 #ifdef _WIN32

View File

@ -202,7 +202,7 @@ int loadDefaulOptions(Settings &settings)
ofs << "# -> Standart Wert für Parameter: -f, --use-first:" << std::endl; ofs << "# -> Standart Wert für Parameter: -f, --use-first:" << std::endl;
ofs << "# -> Benutze sofort die erste Seite, wenn die Serie dort existiert." << std::endl; ofs << "# -> Benutze sofort die erste Seite, wenn die Serie dort existiert." << std::endl;
ofs << "# Wenn deaktiviert, manuelle auswahl der Seiten nötig!" << std::endl; ofs << "# Wenn deaktiviert, manuelle auswahl der Seiten nötig!" << std::endl;
ofs << "#UseFirstPage=false" << std::endl << std::endl; ofs << "#UseFirstPage=true" << std::endl << std::endl;


ofs << "#" << std::endl << "# -> Einstellungen für default Modus:" << std::endl << "#" << std::endl << std::endl; ofs << "#" << std::endl << "# -> Einstellungen für default Modus:" << std::endl << "#" << std::endl << std::endl;



View File

@ -3,7 +3,7 @@


#ifndef __linux__ #ifndef __linux__
#ifndef _WIN32 #ifndef _WIN32
#error "Error Invalid System: Only for Linux and Windows systems!" //#error "Error Invalid System: Only for Linux and Windows systems!"
#endif #endif
#endif #endif


@ -26,7 +26,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.0.1" #define VERSION "5.0.3"
#define DEFAULT_FILE_VERSION "2.1" #define DEFAULT_FILE_VERSION "2.1"


//default, anime, normal, //default, anime, normal,
@ -57,6 +57,8 @@ struct PAGE {
std::string name_id, url, urlAlphabetSerienList, UrlDir; std::string name_id, url, urlAlphabetSerienList, UrlDir;
}; };




struct Settings { struct Settings {


const std::string programName = "S_New4"; const std::string programName = "S_New4";
@ -102,7 +104,7 @@ struct Settings {
const std::string VersionFileName = std::string("Version-LIN-ARMv6.txt"); const std::string VersionFileName = std::string("Version-LIN-ARMv6.txt");
const std::string ProgrammFileName = std::string("S_New4-LIN-ARMv6"); const std::string ProgrammFileName = std::string("S_New4-LIN-ARMv6");
#else #else
#error Falsche Architektur: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux ) //#error Falsche Architektur: Der Updater Fuktion wird nicht Funktionieren! Remove this Line in the Code to use S_New4 without the Updater. ( But your System must be Windows or Linux )
const std::string VersionFileName = ""; const std::string VersionFileName = "";
const std::string ProgrammFileName = ""; const std::string ProgrammFileName = "";
#endif #endif
@ -110,6 +112,7 @@ struct Settings {







std::string name, std::string name,
accountFilePath = "", accountFilePath = "",
accountNumberPath= "", accountNumberPath= "",
@ -151,10 +154,40 @@ struct Settings {
updateWarningDays = 10; updateWarningDays = 10;
char pathSymbol = '/'; char pathSymbol = '/';
char wrongPathSymbol = '\\'; char wrongPathSymbol = '\\';

unsigned maxThreads = 0; unsigned maxThreads = 0;


enum COLOR {
NO_COLOR = 0,
Black = 30,
Dark_Gray = 90,
Red = 31,
Light_Red = 91,
Green = 32,
Light_Green = 92,
Brown_Orange = 33,
Yellow = 93,
Blue = 34,
Light_Blue = 94,
Purple = 35,
Light_Purple = 95,
Cyan = 36,
Light_Cyan = 96,
Light_Gray = 37,
White = 97

}; };
std::string setPColor(const COLOR &color) {
return ( (colorless) ? "" : "\033[" + std::to_string(color) +"m" );
}
std::string resetPColor() {
return ( (colorless) ? "" : "\033[0m" );
}


};



std::string replace(std::string str, std::string substr1, std::string substr2); std::string replace(std::string str, std::string substr1, std::string substr2);


int manageParameter(Settings &settings, int argc, char ** argv); int manageParameter(Settings &settings, int argc, char ** argv);

View File

@ -846,15 +846,22 @@ int ProgramManager::searchModus(Settings *settings, std::string *saveTo, bool no


//------------------------------------------------> Extrahiere alle Zeilen raus, die aus den Aktivierten Seiten sind //------------------------------------------------> Extrahiere alle Zeilen raus, die aus den Aktivierten Seiten sind
std::istringstream ifS(fullList + "\n"); std::istringstream ifS(fullList + "\n");
std::string l, allUrls; std::string l, allUrlsInUSe, allPages;
for( const auto &p : settings->pages ) for( const auto &p : settings->pages )
allUrls += ((allUrls == "") ? "" : ",") + p.url; allUrlsInUSe += ((allUrlsInUSe == "") ? "" : ",") + p.url;
for( const auto &p : settings->pagesALL )
allPages += ((allPages == "") ? "" : ",") + p.url;


while (std::getline(ifS, l)) { while (std::getline(ifS, l)) {
if( l.find_last_of('|') == std::string::npos ) { if( l.find_last_of('|') == std::string::npos ) {
continue; continue;
} else if( allUrls.find( l.substr(l.find_last_of('|') + 1) ) != std::string::npos ) } else if( allUrlsInUSe.find( l.substr(l.find_last_of('|') + 1) ) != std::string::npos ) {
finds += l + "\n"; finds += l + "\n";
} else if ( allPages.find( l.substr(l.find_last_of('|') + 1) ) == std::string::npos ) {
std::cout << settings->setPColor(Settings::Brown_Orange) << " => WARNUNG: In der Serienliste befindet sich ein ungültiger Eintrag: Unbekannte Seite: " << l.substr(l.find_last_of('|') + 1) <<
"\n Verwenden sie '" << settings->programName << "' s -u, search --update um die Liste zu aktualisieren!" << settings->resetPColor() << std::endl;
continue;
}
} if(finds.size() >= 1) } if(finds.size() >= 1)
finds.pop_back(); finds.pop_back();
//------------------------------------------- //-------------------------------------------
@ -1634,8 +1641,7 @@ int ProgramManager::searchModus_update(Settings *settings)
//Vergeliche neue und alte list => entfernte Serien //Vergeliche neue und alte list => entfernte Serien
if(line != "" && list.find(line) == std::string::npos) { if(line != "" && list.find(line) == std::string::npos) {
std::string tmp = std::string(line).erase(line.find_last_of('|')); std::string tmp = std::string(line).erase(line.find_last_of('|'));
std::cout << ((settings->colorless) ? "" : "\033[91m") << "Entfernt: '" << tmp.substr(tmp.find_last_of("|") + 1) << "'" << ((settings->colorless) ? "" : "\033[0m") std::cout << settings->setPColor(settings->Red) << "Entfernt: '" << tmp.substr(tmp.find_last_of("|") + 1) << "'" << settings->resetPColor() << std::endl;
<< std::endl;
} }
} }
myFileBef.close(); myFileBef.close();
@ -1660,8 +1666,7 @@ int ProgramManager::searchModus_update(Settings *settings)
//Vergeliche neu mit Alt => gib neue Serien aus //Vergeliche neu mit Alt => gib neue Serien aus
if(line != "" && alteListe.find(line) == std::string::npos) { if(line != "" && alteListe.find(line) == std::string::npos) {
std::string tmp = std::string(line).erase(line.find_last_of('|')); std::string tmp = std::string(line).erase(line.find_last_of('|'));
std::cout << ((settings->colorless) ? "" : "\033[92m") << "Neu: '" << tmp.substr(tmp.find_last_of("|") + 1) << "'" << ((settings->colorless) ? "" : "\033[0m") std::cout << settings->setPColor(Settings::Green) << "Neu: '" << tmp.substr(tmp.find_last_of("|") + 1) << "'" << settings->resetPColor() << std::endl;
<< std::endl;
} }
} }
myFileAf.close(); myFileAf.close();
@ -1670,11 +1675,7 @@ int ProgramManager::searchModus_update(Settings *settings)
return 112; return 112;
} }


std::cout << ((settings->colorless) ? "" : "\033[93m") << "Serienunterschied: " << ( ((countAf - countBef) > 0) ? "+" : "") << countAf - countBef << " Serien." << "\033[0m" << std::endl; std::cout << settings->setPColor(Settings::Yellow) << "Serienunterschied: " << ( ((countAf - countBef) > 0) ? "+" : "") << countAf - countBef << " Serien." << settings->resetPColor() << std::endl;






//Speicher Datum des Updates... //Speicher Datum des Updates...
ofs.open(settings->lastUpdateDateFilePath, std::ios::trunc); ofs.open(settings->lastUpdateDateFilePath, std::ios::trunc);