2 from __future__ import unicode_literals
6 from .common import InfoExtractor
15 class LRTIE(InfoExtractor):
17 _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>[0-9]+)'
19 'url': 'http://www.lrt.lt/mediateka/irasas/54391/',
23 'title': 'Septynios Kauno dienos',
24 'description': 'md5:24d84534c7dc76581e59f5689462411a',
28 'skip_download': True, # HLS download
32 def _real_extract(self, url):
33 video_id = self._match_id(url)
34 webpage = self._download_webpage(url, video_id)
36 title = remove_end(self._og_search_title(webpage), ' - LRT')
37 thumbnail = self._og_search_thumbnail(webpage)
38 description = self._og_search_description(webpage)
39 duration = parse_duration(self._search_regex(
40 r"var record_len = '([0-9]+:[0-9]+:[0-9]+)';", webpage, 'record_len', fatal=False, default=None))
43 for js in re.findall(r'(?s)config:\s*(\{.*?\})', webpage):
44 data = self._parse_json(js, video_id, transform_source=js_to_json)
45 if 'provider' not in data:
47 if data['provider'] == 'rtmp':
50 'ext': determine_ext(data['file']),
51 'url': data['streamer'],
52 'play_path': 'mp4:%s' % data['file'],
54 'rtmp_real_time': True,
58 self._extract_m3u8_formats(data['file'], video_id, 'mp4'))
64 'thumbnail': thumbnail,
65 'description': description,