1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-06-16 16:34:09 +00:00

[ie/odnoklassniki] Detect and raise when login is required (#13361)

Closes #13360
Authored by: bashonly
This commit is contained in:
bashonly 2025-06-01 18:18:24 -05:00 committed by GitHub
parent 85c8a405e3
commit 148a1eb4c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -273,6 +273,8 @@ class OdnoklassnikiIE(InfoExtractor):
return self._extract_desktop(smuggle_url(url, {'referrer': 'https://boosty.to'})) return self._extract_desktop(smuggle_url(url, {'referrer': 'https://boosty.to'}))
elif error: elif error:
raise ExtractorError(error, expected=True) raise ExtractorError(error, expected=True)
elif '>Access to this video is restricted</div>' in webpage:
self.raise_login_required()
player = self._parse_json( player = self._parse_json(
unescapeHTML(self._search_regex( unescapeHTML(self._search_regex(
@ -429,7 +431,7 @@ class OdnoklassnikiIE(InfoExtractor):
video_id = self._match_id(url) video_id = self._match_id(url)
webpage = self._download_webpage( webpage = self._download_webpage(
f'http://m.ok.ru/video/{video_id}', video_id, f'https://m.ok.ru/video/{video_id}', video_id,
note='Downloading mobile webpage') note='Downloading mobile webpage')
error = self._search_regex( error = self._search_regex(