mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
cYTFeedParser: Fix decodeVideoInfo()
This commit is contained in:
@@ -406,7 +406,7 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo)
|
|||||||
std::string infofile = thumbnail_dir;
|
std::string infofile = thumbnail_dir;
|
||||||
infofile += "/";
|
infofile += "/";
|
||||||
infofile += vinfo.id;
|
infofile += vinfo.id;
|
||||||
infofile += ".txt"
|
infofile += ".txt";
|
||||||
saveToFile(infofile.c_str(), answer);
|
saveToFile(infofile.c_str(), answer);
|
||||||
#endif
|
#endif
|
||||||
if(answer.find("token=") == std::string::npos)
|
if(answer.find("token=") == std::string::npos)
|
||||||
@@ -440,7 +440,17 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo)
|
|||||||
#endif
|
#endif
|
||||||
cYTVideoUrl yurl;
|
cYTVideoUrl yurl;
|
||||||
yurl.url = smap["url"];
|
yurl.url = smap["url"];
|
||||||
yurl.sig = smap["sig"];
|
|
||||||
|
std::string::size_type ptr = smap["url"].find("signature=");
|
||||||
|
if (ptr != std::string::npos)
|
||||||
|
{
|
||||||
|
ptr = smap["url"].find("=", ptr);
|
||||||
|
smap["url"].erase(0,ptr+1);
|
||||||
|
|
||||||
|
if((ptr = smap["url"].find("&")) != std::string::npos)
|
||||||
|
yurl.sig = smap["url"].substr(0,ptr);
|
||||||
|
}
|
||||||
|
|
||||||
int id = atoi(smap["itag"].c_str());
|
int id = atoi(smap["itag"].c_str());
|
||||||
if (supportedFormat(id) && !yurl.url.empty() && !yurl.sig.empty()) {
|
if (supportedFormat(id) && !yurl.url.empty() && !yurl.sig.empty()) {
|
||||||
yurl.quality = smap["quality"];
|
yurl.quality = smap["quality"];
|
||||||
|
Reference in New Issue
Block a user