fix error with html sonderzeichen && better looking at info name ausgabe

This commit is contained in:
Markus 2019-10-30 14:54:23 +01:00
parent f2fdaa54a3
commit c415a475ca

View File

@ -738,6 +738,8 @@ int ProgramManager::infoModus(Settings *settings)
return 32;
}

int gesammtFolge = 0;

//speicher (zahl -1), ab da wo /staffel-x nicht mehr vorkommt
int maxStaffel = pageManager.counterContains(tmp_reply.html, "/staffel-%i");

@ -749,7 +751,10 @@ int ProgramManager::infoModus(Settings *settings)
std::cerr << ">>> Debug In " << __FUNCTION__ << ": getServerRequest function failed: at season page." << std::endl;
return 40;
}
std::cout << "Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl;

std::cout << std::endl
<< "Die Staffel " << staffel << " hat " << pageManager.counterContains(tmpReply.html, "/episode-%i") << " Folge(n)." << std::endl
<< std::endl;

std::string html = tmpReply.html;
size_t pos = 0;
@ -771,17 +776,20 @@ int ProgramManager::infoModus(Settings *settings)
std::string line;
while (std::getline(folgenListe, line).good()) {
std::string titel;
gesammtFolge = gesammtFolge + 1;

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);
line.erase(0, pos + 9);
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;
std::cout << "Ep. " << ( (gesammtFolge < 100) ? ( (gesammtFolge < 10) ? "00" : "0" ) : "" ) << gesammtFolge
<< " ( S" << ( (staffel < 10) ? "0" : "" ) << staffel
<< "E" << ( ( atoi( line.substr(0, pos).c_str() ) < 10) ? "0" : "" ) << 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;
@ -794,7 +802,7 @@ int ProgramManager::infoModus(Settings *settings)
}
titel = line.substr(0, pos);
if(titel != "")
std::cout << " > Titel1: " << titel << std::endl;
std::cout << " > Titel 1: " << titel << std::endl;

if( (pos = line.find("<span>")) == std::string::npos) {
std::cout << " => Error: Konnte Position von '<span>' nicht finden." << std::endl;
@ -807,7 +815,7 @@ int ProgramManager::infoModus(Settings *settings)
}
titel = line.substr(0, pos);
if(titel != "")
std::cout << " > Titel2: " << titel << std::endl;
std::cout << " > Titel 2: " << titel << std::endl;
}

}
@ -859,7 +867,18 @@ int ProgramManager::infoModus(Settings *settings)
return 86;
}
std::string description = pageManager.replace( pageManager.replace( tmp_reply.html.substr(pos + 23, pos2 - pos - 23), "\n", "" ), "<br />", "" );
//remove bug text: &amp;quot;

//remove bug text:
description = pageManager.replace(description, "&amp;quot;", "\""); //

description = pageManager.replace(description, "&amp;", "&"); //
description = pageManager.replace(description, "&lt;", "<"); //
description = pageManager.replace(description, "&gt;", ">"); //

description = pageManager.replace(description, "<br />", " "); //
description = pageManager.replace(description, "&quot;", "\""); //
description = pageManager.replace(description, "&apos;", "'"); //


//Genres
std::vector<std::string> genres;