1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-12-05 00:17:43 +00:00
youtube-dl/youtube_dl/extractor/teachingchannel.py

34 lines
1 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
from .common import InfoExtractor
class TeachingChannelIE(InfoExtractor):
2019-11-30 22:49:45 +00:00
_VALID_URL = r'https?://(?:www\.)?teachingchannel\.org/videos?/(?P<id>[^/?&#]+)'
_TEST = {
'url': 'https://www.teachingchannel.org/videos/teacher-teaming-evolution',
'info_dict': {
2019-11-30 22:49:45 +00:00
'id': '3swwlzkT',
'ext': 'mp4',
'title': 'A History of Teaming',
'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
2019-11-30 22:49:45 +00:00
'duration': 422,
'upload_date': '20170316',
'timestamp': 1489691297,
},
2016-05-24 15:42:22 +00:00
'params': {
'skip_download': True,
},
2019-11-30 22:49:45 +00:00
'add_ie': ['JWPlatform'],
}
def _real_extract(self, url):
2019-11-30 22:49:45 +00:00
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
mid = self._search_regex(
r'(?:data-mid=["\']|id=["\']jw-video-player-)([a-zA-Z0-9]{8})',
webpage, 'media id')
2019-11-30 22:49:45 +00:00
return self.url_result('jwplatform:' + mid, 'JWPlatform', mid)