From 9af1506c8989a7db181014e4cb320c9a99fc44e7 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Wed, 12 Jun 2019 20:32:54 +0200 Subject: [PATCH] YTparser: fix video without signature --- src/system/ytparser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/system/ytparser.cpp b/src/system/ytparser.cpp index a9e898721..3241ff221 100644 --- a/src/system/ytparser.cpp +++ b/src/system/ytparser.cpp @@ -463,7 +463,7 @@ bool cYTFeedParser::decodeVideoInfo(std::string &answer, cYTVideoInfo &vinfo) #endif cYTVideoUrl yurl; yurl.url = smap["url"]; - + std::size_t lsig = 0; std::string::size_type ptr = smap["url"].find("signature="); 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) yurl.sig = smap["url"].substr(0,ptr); + }else{ + lsig = smap["url"].find("lsig="); } 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.type = smap["type"]; vinfo.formats.insert(yt_urlmap_pair_t(id, yurl));