]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/mofosex.py
[extractors] Use new framework for existing embeds (#4307)
[yt-dlp.git] / yt_dlp / extractor / mofosex.py
index 66a098c9766441e9853fa5202e914f97e91ad93f..4221ef3e36eb5eb5b82d6ee39614600d84f5a364 100644 (file)
@@ -1,5 +1,3 @@
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     int_or_none,
@@ -59,17 +57,12 @@ def _real_extract(self, url):
 
 class MofosexEmbedIE(InfoExtractor):
     _VALID_URL = r'https?://(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=(?P<id>\d+)'
+    _EMBED_REGEX = [r'<iframe[^>]+\bsrc=["\'](?P<url>(?:https?:)?//(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=\d+)']
     _TESTS = [{
         'url': 'https://www.mofosex.com/embed/?videoid=318131&referrer=KM',
         'only_matching': True,
     }]
 
-    @staticmethod
-    def _extract_urls(webpage):
-        return re.findall(
-            r'<iframe[^>]+\bsrc=["\']((?:https?:)?//(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=\d+)',
-            webpage)
-
     def _real_extract(self, url):
         video_id = self._match_id(url)
         return self.url_result(