A feature-rich command-line audio/video downloader
[ie/odnoklassniki] Fix inefficient regular expression (#15974)
bashonly071ad7dfa012
diff --git a/yt_dlp/extractor/odnoklassniki.py b/yt_dlp/extractor/odnoklassniki.pyindex c9bee9060e..8d3700faa3 100644--- a/yt_dlp/extractor/odnoklassniki.py+++ b/yt_dlp/extractor/odnoklassniki.py@@ -9,13 +9,13 @@ from ..utils import (int_or_none,qualities,smuggle_url,- traverse_obj,unescapeHTML,unified_strdate,unsmuggle_url,url_or_none,urlencode_postdata,)+from ..utils.traversal import find_element, traverse_objclass OdnoklassnikiIE(InfoExtractor):@@ -264,9 +264,7 @@ class OdnoklassnikiIE(InfoExtractor):note='Downloading desktop webpage',headers={'Referer': smuggled['referrer']} if smuggled.get('referrer') else {})- error = self._search_regex(- r'[^>]+class="vp_video_stub_txt"[^>]*>([^<]+)<',- webpage, 'error', default=None)+ error = traverse_obj(webpage, {find_element(cls='vp_video_stub_txt')})# Direct link from boostyif (error == 'The author of this video has not been found or is blocked'and not smuggled.get('referrer') and mode == 'videoembed'):