mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 18:01:13 +02:00
YTparser: fix video without signature
This commit is contained in:
@@ -463,7 +463,7 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo)
|
|||||||
#endif
|
#endif
|
||||||
cYTVideoUrl yurl;
|
cYTVideoUrl yurl;
|
||||||
yurl.url = smap["url"];
|
yurl.url = smap["url"];
|
||||||
|
std::size_t lsig = 0;
|
||||||
std::string::size_type ptr = smap["url"].find("signature=");
|
std::string::size_type ptr = smap["url"].find("signature=");
|
||||||
if (ptr != std::string::npos)
|
if (ptr != std::string::npos)
|
||||||
{
|
{
|
||||||
@@ -472,10 +472,12 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo)
|
|||||||
|
|
||||||
if((ptr = smap["url"].find("&")) != std::string::npos)
|
if((ptr = smap["url"].find("&")) != std::string::npos)
|
||||||
yurl.sig = smap["url"].substr(0,ptr);
|
yurl.sig = smap["url"].substr(0,ptr);
|
||||||
|
}else{
|
||||||
|
lsig = smap["url"].find("lsig=");
|
||||||
}
|
}
|
||||||
|
|
||||||
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() || lsig)) {
|
||||||
yurl.quality = smap["quality"];
|
yurl.quality = smap["quality"];
|
||||||
yurl.type = smap["type"];
|
yurl.type = smap["type"];
|
||||||
vinfo.formats.insert(yt_urlmap_pair_t(id, yurl));
|
vinfo.formats.insert(yt_urlmap_pair_t(id, yurl));
|
||||||
|
Reference in New Issue
Block a user