mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-09-03 08:35:32 +00:00
[extractors] Use new framework for existing embeds (#4307)
`Brightcove` is difficult to migrate because it's subclasses may depend on the signature of the current functions. So it is left as-is for now Note: Tests have not been migrated
This commit is contained in:
@ -140,12 +140,12 @@ class TeachableIE(TeachableBaseIE):
|
||||
r'<link[^>]+href=["\']https?://(?:process\.fs|assets)\.teachablecdn\.com',
|
||||
webpage)
|
||||
|
||||
@staticmethod
|
||||
def _extract_url(webpage, source_url):
|
||||
if not TeachableIE._is_teachable(webpage):
|
||||
return
|
||||
if re.match(r'https?://[^/]+/(?:courses|p)', source_url):
|
||||
return '%s%s' % (TeachableBaseIE._URL_PREFIX, source_url)
|
||||
@classmethod
|
||||
def _extract_embed_urls(cls, url, webpage):
|
||||
if cls._is_teachable(webpage):
|
||||
if re.match(r'https?://[^/]+/(?:courses|p)', url):
|
||||
yield f'{cls._URL_PREFIX}{url}'
|
||||
raise cls.StopExtraction()
|
||||
|
||||
def _real_extract(self, url):
|
||||
mobj = self._match_valid_url(url)
|
||||
@ -160,7 +160,7 @@ class TeachableIE(TeachableBaseIE):
|
||||
|
||||
webpage = self._download_webpage(url, video_id)
|
||||
|
||||
wistia_urls = WistiaIE._extract_urls(webpage)
|
||||
wistia_urls = WistiaIE._extract_embed_urls(url, webpage)
|
||||
if not wistia_urls:
|
||||
if any(re.search(p, webpage) for p in (
|
||||
r'class=["\']lecture-contents-locked',
|
||||
|
Reference in New Issue
Block a user