]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/fivetv.py
2 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from ..utils
import int_or_none
9 class FiveTVIE(InfoExtractor
):
14 (?:[^/]+/)+(?P<id>\d+)|
15 (?P<path>[^/?#]+)(?:[/?#])?
20 'url': 'http://5-tv.ru/news/96814/',
21 'md5': 'bbff554ad415ecf5416a2f48c22d9283',
25 'title': 'Россияне выбрали имя для общенациональной платежной системы',
26 'description': 'md5:a8aa13e2b7ad36789e9f77a74b6de660',
27 'thumbnail': r
're:^https?://.*\.jpg$',
31 'url': 'http://5-tv.ru/video/1021729/',
35 'title': '3D принтер',
36 'description': 'md5:d76c736d29ef7ec5c0cf7d7c65ffcb41',
37 'thumbnail': r
're:^https?://.*\.jpg$',
41 # redirect to https://www.5-tv.ru/projects/1000095/izvestia-glavnoe/
42 'url': 'http://www.5-tv.ru/glavnoe/#itemDetails',
46 'title': r
're:^Итоги недели с \d+ по \d+ \w+ \d{4} года$',
47 'thumbnail': r
're:^https?://.*\.jpg$',
49 'skip': 'redirect to «Известия. Главное» project page',
51 'url': 'http://www.5-tv.ru/glavnoe/broadcasts/508645/',
52 'only_matching': True,
54 'url': 'http://5-tv.ru/films/1507502/',
55 'only_matching': True,
57 'url': 'http://5-tv.ru/programs/broadcast/508713/',
58 'only_matching': True,
60 'url': 'http://5-tv.ru/angel/',
61 'only_matching': True,
63 'url': 'http://www.5-tv.ru/schedule/?iframe=true&width=900&height=450',
64 'only_matching': True,
67 def _real_extract(self
, url
):
68 mobj
= self
._match
_valid
_url
(url
)
69 video_id
= mobj
.group('id') or mobj
.group('path')
71 webpage
= self
._download
_webpage
(url
, video_id
)
73 video_url
= self
._search
_regex
(
74 [r
'<div[^>]+?class="(?:flow)?player[^>]+?data-href="([^"]+)"',
75 r
'<a[^>]+?href="([^"]+)"[^>]+?class="videoplayer"'],
78 title
= self
._og
_search
_title
(webpage
, default
=None) or self
._search
_regex
(
79 r
'<title>([^<]+)</title>', webpage
, 'title')
80 duration
= int_or_none(self
._og
_search
_property
(
81 'video:duration', webpage
, 'duration', default
=None))
87 'description': self
._og
_search
_description
(webpage
, default
=None),
88 'thumbnail': self
._og
_search
_thumbnail
(webpage
, default
=None),