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