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/rutube.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/rutube.py')
-rw-r--r-- | hypervideo_dl/extractor/rutube.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/hypervideo_dl/extractor/rutube.py b/hypervideo_dl/extractor/rutube.py index 8f54d56..d027412 100644 --- a/hypervideo_dl/extractor/rutube.py +++ b/hypervideo_dl/extractor/rutube.py @@ -7,13 +7,12 @@ import itertools from .common import InfoExtractor from ..compat import ( compat_str, - compat_parse_qs, - compat_urllib_parse_urlparse, ) from ..utils import ( determine_ext, bool_or_none, int_or_none, + parse_qs, try_get, unified_timestamp, url_or_none, @@ -178,7 +177,7 @@ class RutubeEmbedIE(RutubeBaseIE): embed_id = self._match_id(url) # Query may contain private videos token and should be passed to API # requests (see #19163) - query = compat_parse_qs(compat_urllib_parse_urlparse(url).query) + query = parse_qs(url) options = self._download_api_options(embed_id, query) video_id = options['effective_video'] formats = self._extract_formats(options, video_id) @@ -298,16 +297,18 @@ class RutubePlaylistIE(RutubePlaylistBaseIE): @classmethod def suitable(cls, url): + from ..utils import int_or_none, parse_qs + if not super(RutubePlaylistIE, cls).suitable(url): return False - params = compat_parse_qs(compat_urllib_parse_urlparse(url).query) + params = parse_qs(url) return params.get('pl_type', [None])[0] and int_or_none(params.get('pl_id', [None])[0]) def _next_page_url(self, page_num, playlist_id, item_kind): return self._PAGE_TEMPLATE % (item_kind, playlist_id, page_num) def _real_extract(self, url): - qs = compat_parse_qs(compat_urllib_parse_urlparse(url).query) + qs = parse_qs(url) playlist_kind = qs['pl_type'][0] playlist_id = qs['pl_id'][0] return self._extract_playlist(playlist_id, item_kind=playlist_kind) |