diff options
author | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-10-18 15:24:21 -0500 |
commit | 5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e (patch) | |
tree | 65209bc739db35e31f1c9b5b868eb5df4fe12ae3 /hypervideo_dl/extractor/twitch.py | |
parent | 27fe903c511691c078942bef5ee9a05a43b15c8f (diff) | |
download | hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.lz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.tar.xz hypervideo-5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/twitch.py')
-rw-r--r-- | hypervideo_dl/extractor/twitch.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/hypervideo_dl/extractor/twitch.py b/hypervideo_dl/extractor/twitch.py index a378bd6..be70bee 100644 --- a/hypervideo_dl/extractor/twitch.py +++ b/hypervideo_dl/extractor/twitch.py @@ -11,7 +11,6 @@ from .common import InfoExtractor from ..compat import ( compat_parse_qs, compat_str, - compat_urlparse, compat_urllib_parse_urlencode, compat_urllib_parse_urlparse, ) @@ -23,6 +22,7 @@ from ..utils import ( int_or_none, parse_duration, parse_iso8601, + parse_qs, qualities, try_get, unified_timestamp, @@ -376,7 +376,7 @@ def _make_video_result(node): return { '_type': 'url_transparent', 'ie_key': TwitchVodIE.ie_key(), - 'id': video_id, + 'id': 'v' + video_id, 'url': 'https://www.twitch.tv/videos/%s' % video_id, 'title': node.get('title'), 'thumbnail': node.get('previewThumbnailURL'), @@ -571,7 +571,7 @@ class TwitchVideosIE(TwitchPlaylistBaseIE): def _real_extract(self, url): channel_name = self._match_id(url) - qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query) + qs = parse_qs(url) filter = qs.get('filter', ['all'])[0] sort = qs.get('sort', ['time'])[0] broadcast = self._BROADCASTS.get(filter, self._DEFAULT_BROADCAST) @@ -647,7 +647,7 @@ class TwitchVideosClipsIE(TwitchPlaylistBaseIE): def _real_extract(self, url): channel_name = self._match_id(url) - qs = compat_urlparse.parse_qs(compat_urlparse.urlparse(url).query) + qs = parse_qs(url) range = qs.get('range', ['7d'])[0] clip = self._RANGE.get(range, self._DEFAULT_CLIP) return self.playlist_result( @@ -864,6 +864,7 @@ class TwitchClipsIE(TwitchBaseIE): 'md5': '761769e1eafce0ffebfb4089cb3847cd', 'info_dict': { 'id': '42850523', + 'display_id': 'FaintLightGullWholeWheat', 'ext': 'mp4', 'title': 'EA Play 2016 Live from the Novo Theatre', 'thumbnail': r're:^https?://.*\.jpg', @@ -976,6 +977,7 @@ class TwitchClipsIE(TwitchBaseIE): return { 'id': clip.get('id') or video_id, + 'display_id': video_id, 'title': clip.get('title') or video_id, 'formats': formats, 'duration': int_or_none(clip.get('durationSeconds')), |