]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/lecture2go.py
40a3d23468636877cc485ac9e064ee3527a3dcb2
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
14 class Lecture2GoIE(InfoExtractor
):
15 _VALID_URL
= r
'https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)'
17 'url': 'https://lecture2go.uni-hamburg.de/veranstaltungen/-/v/17473',
18 'md5': 'ac02b570883020d208d405d5a3fd2f7f',
22 'title': '2 - Endliche Automaten und reguläre Sprachen',
23 'creator': 'Frank Heitmann',
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
30 webpage
= self
._download
_webpage
(url
, video_id
)
32 title
= self
._html
_search
_regex
(r
'<em[^>]+class="title">(.+)</em>', webpage
, 'title')
35 for url
in set(re
.findall(r
'"src","([^"]+)"', webpage
)):
36 ext
= determine_ext(url
)
38 formats
.extend(self
._extract
_f
4m
_formats
(url
, video_id
))
40 formats
.extend(self
._extract
_m
3u8_formats
(url
, video_id
))
46 self
._sort
_formats
(formats
)
48 creator
= self
._html
_search
_regex
(
49 r
'<div[^>]+id="description">([^<]+)</div>', webpage
, 'creator', fatal
=False)
50 duration
= parse_duration(self
._html
_search
_regex
(
51 r
'Duration:\s*</em>\s*<em[^>]*>([^<]+)</em>', webpage
, 'duration', fatal
=False))
52 view_count
= int_or_none(self
._html
_search
_regex
(
53 r
'Views:\s*</em>\s*<em[^>]+>(\d+)</em>', webpage
, 'view count', fatal
=False))
61 'view_count': view_count
,