forked from markus/S_New4
add to info modus: Names from the episodes
This commit is contained in:
parent
d54e24dfb5
commit
d3ed67f3be
@ -476,9 +476,66 @@ int ProgramManager::infoModus(Settings *settings)
|
||||
Reply tmpReply = pageManager.getServerRequest(pageManager.UrlPraefix + nameInUrl + "/staffel-" + std::to_string(staffel));
|
||||
if(tmpReply.html == "-1")
|
||||
return 40;
|
||||
std::cout << " > Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl;
|
||||
std::cout << "Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl;
|
||||
|
||||
std::string html = tmpReply.html;
|
||||
size_t pos = 0;
|
||||
if( (pos = html.find("<tr ")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '<tr ' nicht finden." << std::endl;
|
||||
return 41;
|
||||
} else
|
||||
html.erase(0, pos);
|
||||
if( (pos = html.find("</tbody>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '</tbody>' nicht finden." << std::endl;
|
||||
return 42;
|
||||
} else
|
||||
html.erase(pos, std::string::npos);
|
||||
|
||||
html = pageManager.replace(html, "\n", "");
|
||||
html = pageManager.replace(html, "</tr>", "\n");
|
||||
|
||||
std::stringstream folgenListe(html);
|
||||
std::string line;
|
||||
while (std::getline(folgenListe, line).good()) {
|
||||
std::string titel;
|
||||
|
||||
if( (pos = line.find("\"> Folge")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '\"> Folge' nicht finden." << std::endl;
|
||||
return 43;
|
||||
} else
|
||||
line.erase(0, pos + 3);
|
||||
if( (pos = line.find(" </a>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von ' </a>' nicht finden." << std::endl;
|
||||
return 44;
|
||||
}
|
||||
std::cout << " Staffel " << staffel << " " << line.substr(0, pos) << ":" <<std::endl;
|
||||
|
||||
if( (pos = line.find("<strong>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '<strong>' nicht finden." << std::endl;
|
||||
return 43;
|
||||
} else
|
||||
line.erase(0, pos + 8);
|
||||
if( (pos = line.find("</strong>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '</strong>' nicht finden." << std::endl;
|
||||
return 44;
|
||||
}
|
||||
titel = line.substr(0, pos);
|
||||
if(titel != "")
|
||||
std::cout << " > Titel1: " << titel << std::endl;
|
||||
|
||||
if( (pos = line.find("<span>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '<span>' nicht finden." << std::endl;
|
||||
return 43;
|
||||
} else
|
||||
line.erase(0, pos + 6);
|
||||
if( (pos = line.find("</span>")) == std::string::npos) {
|
||||
std::cout << " => Error: Konnte Position von '</span>' nicht finden." << std::endl;
|
||||
return 44;
|
||||
}
|
||||
titel = line.substr(0, pos);
|
||||
if(titel != "")
|
||||
std::cout << " > Titel2: " << titel << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user