]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/rbgtum.py
3 from .common
import InfoExtractor
6 class RbgTumIE(InfoExtractor
):
7 _VALID_URL
= r
'https://live\.rbg\.tum\.de/w/(?P<id>.+)'
10 'url': 'https://live.rbg.tum.de/w/cpp/22128',
11 'md5': '53a5e7b3e07128e33bbf36687fe1c08f',
15 'title': 'Lecture: October 18. 2022',
16 'series': 'Concepts of C++ programming (IN2377)',
20 'url': 'https://live.rbg.tum.de/w/I2DL/12349/PRES',
21 'md5': '36c584272179f3e56b0db5d880639cba',
23 'id': 'I2DL/12349/PRES',
25 'title': 'Lecture 3: Introduction to Neural Networks',
26 'series': 'Introduction to Deep Learning (IN2346)',
30 'url': 'https://live.rbg.tum.de/w/fvv-info/16130/CAM',
31 'md5': 'e04189d92ff2f56aedf5cede65d37aad',
33 'id': 'fvv-info/16130/CAM',
35 'title': 'Fachschaftsvollversammlung',
36 'series': 'Fachschaftsvollversammlung Informatik',
40 def _real_extract(self
, url
):
41 video_id
= self
._match
_id
(url
)
42 webpage
= self
._download
_webpage
(url
, video_id
)
44 m3u8
= self
._html
_search
_regex
(r
'(https://.+?\.m3u8)', webpage
, 'm3u8')
45 lecture_title
= self
._html
_search
_regex
(r
'(?si)<h1.*?>(.*)</h1>', webpage
, 'title')
46 lecture_series_title
= self
._html
_search
_regex
(
47 r
'(?s)<title\b[^>]*>\s*(?:TUM-Live\s\|\s?)?([^:]+):?.*?</title>', webpage
, 'series')
49 formats
= self
._extract
_m
3u8_formats
(m3u8
, video_id
, 'mp4', entry_protocol
='m3u8_native', m3u8_id
='hls')
53 'title': lecture_title
,
54 'series': lecture_series_title
,
59 class RbgTumCourseIE(InfoExtractor
):
60 _VALID_URL
= r
'https://live\.rbg\.tum\.de/course/(?P<id>.+)'
62 'url': 'https://live.rbg.tum.de/course/2022/S/fpv',
64 'title': 'Funktionale Programmierung und Verifikation (IN0003)',
72 'url': 'https://live.rbg.tum.de/course/2022/W/set',
74 'title': 'SET FSMPIC',
83 def _real_extract(self
, url
):
84 course_id
= self
._match
_id
(url
)
85 webpage
= self
._download
_webpage
(url
, course_id
)
87 lecture_series_title
= self
._html
_search
_regex
(r
'(?si)<h1.*?>(.*)</h1>', webpage
, 'title')
90 for lecture_url
in re
.findall(r
'(?i)href="/w/(.+)(?<!/cam)(?<!/pres)(?<!/chat)"', webpage
):
91 lecture_urls
.append(self
.url_result('https://live.rbg.tum.de/w/' + lecture_url
, ie
=RbgTumIE
.ie_key()))
93 return self
.playlist_result(lecture_urls
, course_id
, lecture_series_title
)