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