aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/watchbox.py
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2018-07-05 02:22:15 +0700
committerSergey M․ <dstftw@gmail.com>2018-07-05 02:22:15 +0700
commit1ed0b2f74d8337b9625716f9069233a341edd22e (patch)
treed3d2690eba2b671c6e9430b6d2a8fd58b8269f0a /youtube_dl/extractor/watchbox.py
parente15141adaee67d1e9b9e97c17b73fe4c052c3449 (diff)
downloadyoutube-dl-1ed0b2f74d8337b9625716f9069233a341edd22e.tar.xz
[watchbox] Fix extraction (closes #16904)
Diffstat (limited to 'youtube_dl/extractor/watchbox.py')
-rw-r--r--youtube_dl/extractor/watchbox.py7
1 files changed, 4 insertions, 3 deletions
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)