]> jfr.im git - yt-dlp.git/blame - yt_dlp/extractor/restudy.py
[cleanup] Add more ruff rules (#10149)
[yt-dlp.git] / yt_dlp / extractor / restudy.py
CommitLineData
4a0132c5
MR
1from .common import InfoExtractor
2
3
4class RestudyIE(InfoExtractor):
df773c3d 5 _WORKING = False
ac458e90
S
6 _VALID_URL = r'https?://(?:(?:www|portal)\.)?restudy\.dk/video/[^/]+/id/(?P<id>[0-9]+)'
7 _TESTS = [{
4a0132c5 8 'url': 'https://www.restudy.dk/video/play/id/1637',
4a0132c5
MR
9 'info_dict': {
10 'id': '1637',
ac265bef 11 'ext': 'flv',
4a0132c5 12 'title': 'Leiden-frosteffekt',
ac265bef
S
13 'description': 'Denne video er et eksperiment med flydende kvælstof.',
14 },
15 'params': {
16 # rtmp download
17 'skip_download': True,
add96eb9 18 },
ac458e90
S
19 }, {
20 'url': 'https://portal.restudy.dk/video/leiden-frosteffekt/id/1637',
21 'only_matching': True,
22 }]
4a0132c5
MR
23
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
ac265bef 26
4a0132c5 27 webpage = self._download_webpage(url, video_id)
ac265bef
S
28
29 title = self._og_search_title(webpage).strip()
30 description = self._og_search_description(webpage).strip()
31
32 formats = self._extract_smil_formats(
add96eb9 33 f'https://cdn.portal.restudy.dk/dynamic/themes/front/awsmedia/SmilDirectory/video_{video_id}.xml',
ac265bef
S
34 video_id)
35
4a0132c5
MR
36 return {
37 'id': video_id,
38 'title': title,
ac265bef
S
39 'description': description,
40 'formats': formats,
4a0132c5 41 }