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