]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/lecture2go.py
3 from .common
import InfoExtractor
12 class Lecture2GoIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)'
15 'url': 'https://lecture2go.uni-hamburg.de/veranstaltungen/-/v/17473',
16 'md5': 'ac02b570883020d208d405d5a3fd2f7f',
20 'title': '2 - Endliche Automaten und reguläre Sprachen',
21 'creator': 'Frank Heitmann',
26 'skip_download': True,
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
32 webpage
= self
._download
_webpage
(url
, video_id
)
34 title
= self
._html
_search
_regex
(r
'<em[^>]+class="title">(.+)</em>', webpage
, 'title')
37 for url
in set(re
.findall(r
'var\s+playerUri\d+\s*=\s*"([^"]+)"', webpage
)):
38 ext
= determine_ext(url
)
39 protocol
= determine_protocol({'url': url}
)
41 formats
.extend(self
._extract
_f
4m
_formats
(url
, video_id
, f4m_id
='hds'))
43 formats
.extend(self
._extract
_m
3u8_formats
(url
, video_id
, ext
='mp4', m3u8_id
='hls'))
45 if protocol
== 'rtmp':
46 continue # XXX: currently broken
48 'format_id': protocol
,
52 self
._sort
_formats
(formats
)
54 creator
= self
._html
_search
_regex
(
55 r
'<div[^>]+id="description">([^<]+)</div>', webpage
, 'creator', fatal
=False)
56 duration
= parse_duration(self
._html
_search
_regex
(
57 r
'Duration:\s*</em>\s*<em[^>]*>([^<]+)</em>', webpage
, 'duration', fatal
=False))
58 view_count
= int_or_none(self
._html
_search
_regex
(
59 r
'Views:\s*</em>\s*<em[^>]+>(\d+)</em>', webpage
, 'view count', fatal
=False))
67 'view_count': view_count
,