]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/viewlift.py
[extractors] Use new framework for existing embeds (#4307)
[yt-dlp.git] / yt_dlp / extractor / viewlift.py
index d081a2f125d61cb97bfac8d6cee7080a92baa62f..b630f9a6d74ec92885e08950d88242aff1f5a592 100644 (file)
@@ -1,5 +1,4 @@
 import json
-import re
 
 from .common import InfoExtractor
 from ..compat import compat_HTTPError
@@ -63,6 +62,7 @@ def _call_api(self, site, path, video_id, url, query):
 class ViewLiftEmbedIE(ViewLiftBaseIE):
     IE_NAME = 'viewlift:embed'
     _VALID_URL = r'https?://(?:(?:www|embed)\.)?(?P<domain>%s)/embed/player\?.*\bfilmId=(?P<id>[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12})' % ViewLiftBaseIE._DOMAINS_REGEX
+    _EMBED_REGEX = [r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?(?:%s)/embed/player.+?)\1' % ViewLiftBaseIE._DOMAINS_REGEX]
     _TESTS = [{
         'url': 'http://embed.snagfilms.com/embed/player?filmId=74849a00-85a9-11e1-9660-123139220831&w=500',
         'md5': '2924e9215c6eff7a55ed35b72276bd93',
@@ -89,14 +89,6 @@ class ViewLiftEmbedIE(ViewLiftBaseIE):
         'only_matching': True,
     }]
 
-    @staticmethod
-    def _extract_url(webpage):
-        mobj = re.search(
-            r'<iframe[^>]+?src=(["\'])(?P<url>(?:https?:)?//(?:embed\.)?(?:%s)/embed/player.+?)\1' % ViewLiftBaseIE._DOMAINS_REGEX,
-            webpage)
-        if mobj:
-            return mobj.group('url')
-
     def _real_extract(self, url):
         domain, film_id = self._match_valid_url(url).groups()
         site = domain.split('.')[-2]