projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e15141a
)
[watchbox] Fix extraction (closes #16904)
author
Sergey M․
<dstftw@gmail.com>
Wed, 4 Jul 2018 19:22:15 +0000
(
02:22
+0700)
committer
Sergey M․
<dstftw@gmail.com>
Wed, 4 Jul 2018 19:22:15 +0000
(
02:22
+0700)
youtube_dl/extractor/watchbox.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/watchbox.py
b/youtube_dl/extractor/watchbox.py
index be0bcba15380041ca1698c1687497bffc524b4ef..d993130804b79a6ec0ab20e367431cc9068e2ea9 100644
(file)
--- 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)
webpage = self._download_webpage(url, video_id)
- source = self._parse_json(
+ source =
(
self._parse_json(
self._search_regex(
self._search_regex(
- r'
(?s)source["\']?\s*:\s*({.+?})\s*[,}]', webpage, 'source
',
+ r'
playerConf\s*=\s*({.+?})\s*;', webpage, 'player config
',
default='{}'),
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)
video_id = compat_str(source.get('videoId') or video_id)