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.

35 lines
1.1 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. 'md5': '3d6361864d7cac20b57c8784da17166f',
  10. 'info_dict': {
  11. 'id': 'F3bnlzbToeI6pLEfRyrlfooIILUjz4nM',
  12. 'ext': 'mp4',
  13. 'title': 'A History of Teaming',
  14. 'description': 'md5:2a9033db8da81f2edffa4c99888140b3',
  15. 'duration': 422.255,
  16. },
  17. 'params': {
  18. 'skip_download': True,
  19. },
  20. 'add_ie': ['Ooyala'],
  21. }
  22. def _real_extract(self, url):
  23. mobj = re.match(self._VALID_URL, url)
  24. title = mobj.group('title')
  25. webpage = self._download_webpage(url, title)
  26. ooyala_code = self._search_regex(
  27. r'data-embed-code=\'(.+?)\'', webpage, 'ooyala code')
  28. return OoyalaIE._build_url_result(ooyala_code)