[youtube] More explicit player config JSON extraction (fixes #7468)
authorLukáš Lalinský <lukas@oxygene.sk>
Sun, 22 Nov 2015 12:14:35 +0000 (13:14 +0100)
committerLukáš Lalinský <lukas@oxygene.sk>
Sun, 22 Nov 2015 12:14:35 +0000 (13:14 +0100)
youtube_dl/extractor/youtube.py

index 687e0b4dbc1d044eb55c89da722961c68b0428b8..21731188af1b413fb05578f02a8154e393396fa9 100644 (file)
@@ -1074,7 +1074,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor):
             age_gate = False
             video_info = None
             # Try looking directly into the video webpage
-            mobj = re.search(r';ytplayer\.config\s*=\s*({.*?});', video_webpage)
+            mobj = re.search(r';ytplayer\.config\s*=\s*({.*?});ytplayer', video_webpage)
             if mobj:
                 json_code = uppercase_escape(mobj.group(1))
                 ytplayer_config = json.loads(json_code)