]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/libsyn.py
[extractors] Use new framework for existing embeds (#4307)
[yt-dlp.git] / yt_dlp / extractor / libsyn.py
index 2cf444258a2b57e7509a5ce83efdab0125bf20e3..29bbb03defdd67fee2bef63702e2cb52dd555e20 100644 (file)
@@ -1,8 +1,3 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
-import re
-
 from .common import InfoExtractor
 from ..utils import (
     clean_html,
@@ -15,6 +10,7 @@
 
 class LibsynIE(InfoExtractor):
     _VALID_URL = r'(?P<mainurl>https?://html5-player\.libsyn\.com/embed/episode/id/(?P<id>[0-9]+))'
+    _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//html5-player\.libsyn\.com/embed/.+?)\1']
 
     _TESTS = [{
         'url': 'http://html5-player.libsyn.com/embed/episode/id/6385796/',
@@ -42,7 +38,7 @@ class LibsynIE(InfoExtractor):
     }]
 
     def _real_extract(self, url):
-        url, video_id = re.match(self._VALID_URL, url).groups()
+        url, video_id = self._match_valid_url(url).groups()
         webpage = self._download_webpage(url, video_id)
 
         data = self._parse_json(self._search_regex(