1 from .common
import InfoExtractor
2 from ..utils
import int_or_none
, parse_duration
, parse_iso8601
5 class NovaPlayIE(InfoExtractor
):
6 _VALID_URL
= r
'https://play.nova\.bg/video/.*/(?P<id>\d+)'
9 'url': 'https://play.nova.bg/video/bratya/season-3/bratq-2021-10-08/548677',
10 'md5': 'b1127a84e61bed1632b7c2ca9cbb4153',
15 'alt_title': 'bratya/season-3/bratq-2021-10-08',
17 'timestamp': 1633724150,
18 'upload_date': '20211008',
19 'thumbnail': 'https://nbg-img.fite.tv/img/548677_460x260.jpg',
20 'description': 'Сезон 3 Епизод 25'
24 'url': 'https://play.nova.bg/video/igri-na-volqta/season-3/igri-na-volqta-2021-09-20-1/548227',
25 'md5': '5fd61b8ecbe582fc021019d570965d58',
29 'title': 'Игри на волята: България (20.09.2021) - част 1',
30 'alt_title': 'gri-na-volqta/season-3/igri-na-volqta-2021-09-20-1',
32 'timestamp': 1632167564,
33 'upload_date': '20210920',
34 'thumbnail': 'https://nbg-img.fite.tv/img/548227_460x260.jpg',
35 'description': 'Сезон 3 Епизод 13'
40 def _real_extract(self
, url
):
41 video_id
= self
._match
_id
(url
)
42 webpage
= self
._download
_webpage
(url
, video_id
)
43 video_props
= self
._search
_nextjs
_data
(webpage
, video_id
)['props']['pageProps']['video']
44 m3u8_url
= self
._download
_json
(
45 f
'https://nbg-api.fite.tv/api/v2/videos/{video_id}/streams',
46 video_id
, headers
={'x-flipps-user-agent': 'Flipps/75/9.7'}
)[0]['url']
47 formats
= self
._extract
_m
3u8_formats
(m3u8_url
, video_id
, 'mp4', m3u8_id
='hls')
48 self
._sort
_formats
(formats
)
52 'title': video_props
['title'],
53 'alt_title': video_props
.get('slug'),
54 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
55 'description': self
._og
_search
_description
(webpage
),
57 'duration': parse_duration(video_props
['duration']),
58 'timestamp': parse_iso8601(video_props
['published_at']),
59 'view_count': int_or_none(video_props
['view_count']),