From c415a475cab7702c054ecbd4b0eac6d6c7f3c016 Mon Sep 17 00:00:00 2001 From: Markus Date: Wed, 30 Oct 2019 14:54:23 +0100 Subject: [PATCH] fix error with html sonderzeichen && better looking at info name ausgabe --- programManager.cpp | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/programManager.cpp b/programManager.cpp index 5c512fd..8845c6c 100644 --- a/programManager.cpp +++ b/programManager.cpp @@ -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(" ")) == std::string::npos) { std::cout << " => Error: Konnte Position von ' ' nicht finden." << std::endl; return 44; } - std::cout << " Staffel " << staffel << " " << line.substr(0, pos) << ":" <")) == std::string::npos) { std::cout << " => Error: Konnte Position von '' 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("")) == std::string::npos) { std::cout << " => Error: Konnte Position von '' 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", "" ), "
", "" ); - //remove bug text: &quot; + + //remove bug text: + description = pageManager.replace(description, "&quot;", "\""); // + + description = pageManager.replace(description, "&", "&"); // + description = pageManager.replace(description, "<", "<"); // + description = pageManager.replace(description, ">", ">"); // + + description = pageManager.replace(description, "
", " "); // + description = pageManager.replace(description, """, "\""); // + description = pageManager.replace(description, "'", "'"); // + //Genres std::vector genres;