logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

teachingchannel.py (1062B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class TeachingChannelIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?teachingchannel\.org/videos?/(?P<id>[^/?&#]+)'
  5. _TEST = {
  6. 'url': 'https://www.teachingchannel.org/videos/teacher-teaming-evolution',
  7. 'info_dict': {
  8. 'id': '3swwlzkT',
  9. 'ext': 'mp4',
  10. 'title': 'A History of Teaming',
  11. 'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
  12. 'duration': 422,
  13. 'upload_date': '20170316',
  14. 'timestamp': 1489691297,
  15. },
  16. 'params': {
  17. 'skip_download': True,
  18. },
  19. 'add_ie': ['JWPlatform'],
  20. }
  21. def _real_extract(self, url):
  22. display_id = self._match_id(url)
  23. webpage = self._download_webpage(url, display_id)
  24. mid = self._search_regex(
  25. r'(?:data-mid=["\']|id=["\']jw-video-player-)([a-zA-Z0-9]{8})',
  26. webpage, 'media id')
  27. return self.url_result('jwplatform:' + mid, 'JWPlatform', mid)