3 from .common
import InfoExtractor
12 class Lecture2GoIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)'
16 'url': 'https://lecture2go.uni-hamburg.de/veranstaltungen/-/v/17473',
17 'md5': 'ac02b570883020d208d405d5a3fd2f7f',
21 'title': '2 - Endliche Automaten und reguläre Sprachen',
22 'creator': 'Frank Heitmann',
27 'skip_download': True,
31 def _real_extract(self
, url
):
32 video_id
= self
._match
_id
(url
)
33 webpage
= self
._download
_webpage
(url
, video_id
)
35 title
= self
._html
_search
_regex
(r
'<em[^>]+class="title">(.+)</em>', webpage
, 'title')
38 for url
in set(re
.findall(r
'var\s+playerUri\d+\s*=\s*"([^"]+)"', webpage
)):
39 ext
= determine_ext(url
)
40 protocol
= determine_protocol({'url': url
})
42 formats
.extend(self
._extract
_f
4m
_formats
(url
, video_id
, f4m_id
='hds'))
44 formats
.extend(self
._extract
_m
3u8_formats
(url
, video_id
, ext
='mp4', m3u8_id
='hls'))
46 if protocol
== 'rtmp':
47 continue # XXX: currently broken
49 'format_id': protocol
,
53 creator
= self
._html
_search
_regex
(
54 r
'<div[^>]+id="description">([^<]+)</div>', webpage
, 'creator', fatal
=False)
55 duration
= parse_duration(self
._html
_search
_regex
(
56 r
'Duration:\s*</em>\s*<em[^>]*>([^<]+)</em>', webpage
, 'duration', fatal
=False))
57 view_count
= int_or_none(self
._html
_search
_regex
(
58 r
'Views:\s*</em>\s*<em[^>]+>(\d+)</em>', webpage
, 'view count', fatal
=False))
66 'view_count': view_count
,