1 from .common
import InfoExtractor
8 class KinoPoiskIE(InfoExtractor
):
9 _GEO_COUNTRIES
= ['RU']
10 _VALID_URL
= r
'https?://(?:www\.)?kinopoisk\.ru/film/(?P<id>\d+)'
12 'url': 'https://www.kinopoisk.ru/film/81041/watch/',
13 'md5': '4f71c80baea10dfa54a837a46111d326',
17 'title': 'Алеша попович и тугарин змей',
18 'description': 'md5:43787e673d68b805d0aa1df5a5aea701',
19 'thumbnail': r
're:^https?://.*',
24 'url': 'https://www.kinopoisk.ru/film/81041',
25 'only_matching': True,
28 def _real_extract(self
, url
):
29 video_id
= self
._match
_id
(url
)
31 webpage
= self
._download
_webpage
(
32 'https://ott-widget.kinopoisk.ru/v1/kp/', video_id
,
33 query
={'kpId': video_id
})
35 data
= self
._parse
_json
(
37 r
'(?s)<script[^>]+\btype=["\']application
/json
[^
>]+>(.+?
)<',
41 film = data['filmStatus
']
42 title = film.get('title
') or film['originalTitle
']
44 formats = self._extract_m3u8_formats(
45 data['playlistEntity
']['uri
'], video_id, 'mp4
',
46 entry_protocol='m3u8_native
', m3u8_id='hls
')
48 description = dict_get(
49 film, ('descriptscription
', 'description
',
50 'shortDescriptscription
', 'shortDescription
'))
51 thumbnail = film.get('coverUrl
') or film.get('posterUrl
')
52 duration = int_or_none(film.get('duration
'))
53 age_limit = int_or_none(film.get('restrictionAge
'))
58 'description
': description,
59 'thumbnail
': thumbnail,
61 'age_limit
': age_limit,