]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/fivetv.py
2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
10 class FiveTVIE(InfoExtractor
):
11 _VALID_URL
= r
'http://(?:www\.)?5-tv\.ru/[^/]*/(?P<id>\d+)'
14 'url': 'http://5-tv.ru/news/96814/',
15 'md5': 'bbff554ad415ecf5416a2f48c22d9283',
19 'title': 'Россияне выбрали имя для общенациональной платежной системы',
20 'description': 'md5:a8aa13e2b7ad36789e9f77a74b6de660',
21 'thumbnail': 're:^https?://.*\.jpg$',
28 'url': 'http://5-tv.ru/video/1021729/',
29 'md5': '299c8b72960efc9990acd2c784dc2296',
33 'title': '3D принтер',
34 'description': 'md5:d76c736d29ef7ec5c0cf7d7c65ffcb41',
35 'thumbnail': 're:^https?://.*\.jpg$',
43 def _real_extract(self
, url
):
44 video_id
= self
._match
_id
(url
)
46 webpage
= self
._download
_webpage
(url
, video_id
)
48 video_link
= self
._search
_regex
(
49 r
'(<a.*?class="videoplayer">)', webpage
, 'video link')
51 url
= self
._search
_regex
(r
'href="([^"]+)"', video_link
, 'video url')
52 width
= int_or_none(self
._search
_regex
(
53 r
'width:(\d+)px', video_link
, 'width', default
=None, fatal
=False))
54 height
= int_or_none(self
._search
_regex
(
55 r
'height:(\d+)px', video_link
, 'height', default
=None, fatal
=False))
56 duration
= int_or_none(self
._og
_search
_property
(
57 'video:duration', webpage
, 'duration'))
63 'title': self
._og
_search
_title
(webpage
),
64 'description': self
._og
_search
_description
(webpage
),
65 'thumbnail': self
._og
_search
_thumbnail
(webpage
),