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