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