aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Ritchie <luc.ritchie@gmail.com>2018-01-03 04:22:55 -0500
committerSergey M <dstftw@gmail.com>2018-01-03 16:22:55 +0700
commitf0c6c2bce29281d37d2bbd589143b35323e38e3d (patch)
tree8ab4b0fb27aef344f1130ee9ed61a247e42736f0
parent9650c3e91d96fc054e37485d2bfd86a6a12417e5 (diff)
downloadyoutube-dl-f0c6c2bce29281d37d2bbd589143b35323e38e3d.zip
youtube-dl-f0c6c2bce29281d37d2bbd589143b35323e38e3d.tar.gz
youtube-dl-f0c6c2bce29281d37d2bbd589143b35323e38e3d.tar.bz2
[twitch] Pass video id to url_result when extracting playlist
-rw-r--r--youtube_dl/extractor/twitch.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/youtube_dl/extractor/twitch.py b/youtube_dl/extractor/twitch.py
index bf57eac..f9164af 100644
--- a/youtube_dl/extractor/twitch.py
+++ b/youtube_dl/extractor/twitch.py
@@ -358,9 +358,16 @@ class TwitchPlaylistBaseIE(TwitchBaseIE):
break
offset += limit
return self.playlist_result(
- [self.url_result(entry) for entry in orderedSet(entries)],
+ [self._make_url_result(entry) for entry in orderedSet(entries)],
channel_id, channel_name)
+ def _make_url_result(self, url):
+ try:
+ video_id = 'v%s' % TwitchVodIE._match_id(url)
+ return self.url_result(url, TwitchVodIE.ie_key(), video_id=video_id)
+ except AssertionError:
+ return self.url_result(url)
+
def _extract_playlist_page(self, response):
videos = response.get('videos')
return [video['url'] for video in videos] if videos else []