]>
Commit | Line | Data |
---|---|---|
566bd96d JMF |
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): | |
92519402 | 10 | _VALID_URL = r'https?://(?:www\.)?teachingchannel\.org/videos/(?P<title>.+)' |
566bd96d JMF |
11 | |
12 | _TEST = { | |
13 | 'url': 'https://www.teachingchannel.org/videos/teacher-teaming-evolution', | |
277c7465 | 14 | 'md5': '3d6361864d7cac20b57c8784da17166f', |
566bd96d JMF |
15 | 'info_dict': { |
16 | 'id': 'F3bnlzbToeI6pLEfRyrlfooIILUjz4nM', | |
17 | 'ext': 'mp4', | |
18 | 'title': 'A History of Teaming', | |
19 | 'description': 'md5:2a9033db8da81f2edffa4c99888140b3', | |
53e06b25 | 20 | 'duration': 422.255, |
566bd96d | 21 | }, |
688c634b | 22 | 'params': { |
23 | 'skip_download': True, | |
24 | }, | |
277c7465 | 25 | 'add_ie': ['Ooyala'], |
566bd96d JMF |
26 | } |
27 | ||
28 | def _real_extract(self, url): | |
29 | mobj = re.match(self._VALID_URL, url) | |
30 | title = mobj.group('title') | |
31 | webpage = self._download_webpage(url, title) | |
32 | ooyala_code = self._search_regex( | |
33 | r'data-embed-code=\'(.+?)\'', webpage, 'ooyala code') | |
34 | ||
35 | return OoyalaIE._build_url_result(ooyala_code) |