]>
Commit | Line | Data |
---|---|---|
1 | import re | |
2 | ||
3 | from .common import InfoExtractor | |
4 | from ..utils import unified_strdate | |
5 | ||
6 | ||
7 | class TeleTaskIE(InfoExtractor): | |
8 | _WORKING = False | |
9 | _VALID_URL = r'https?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)' | |
10 | _TEST = { | |
11 | 'url': 'http://www.tele-task.de/archive/video/html5/26168/', | |
12 | 'info_dict': { | |
13 | 'id': '26168', | |
14 | 'title': 'Duplicate Detection', | |
15 | }, | |
16 | 'playlist': [{ | |
17 | 'md5': '290ef69fb2792e481169c3958dbfbd57', | |
18 | 'info_dict': { | |
19 | 'id': '26168-speaker', | |
20 | 'ext': 'mp4', | |
21 | 'title': 'Duplicate Detection', | |
22 | 'upload_date': '20141218', | |
23 | }, | |
24 | }, { | |
25 | 'md5': 'e1e7218c5f0e4790015a437fcf6c71b4', | |
26 | 'info_dict': { | |
27 | 'id': '26168-slides', | |
28 | 'ext': 'mp4', | |
29 | 'title': 'Duplicate Detection', | |
30 | 'upload_date': '20141218', | |
31 | }, | |
32 | }], | |
33 | } | |
34 | ||
35 | def _real_extract(self, url): | |
36 | lecture_id = self._match_id(url) | |
37 | webpage = self._download_webpage(url, lecture_id) | |
38 | ||
39 | title = self._html_search_regex( | |
40 | r'itemprop="name">([^<]+)</a>', webpage, 'title') | |
41 | upload_date = unified_strdate(self._html_search_regex( | |
42 | r'Date:</td><td>([^<]+)</td>', webpage, 'date', fatal=False)) | |
43 | ||
44 | entries = [{ | |
45 | 'id': f'{lecture_id}-{format_id}', | |
46 | 'url': video_url, | |
47 | 'title': title, | |
48 | 'upload_date': upload_date, | |
49 | } for format_id, video_url in re.findall( | |
50 | r'<video class="([^"]+)"[^>]*>\s*<source src="([^"]+)"', webpage)] | |
51 | ||
52 | return self.playlist_result(entries, lecture_id, title) |