forked from markus/S_New4
small fixes
This commit is contained in:
parent
8872282941
commit
aafc2bae63
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,6 +1,8 @@
|
||||
# This file is used to ignore files which are generated
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
|
||||
src/.qtc_clangd/
|
||||
*~
|
||||
*.autosave
|
||||
|
||||
|
@ -1448,7 +1448,7 @@ int unterOption_news(Settings *settings, int argc, char **argv)
|
||||
int c = 0;
|
||||
const option long_opts[] = {
|
||||
{"socks5-proxy", required_argument, nullptr, 'p'},
|
||||
{"use-first-page", no_argument, nullptr, 'f'},
|
||||
// {"use-first-page", no_argument, nullptr, 'f'},
|
||||
|
||||
{"internet-pages", required_argument, nullptr, 'i'},
|
||||
{"help", no_argument, nullptr, 'h'},
|
||||
@ -1471,11 +1471,11 @@ int unterOption_news(Settings *settings, int argc, char **argv)
|
||||
if(setUpInternetPages(*settings, optarg) != 0)
|
||||
return 4356;
|
||||
break;
|
||||
case 'f':
|
||||
settings->useFirstPage = true;
|
||||
if(settings->debugMode)
|
||||
std::cout << "useFirstPage: " << settings->useFirstPage << std::endl;
|
||||
break;
|
||||
// case 'f':
|
||||
// settings->useFirstPage = true;
|
||||
// if(settings->debugMode)
|
||||
// std::cout << "useFirstPage: " << settings->useFirstPage << std::endl;
|
||||
// break;
|
||||
case 'h':
|
||||
unterOption_news_help(settings->programName);
|
||||
return -1;
|
||||
@ -1517,14 +1517,14 @@ void unterOption_news_help(std::string programName)
|
||||
<< " Die Seiten Kommagetrennt nach Priorität angeben. (Höchste am Anfang)" << std::endl
|
||||
<< " Gut Kombinierbar mit --use-first-page kombenierbar!" << std::endl
|
||||
<< " Standart: AniWorld.to,serienstream.to" << std::endl
|
||||
<< " -f, --use-first-page" << std::endl
|
||||
/* << " -f, --use-first-page" << std::endl
|
||||
<< " Mit dieser Option kann man festlegen, dass direkt die erste Seite," << std::endl
|
||||
<< " auf der die Serie vorhanden ist, verwendet wird. ( Reihenfolge der" << std::endl
|
||||
<< " Priorität nach; siehe -i, --internet-pages)" << std::endl
|
||||
<< " Ohne diesem Parameter ist eine manuelle auswahl nötig," << std::endl
|
||||
<< " wenn diese Serie auf mehreren Seiten existiert!" << std::endl
|
||||
<< " Parameter kann auch im Default File als standart festgelegt werden!" << std::endl
|
||||
<< " Standart: Überprüfe alle Seiten" << std::endl << std::endl;
|
||||
<< " Standart: Überprüfe alle Seiten" << std::endl*/ << std::endl;
|
||||
std::cout << "OPTIONEN:" << std::endl
|
||||
<< " -p [ip:port/ip/port], --socks5-proxy [ip:port/ip/port]" << std::endl
|
||||
<< " Mit dieser Option kann man den Socks5Proxy ändern." << std::endl
|
||||
|
@ -1304,44 +1304,45 @@ int ProgramManager::infoModus(Settings *settings)
|
||||
}
|
||||
|
||||
}
|
||||
std::string startStopDates[2] = {"-", "-"};
|
||||
size_t pos = 0, pos2 = 0;
|
||||
std::string fsk = "-";
|
||||
|
||||
//Datum & FSK
|
||||
std::string line = pageManager.grep(tmp_reply.html, "<small> (<span itemprop=\"startDate\"><a");
|
||||
if(line == "") {
|
||||
std::cout << " => Error: Konnte '<small> (<span itemprop=\"startDate\"><a' nicht finden." << std::endl;
|
||||
return 83;
|
||||
}
|
||||
} else {
|
||||
|
||||
std::string startStopDates[2];
|
||||
size_t pos = 0, pos2 = 0;
|
||||
//Date
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if( (pos = line.find("href=")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte 'href=' nicht finden." << std::endl;
|
||||
return 84;
|
||||
} else
|
||||
line.erase(0, pos + 5);
|
||||
|
||||
//Date
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
if( (pos = line.find("href=")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte 'href=' nicht finden." << std::endl;
|
||||
return 84;
|
||||
} else
|
||||
line.erase(0, pos + 5);
|
||||
if( (pos = line.find(">")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '>' nicht finden." << std::endl;
|
||||
return 85;
|
||||
} else if ((pos2 = line.find("</a>")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '</a>' nicht finden." << std::endl;
|
||||
return 86;
|
||||
}
|
||||
startStopDates[i] = line.substr(pos + 1, pos2 - pos -1);
|
||||
}
|
||||
|
||||
if( (pos = line.find(">")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '>' nicht finden." << std::endl;
|
||||
return 85;
|
||||
} else if ((pos2 = line.find("</a>")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '</a>' nicht finden." << std::endl;
|
||||
//FSK
|
||||
if( (pos = line.find("data-fsk=\"")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte 'data-fsk=\"' nicht finden." << std::endl;
|
||||
return 87;
|
||||
} else if ((pos2 = line.find("\" class=\"fsk")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '\" class=\"fsk' nicht finden." << std::endl;
|
||||
return 86;
|
||||
}
|
||||
startStopDates[i] = line.substr(pos + 1, pos2 - pos -1);
|
||||
fsk = line.substr(pos + 10, pos2 -pos - 10);
|
||||
}
|
||||
|
||||
//FSK
|
||||
if( (pos = line.find("data-fsk=\"")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte 'data-fsk=\"' nicht finden." << std::endl;
|
||||
return 87;
|
||||
} else if ((pos2 = line.find("\" class=\"fsk")) == std::string::npos ) {
|
||||
std::cout << " => Error: Konnte '\" class=\"fsk' nicht finden." << std::endl;
|
||||
return 86;
|
||||
}
|
||||
std::string fsk = line.substr(pos + 10, pos2 -pos - 10);
|
||||
|
||||
//Deskription
|
||||
if( (pos = tmp_reply.html.find("data-full-description=")) == std::string::npos) {
|
||||
@ -1503,9 +1504,9 @@ int ProgramManager::newsModus(Settings *settings)
|
||||
}
|
||||
|
||||
|
||||
if(settings->useFirstPage)
|
||||
break;
|
||||
else
|
||||
// if(settings->useFirstPage)
|
||||
// break;
|
||||
// else
|
||||
std::cout << std::endl;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user