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