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