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.

33 lines
991 B

  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. },
  15. 'params': {
  16. # m3u8 download
  17. 'skip_download': True,
  18. },
  19. }
  20. def _real_extract(self, url):
  21. mobj = re.match(self._VALID_URL, url)
  22. title = mobj.group('title')
  23. webpage = self._download_webpage(url, title)
  24. ooyala_code = self._search_regex(
  25. r'data-embed-code=\'(.+?)\'', webpage, 'ooyala code')
  26. return OoyalaIE._build_url_result(ooyala_code)