]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/xhamster.py
[extractors] Use new framework for existing embeds (#4307)
[yt-dlp.git] / yt_dlp / extractor / xhamster.py
index e42eed7d8e28bb3a4878d07c13df0c850b353358..688c6b952272954359e530ff2eecd2ce2e0a168b 100644 (file)
@@ -373,6 +373,7 @@ def get_height(s):
 
 class XHamsterEmbedIE(InfoExtractor):
     _VALID_URL = r'https?://(?:.+?\.)?%s/xembed\.php\?video=(?P<id>\d+)' % XHamsterIE._DOMAINS
+    _EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1']
     _TEST = {
         'url': 'http://xhamster.com/xembed.php?video=3328539',
         'info_dict': {
@@ -387,12 +388,6 @@ class XHamsterEmbedIE(InfoExtractor):
         }
     }
 
-    @staticmethod
-    def _extract_urls(webpage):
-        return [url for _, url in re.findall(
-            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?xhamster\.com/xembed\.php\?video=\d+)\1',
-            webpage)]
-
     def _real_extract(self, url):
         video_id = self._match_id(url)