diff options
author | Jesús <heckyel@hyperbola.info> | 2022-12-02 05:21:10 +0800 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-12-02 05:21:10 +0800 |
commit | eaeeef9c1d1bedb76fea953c332ef84d53bffe2c (patch) | |
tree | c3cb5582247e47fc67c24cd7ff8ea857fb76821e /hypervideo_dl/extractor/teachable.py | |
parent | 1e5a50b71d8f0eae6007bedc329eecb24bb5aba3 (diff) | |
download | hypervideo-eaeeef9c1d1bedb76fea953c332ef84d53bffe2c.tar.lz hypervideo-eaeeef9c1d1bedb76fea953c332ef84d53bffe2c.tar.xz hypervideo-eaeeef9c1d1bedb76fea953c332ef84d53bffe2c.zip |
update from upstream
Diffstat (limited to 'hypervideo_dl/extractor/teachable.py')
-rw-r--r-- | hypervideo_dl/extractor/teachable.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/hypervideo_dl/extractor/teachable.py b/hypervideo_dl/extractor/teachable.py index 232eaa5..c212a49 100644 --- a/hypervideo_dl/extractor/teachable.py +++ b/hypervideo_dl/extractor/teachable.py @@ -1,5 +1,3 @@ -from __future__ import unicode_literals - import re from .common import InfoExtractor @@ -142,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) @@ -162,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', |