]>
Commit | Line | Data |
---|---|---|
a1de83e5 O |
1 | # coding: utf-8 |
2 | from __future__ import unicode_literals | |
3 | ||
4 | from .common import InfoExtractor | |
5 | ||
6 | ||
7 | class RuvIE(InfoExtractor): | |
8 | _VALID_URL = r'https?://(?:www\.)?ruv\.is/sarpurinn/ruv/\w+/(?P<id>[0-9]+)' | |
9 | _TEST = { | |
10 | 'url': 'http://ruv.is/sarpurinn/ruv/frettir/20170614', | |
11 | 'md5': 'a07ea1ebaba64082d90323b1c96f264b', | |
12 | 'info_dict': { | |
13 | 'id': '20170614', | |
14 | 'ext': 'mp4', | |
15 | 'title': 'Fréttir', | |
16 | } | |
17 | } | |
18 | ||
19 | def _real_extract(self, url): | |
20 | video_id = self._match_id(url) | |
21 | webpage = self._download_webpage(url, video_id) | |
22 | ||
23 | title = self._og_search_title(webpage) | |
24 | video_url = self._html_search_regex(r'video\.src\s*=\s*["\'](.+?)["\']', webpage, 'video URL') | |
25 | ||
26 | return { | |
27 | 'id': video_id, | |
28 | 'title': title, | |
29 | 'url': video_url, | |
30 | 'ext': 'mp4' | |
31 | } |