]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[jwplatform] Use js_to_json to detect more JWPlayers
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 17 Sep 2016 10:45:08 +0000 (18:45 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sat, 17 Sep 2016 10:45:08 +0000 (18:45 +0800)
ChangeLog
youtube_dl/extractor/jwplatform.py

index 4583537ac1a8cf39e89fb1ece7afee848f83a830..a9f7cee539535ef075193a6c31b218351589fd79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+version <unreleased>
+
+Extractors
+* [jwplatform] Improve JWPlayer detection
+
+
 version 2016.09.15
 
 Core
index 7aaa6547698d176104e2f3a0393504db9034ee19..38199fcd0b5c46ba4e47b8fc8e448b3471dd17ea 100644 (file)
@@ -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)