2 from __future__ import unicode_literals
7 from .common import InfoExtractor
10 class TeleTaskIE(InfoExtractor):
11 _VALID_URL = r'http?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)/'
13 'url': 'http://www.tele-task.de/archive/video/html5/26168/',
14 'md5': 'TODO: md5 sum of the first 10241 bytes of the video file (use --test)',
18 'title': 'Duplicate Detection',
19 'thumbnail': 're:^https?://.*\.jpg$',
21 # TODO more properties, either as:
23 # * MD5 checksum; start the string with md5:
24 # * A regular expression; start the string with re:
25 # * Any Python type (for example int or float)
29 def _real_extract(self, url):
30 video_id = self._match_id(url)
31 webpage = self._download_webpage(url, video_id)
33 lecture_url = self._html_search_regex(
34 r'href="([^"]+)" itemprop="name">', webpage, 'title')
35 lecture_id = re.search("([0-9]+)/",lecture_url).group(1)
36 overview_page = self._download_webpage("http://www.tele-task.de" + lecture_url,
39 title = self._html_search_regex(
40 r'itemprop="name">([^"]+)</a>', webpage, 'title')
41 url = self._html_search_regex(
42 r'class="speaker".*?src="([^"]+)"', webpage, 'video_url', flags=re.DOTALL)
43 description = self._html_search_regex(
44 r'Description of the series:</p>([^"]+)</div>', overview_page,
45 'description',flags=re.DOTALL)
47 date = self._html_search_regex(
48 r'<td class="label">Date:</td><td>([^"]+)</td>', webpage, 'date')
49 date = datetime.datetime.strptime(date, '%d.%m.%Y').strftime('%Y%m%d')
56 'description': description,