diff options
author | Yen Chi Hsuan <[email protected]> | 2016-10-02 05:24:31 +0800 |
---|---|---|
committer | Yen Chi Hsuan <[email protected]> | 2016-10-02 13:47:06 +0800 |
commit | fd152641726a3f5e47a6a5065f8e9b6fe2623c11 (patch) | |
tree | f3bc3d03855a6879377ff14635a1fdb34dddbf6b | |
parent | bd2644120526429783c55e885f7042633826d7da (diff) | |
download | youtube-dl-fd152641726a3f5e47a6a5065f8e9b6fe2623c11.tar.gz youtube-dl-fd152641726a3f5e47a6a5065f8e9b6fe2623c11.zip |
[jwplatform] Support old-style jwplayer playlists
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/jwplatform.py | 6 |
2 files changed, 7 insertions, 0 deletions
@@ -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) diff --git a/youtube_dl/extractor/jwplatform.py b/youtube_dl/extractor/jwplatform.py index 38199fcd0..e10f7e9f9 100644 --- a/youtube_dl/extractor/jwplatform.py +++ b/youtube_dl/extractor/jwplatform.py @@ -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 |