mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 00:25:08 +00:00
[utils] Add parse_qs
This commit is contained in:
@ -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)
|
||||
@ -300,14 +299,14 @@ class RutubePlaylistIE(RutubePlaylistBaseIE):
|
||||
def suitable(cls, url):
|
||||
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)
|
||||
|
Reference in New Issue
Block a user