teachingchannel.py 1021 B

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