diff options
author | Tom-Oliver Heidel <github@tom-oliver.eu> | 2020-11-30 02:26:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 02:26:35 +0100 |
commit | 8e423ae86a43fed87d6976294810f8e038a78a17 (patch) | |
tree | a6954c04c728edae37c851c7b3f3f9a375a039c2 | |
parent | 284ec6f48a7735a229b31c853c2bc3b5b9135024 (diff) | |
parent | d02f12107f3e0c640b942dafbf9d3e26f81e6473 (diff) | |
download | hypervideo-pre-8e423ae86a43fed87d6976294810f8e038a78a17.tar.lz hypervideo-pre-8e423ae86a43fed87d6976294810f8e038a78a17.tar.xz hypervideo-pre-8e423ae86a43fed87d6976294810f8e038a78a17.zip |
Merge pull request #224 from kyuyeunk/vlive
[Vlive] Fix playlist handling when downloading a channel
-rw-r--r-- | youtube_dlc/extractor/vlive.py | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/youtube_dlc/extractor/vlive.py b/youtube_dlc/extractor/vlive.py index 223709b1e..c07550810 100644 --- a/youtube_dlc/extractor/vlive.py +++ b/youtube_dlc/extractor/vlive.py @@ -315,13 +315,34 @@ class VLiveChannelIE(VLiveBaseIE): for video in videos: video_id = video.get('videoSeq') - if not video_id: + video_type = video.get('videoType') + + if not video_id or not video_type: continue video_id = compat_str(video_id) - entries.append( - self.url_result( - 'http://www.vlive.tv/video/%s' % video_id, - ie=VLiveIE.ie_key(), video_id=video_id)) + + if video_type in ('PLAYLIST'): + playlist_videos = try_get( + video, + lambda x: x['videoPlaylist']['videoList'], list) + if not playlist_videos: + continue + + for playlist_video in playlist_videos: + playlist_video_id = playlist_video.get('videoSeq') + if not playlist_video_id: + continue + playlist_video_id = compat_str(playlist_video_id) + + entries.append( + self.url_result( + 'http://www.vlive.tv/video/%s' % playlist_video_id, + ie=VLiveIE.ie_key(), video_id=playlist_video_id)) + else: + entries.append( + self.url_result( + 'http://www.vlive.tv/video/%s' % video_id, + ie=VLiveIE.ie_key(), video_id=video_id)) return self.playlist_result( entries, channel_code, channel_name) |