From: Sergey M․ Date: Wed, 4 Jul 2018 19:22:15 +0000 (+0700) Subject: [watchbox] Fix extraction (closes #16904) X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=1ed0b2f74d8337b9625716f9069233a341edd22e;p=youtube-dl [watchbox] Fix extraction (closes #16904) --- diff --git a/youtube_dl/extractor/watchbox.py b/youtube_dl/extractor/watchbox.py index be0bcba15..d99313080 100644 --- a/youtube_dl/extractor/watchbox.py +++ b/youtube_dl/extractor/watchbox.py @@ -67,11 +67,12 @@ class WatchBoxIE(InfoExtractor): webpage = self._download_webpage(url, video_id) - source = self._parse_json( + source = (self._parse_json( self._search_regex( - r'(?s)source["\']?\s*:\s*({.+?})\s*[,}]', webpage, 'source', + r'playerConf\s*=\s*({.+?})\s*;', webpage, 'player config', default='{}'), - video_id, transform_source=js_to_json, fatal=False) or {} + video_id, transform_source=js_to_json, + fatal=False) or {}).get('source') or {} video_id = compat_str(source.get('videoId') or video_id)