]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[jwplatform] Support old-style jwplayer playlists
authorYen Chi Hsuan <yan12125@gmail.com>
Sat, 1 Oct 2016 21:24:31 +0000 (05:24 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Sun, 2 Oct 2016 05:47:06 +0000 (13:47 +0800)
ChangeLog
youtube_dl/extractor/jwplatform.py

index acceb9d0266dc936e872f113cd453674ef6fad81..d48a09122c04d320ff581e4175ba98f7512b16dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@ Core
   --xattr-set-filesize (#9054)
 
 Extractors
+* [jwplatform] Improve JWPlayer handling
 * [dctp] Fix extraction (#10734)
 + [leeco] Recognize more Le Sports URLs (#10794)
 
index 38199fcd0b5c46ba4e47b8fc8e448b3471dd17ea..e10f7e9f94ce69f6740c4bc89d8e4c5ad8651734 100644 (file)
@@ -39,6 +39,12 @@ class JWPlatformBaseIE(InfoExtractor):
             jwplayer_data = {'playlist': [jwplayer_data]}
 
         entries = []
+
+        # JWPlayer backward compatibility: single playlist item
+        # https://github.com/jwplayer/jwplayer/blob/v7.7.0/src/js/playlist/playlist.js#L10
+        if not isinstance(jwplayer_data['playlist'], list):
+            jwplayer_data['playlist'] = [jwplayer_data['playlist']]
+
         for video_data in jwplayer_data['playlist']:
             # JWPlayer backward compatibility: flattened sources
             # https://github.com/jwplayer/jwplayer/blob/v7.4.3/src/js/playlist/item.js#L29-L35