2 from __future__ import unicode_literals
4 from .common import InfoExtractor
10 class OppetArkivIE(InfoExtractor):
11 _VALID_URL = r'https?://(?:www\.)?oppetarkiv.se/video/(?P<id>[0-9]+)'
13 'url': 'http://www.oppetarkiv.se/video/1058509/rederiet-sasong-1-avsnitt-1-av-318',
14 'md5': '7b95ca9bedeead63012b2d7c3992c28f',
18 'title': 'Farlig kryssning',
20 'thumbnail': 're:^https?://.*[\.-]jpg$',
24 def _real_extract(self, url):
25 video_id = self._match_id(url)
26 info = self._download_json(
27 'http://www.oppetarkiv.se/video/%s?output=json' % video_id, video_id)
29 title = info['context']['title']
30 thumbnail = info['context'].get('thumbnailImage')
32 video_info = info['video']
34 for vr in video_info['videoReferences']:
36 if determine_ext(vurl) == 'm3u8':
37 formats.extend(self._extract_m3u8_formats(
39 ext='mp4', entry_protocol='m3u8_native',
40 m3u8_id=vr.get('playerType')))
43 'format_id': vr.get('playerType'),
46 self._sort_formats(formats)
48 duration = video_info.get('materialLength')
54 'thumbnail': thumbnail,