You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1.0 KiB

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. from .ooyala import OoyalaIE
  5. class TeachingChannelIE(InfoExtractor):
  6. _VALID_URL = r'https?://www\.teachingchannel\.org/videos/(?P<title>.+)'
  7. _TEST = {
  8. 'url': 'https://www.teachingchannel.org/videos/teacher-teaming-evolution',
  9. 'info_dict': {
  10. 'id': 'F3bnlzbToeI6pLEfRyrlfooIILUjz4nM',
  11. 'ext': 'mp4',
  12. 'title': 'A History of Teaming',
  13. 'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
  14. 'duration': 422.255,
  15. },
  16. 'params': {
  17. # m3u8 download
  18. 'skip_download': True,
  19. },
  20. }
  21. def _real_extract(self, url):
  22. mobj = re.match(self._VALID_URL, url)
  23. title = mobj.group('title')
  24. webpage = self._download_webpage(url, title)
  25. ooyala_code = self._search_regex(
  26. r'data-embed-code=\'(.+?)\'', webpage, 'ooyala code')
  27. return OoyalaIE._build_url_result(ooyala_code)