aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/jwplatform.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-09-17 18:45:08 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-09-17 18:45:08 +0800
commite14c82bd6b6cfc1e904b067350d818657c911e07 (patch)
tree39519e7b6cce8d47310fa577e2b4724bff87350d /youtube_dl/extractor/jwplatform.py
parentc51a7f0b2f2454bfe0b53f9d79567b3210e015b3 (diff)
[jwplatform] Use js_to_json to detect more JWPlayers
Diffstat (limited to 'youtube_dl/extractor/jwplatform.py')
-rw-r--r--youtube_dl/extractor/jwplatform.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/jwplatform.py b/youtube_dl/extractor/jwplatform.py
index 7aaa65476..38199fcd0 100644
--- a/youtube_dl/extractor/jwplatform.py
+++ b/youtube_dl/extractor/jwplatform.py
@@ -9,6 +9,7 @@ from ..utils import (
determine_ext,
float_or_none,
int_or_none,
+ js_to_json,
mimetype2ext,
)
@@ -19,14 +20,15 @@ class JWPlatformBaseIE(InfoExtractor):
# TODO: Merge this with JWPlayer-related codes in generic.py
mobj = re.search(
- 'jwplayer\((?P<quote>[\'"])[^\'" ]+(?P=quote)\)\.setup\((?P<options>[^)]+)\)',
+ r'jwplayer\((?P<quote>[\'"])[^\'" ]+(?P=quote)\)\.setup\s*\((?P<options>[^)]+)\)',
webpage)
if mobj:
return mobj.group('options')
def _extract_jwplayer_data(self, webpage, video_id, *args, **kwargs):
jwplayer_data = self._parse_json(
- self._find_jwplayer_data(webpage), video_id)
+ self._find_jwplayer_data(webpage), video_id,
+ transform_source=js_to_json)
return self._parse_jwplayer_data(
jwplayer_data, video_id, *args, **kwargs)