aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/teachable.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/teachable.py')
-rw-r--r--hypervideo_dl/extractor/teachable.py16
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',