1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-30 20:27:54 +01:00
youtube-dl/youtube_dl/extractor/teachingchannel.py

34 lines
1.0 KiB
Python
Raw Normal View History

from __future__ import unicode_literals
from .common import InfoExtractor
class TeachingChannelIE(InfoExtractor):
2019-11-30 23:49:45 +01: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 23:49:45 +01:00
'id': '3swwlzkT',
'ext': 'mp4',
'title': 'A History of Teaming',
'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
2019-11-30 23:49:45 +01:00
'duration': 422,
'upload_date': '20170316',
'timestamp': 1489691297,
},
2016-05-24 17:42:22 +02:00
'params': {
'skip_download': True,
},
2019-11-30 23:49:45 +01:00
'add_ie': ['JWPlatform'],
}
def _real_extract(self, url):
2019-11-30 23:49:45 +01: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 23:49:45 +01:00
return self.url_result('jwplatform:' + mid, 'JWPlatform', mid)