]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/krasview.py
3 from .common
import InfoExtractor
10 class KrasViewIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://krasview\.ru/(?:video|embed)/(?P<id>\d+)'
15 'url': 'http://krasview.ru/video/512228',
16 'md5': '3b91003cf85fc5db277870c8ebd98eae',
20 'title': 'Снег, лёд, заносы',
21 'description': 'Снято в городе Нягань, в Ханты-Мансийском автономном округе.',
23 'thumbnail': r
're:^https?://.*\.jpg',
26 'skip_download': 'Not accessible from Travis CI server',
30 def _real_extract(self
, url
):
31 video_id
= self
._match
_id
(url
)
33 webpage
= self
._download
_webpage
(url
, video_id
)
35 flashvars
= json
.loads(js_to_json(self
._search
_regex
(
36 r
'video_Init\(({.+?})', webpage
, 'flashvars')))
38 video_url
= flashvars
['url']
39 title
= self
._og
_search
_title
(webpage
)
40 description
= self
._og
_search
_description
(webpage
, default
=None)
41 thumbnail
= flashvars
.get('image') or self
._og
_search
_thumbnail
(webpage
)
42 duration
= int_or_none(flashvars
.get('duration'))
43 width
= int_or_none(self
._og
_search
_property
(
44 'video:width', webpage
, 'video width', default
=None))
45 height
= int_or_none(self
._og
_search
_property
(
46 'video:height', webpage
, 'video height', default
=None))
52 'description': description
,
53 'thumbnail': thumbnail
,