Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backups
youtube-dl
Commits
19b9de13
Unverified
Commit
19b9de13
authored
Jul 30, 2018
by
Sergey M․
Browse files
[watchbox] Fix extraction (closes #17107)
parent
6f2d82a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
5 deletions
+14
-5
youtube_dl/extractor/watchbox.py
youtube_dl/extractor/watchbox.py
+14
-5
No files found.
youtube_dl/extractor/watchbox.py
View file @
19b9de13
...
...
@@ -10,6 +10,7 @@ from ..utils import (
js_to_json
,
strip_or_none
,
try_get
,
unescapeHTML
,
unified_timestamp
,
)
...
...
@@ -67,12 +68,20 @@ class WatchBoxIE(InfoExtractor):
webpage
=
self
.
_download_webpage
(
url
,
video_id
)
source
=
(
self
.
_parse_json
(
player_config
=
self
.
_parse_json
(
self
.
_search_regex
(
r
'playerConf\s*=\s*({.+?})\s*;'
,
webpage
,
'player config'
,
default
=
'{}'
),
video_id
,
transform_source
=
js_to_json
,
fatal
=
False
)
or
{}).
get
(
'source'
)
or
{}
r
'data-player-conf=(["\'])(?P<data>{.+?})\1'
,
webpage
,
'player config'
,
default
=
'{}'
,
group
=
'data'
),
video_id
,
transform_source
=
unescapeHTML
,
fatal
=
False
)
if
not
player_config
:
player_config
=
self
.
_parse_json
(
self
.
_search_regex
(
r
'playerConf\s*=\s*({.+?})\s*;'
,
webpage
,
'player config'
,
default
=
'{}'
),
video_id
,
transform_source
=
js_to_json
,
fatal
=
False
)
or
{}
source
=
player_config
.
get
(
'source'
)
or
{}
video_id
=
compat_str
(
source
.
get
(
'videoId'
)
or
video_id
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment