- upload_date = unified_strdate(self._search_regex(
- r'class="meta-item\sair-time">.*?<strong>([^<]+)</strong>', webpage, 'upload date', fatal=False))
- duration = int_or_none(self._search_regex(
- r'VideoDuration = "([^"]+)"', webpage, 'duration', fatal=False))
-
- pg_rating = self._search_regex(
- r'pgrating="([^"]+)"', webpage, 'PG rating', fatal=False, default='')
- age_limit = self._AGE_LIMITS.get(pg_rating, 0)
-
- sources_js = self._search_regex(
- r'(?s)sources:\s(\[.*?\]),', webpage, 'sources')
- sources = self._parse_json(
- sources_js, video_id, transform_source=js_to_json)
-
- formats = []
- for source in sources:
- if source.get('provider') == 'rtmp':
- m = re.search(r'^(?P<url>rtmp://[^/]+/(?P<app>[^/]+))/(?P<play_path>.+)$', source['file'])
- if not m:
- continue
- formats.append({
- 'format_id': 'rtmp',
- 'ext': 'flv',
- 'url': m.group('url'),
- 'play_path': m.group('play_path'),
- 'page_url': url,
- })
- elif source.get('file').endswith('.m3u8'):
- formats.append({
- 'format_id': 'hls',
- 'ext': source.get('type', 'mp4'),
- 'url': source['file'],
- })
+ video_info = self._download_json(
+ 'https://lnk.lt/api/main/video-page/%s/%s/false' % (display_id, video_id or '0'),
+ display_id)['videoConfig']['videoInfo']