summaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/odnoklassniki.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-05 09:06:11 +0000
commitfd5a06560caab95c71a2e2e805efa8d0f3a696a0 (patch)
treee1c600b8612bc4b301e2f51b875fcd835c5008cc /yt_dlp/extractor/odnoklassniki.py
parentReleasing progress-linux version 2024.05.27-1~progress7.99u1. (diff)
downloadyt-dlp-fd5a06560caab95c71a2e2e805efa8d0f3a696a0.tar.xz
yt-dlp-fd5a06560caab95c71a2e2e805efa8d0f3a696a0.zip
Merging upstream version 2024.07.01.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'yt_dlp/extractor/odnoklassniki.py')
-rw-r--r--yt_dlp/extractor/odnoklassniki.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/yt_dlp/extractor/odnoklassniki.py b/yt_dlp/extractor/odnoklassniki.py
index 1be45d8..d27d1c3 100644
--- a/yt_dlp/extractor/odnoklassniki.py
+++ b/yt_dlp/extractor/odnoklassniki.py
@@ -1,12 +1,7 @@
import urllib.parse
from .common import InfoExtractor
-from ..compat import (
- compat_etree_fromstring,
- compat_parse_qs,
- compat_urllib_parse_unquote,
- compat_urllib_parse_urlparse,
-)
+from ..compat import compat_etree_fromstring
from ..networking import HEADRequest
from ..utils import (
ExtractorError,
@@ -257,8 +252,8 @@ class OdnoklassnikiIE(InfoExtractor):
raise e
def _extract_desktop(self, url):
- start_time = int_or_none(compat_parse_qs(
- compat_urllib_parse_urlparse(url).query).get('fromTime', [None])[0])
+ start_time = int_or_none(urllib.parse.parse_qs(
+ urllib.parse.urlparse(url).query).get('fromTime', [None])[0])
url, smuggled = unsmuggle_url(url, {})
video_id, is_embed = self._match_valid_url(url).group('id', 'embed')
@@ -281,7 +276,7 @@ class OdnoklassnikiIE(InfoExtractor):
player = self._parse_json(
unescapeHTML(self._search_regex(
- r'data-options=(?P<quote>["\'])(?P<player>{.+?%s.+?})(?P=quote)' % video_id,
+ rf'data-options=(?P<quote>["\'])(?P<player>{{.+?{video_id}.+?}})(?P=quote)',
webpage, 'player', group='player')),
video_id)
@@ -300,7 +295,7 @@ class OdnoklassnikiIE(InfoExtractor):
if st_location:
data['st.location'] = st_location
metadata = self._download_json(
- compat_urllib_parse_unquote(flashvars['metadataUrl']),
+ urllib.parse.unquote(flashvars['metadataUrl']),
video_id, 'Downloading metadata JSON',
data=urlencode_postdata(data))
@@ -434,7 +429,7 @@ class OdnoklassnikiIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(
- 'http://m.ok.ru/video/%s' % video_id, video_id,
+ f'http://m.ok.ru/video/{video_id}', video_id,
note='Downloading mobile webpage')
error = self._search_regex(
@@ -460,5 +455,5 @@ class OdnoklassnikiIE(InfoExtractor):
'format_id': 'mobile',
'url': redirect_url,
'ext': 'mp4',
- }]
+ }],
}