2 from __future__ import unicode_literals
7 from .common import InfoExtractor
16 class LRTIE(InfoExtractor):
18 _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>[0-9]+)'
20 'url': 'http://www.lrt.lt/mediateka/irasas/54391/',
24 'title': 'Septynios Kauno dienos',
25 'description': 'Kauno miesto ir apskrities naujienos',
29 'skip_download': True, # HLS download
34 def _real_extract(self, url):
35 mobj = re.match(self._VALID_URL, url)
36 video_id = mobj.group('id')
38 webpage = self._download_webpage(url, video_id)
40 title = remove_end(self._og_search_title(webpage), ' - LRT')
41 thumbnail = self._og_search_thumbnail(webpage)
42 description = self._og_search_description(webpage)
43 duration = parse_duration(self._search_regex(
44 r"'duration':\s*'([^']+)',", webpage,
45 'duration', fatal=False, default=None))
48 for js in re.findall(r'(?s)config:\s*(\{.*?\})', webpage):
49 data = json.loads(js_to_json(js))
50 if data['provider'] == 'rtmp':
53 'ext': determine_ext(data['file']),
54 'url': data['streamer'],
55 'play_path': 'mp4:%s' % data['file'],
60 self._extract_m3u8_formats(data['file'], video_id, 'mp4'))
66 'thumbnail': thumbnail,
67 'description': description,