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