2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class LRTIE(InfoExtractor):
13 _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/irasas/(?P<id>[0-9]+)'
15 'url': 'http://www.lrt.lt/mediateka/irasas/54391/',
19 'title': 'Septynios Kauno dienos',
20 'description': 'md5:24d84534c7dc76581e59f5689462411a',
24 'skip_download': True, # m3u8 download
28 def _real_extract(self, url):
29 video_id = self._match_id(url)
30 webpage = self._download_webpage(url, video_id)
32 title = remove_end(self._og_search_title(webpage), ' - LRT')
33 m3u8_url = self._search_regex(
34 r'file\s*:\s*(["\'])(?P<url>.+?)\1\s*\+\s*location\.hash\.substring\(1\)',
35 webpage, 'm3u8 url', group='url')
36 formats = self._extract_m3u8_formats(m3u8_url, video_id, 'mp4')
38 thumbnail = self._og_search_thumbnail(webpage)
39 description = self._og_search_description(webpage)
40 duration = parse_duration(self._search_regex(
41 r'var\s+record_len\s*=\s*(["\'])(?P<duration>[0-9]+:[0-9]+:[0-9]+)\1',
42 webpage, 'duration', default=None, group='duration'))
48 'thumbnail': thumbnail,
49 'description': description,