1 from .common
import InfoExtractor
9 class LnkIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.)?lnk\.lt/[^/]+/(?P<id>\d+)'
13 'url': 'https://lnk.lt/zinios/79791',
17 'title': 'LNK.lt: Viešintų gyventojai sukilo prieš radijo bangų siųstuvą',
18 'description': 'Svarbiausios naujienos trumpai, LNK žinios ir Info dienos pokalbiai.',
21 'upload_date': '20191123',
22 'thumbnail': r
're:^https?://.*\.jpg$',
23 'episode_number': 13431,
24 'series': 'Naujausi žinių reportažai',
25 'episode': 'Episode 13431',
27 'params': {'skip_download': True},
29 'url': 'https://lnk.lt/istorijos-trumpai/152546',
33 'title': 'Radžio koncertas gaisre ',
34 'description': 'md5:0666b5b85cb9fc7c1238dec96f71faba',
37 'upload_date': '20220105',
38 'thumbnail': r
're:^https?://.*\.jpg$',
39 'episode_number': 1036,
40 'series': 'Istorijos trumpai',
41 'episode': 'Episode 1036',
43 'params': {'skip_download': True},
45 'url': 'https://lnk.lt/gyvunu-pasaulis/151549',
49 'title': 'Gyvūnų pasaulis',
53 'upload_date': '20220108',
54 'thumbnail': r
're:^https?://.*\.jpg$',
56 'series': 'Gyvūnų pasaulis',
57 'episode': 'Episode 16',
59 'params': {'skip_download': True},
62 def _real_extract(self
, url
):
63 video_id
= self
._match
_id
(url
)
64 video_json
= self
._download
_json
(f
'https://lnk.lt/api/video/video-config/{video_id}', video_id
)['videoInfo']
65 formats
, subtitles
= [], {}
66 if video_json
.get('videoUrl'):
67 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(video_json
['videoUrl'], video_id
)
69 subtitles
= self
._merge
_subtitles
(subtitles
, subs
)
70 if video_json
.get('videoFairplayUrl') and not video_json
.get('drm'):
71 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(video_json
['videoFairplayUrl'], video_id
)
73 subtitles
= self
._merge
_subtitles
(subtitles
, subs
)
77 'title': video_json
.get('title'),
78 'description': video_json
.get('description'),
79 'view_count': video_json
.get('viewsCount'),
80 'duration': video_json
.get('duration'),
81 'upload_date': unified_strdate(video_json
.get('airDate')),
82 'thumbnail': format_field(video_json
, 'posterImage', 'https://lnk.lt/all-images/%s'),
83 'episode_number': int_or_none(video_json
.get('episodeNumber')),
84 'series': video_json
.get('programTitle'),
86 'subtitles': subtitles
,