]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/fivetv.py
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   7 from ..utils 
import int_or_none
 
  10 class FiveTVIE(InfoExtractor
): 
  15                             (?:[^/]+/)+(?P<id>\d+)| 
  16                             (?P<path>[^/?#]+)(?:[/?#])? 
  21         'url': 'http://5-tv.ru/news/96814/', 
  22         'md5': 'bbff554ad415ecf5416a2f48c22d9283', 
  26             'title': 'Россияне выбрали имя для общенациональной платежной системы', 
  27             'description': 'md5:a8aa13e2b7ad36789e9f77a74b6de660', 
  28             'thumbnail': 're:^https?://.*\.jpg$', 
  32         'url': 'http://5-tv.ru/video/1021729/', 
  36             'title': '3D принтер', 
  37             'description': 'md5:d76c736d29ef7ec5c0cf7d7c65ffcb41', 
  38             'thumbnail': 're:^https?://.*\.jpg$', 
  42         'url': 'http://www.5-tv.ru/glavnoe/#itemDetails', 
  46             'title': 'Итоги недели с 8 по 14 июня 2015 года', 
  47             'thumbnail': 're:^https?://.*\.jpg$', 
  50         'url': 'http://www.5-tv.ru/glavnoe/broadcasts/508645/', 
  51         'only_matching': True, 
  53         'url': 'http://5-tv.ru/films/1507502/', 
  54         'only_matching': True, 
  56         'url': 'http://5-tv.ru/programs/broadcast/508713/', 
  57         'only_matching': True, 
  59         'url': 'http://5-tv.ru/angel/', 
  60         'only_matching': True, 
  62         'url': 'http://www.5-tv.ru/schedule/?iframe=true&width=900&height=450', 
  63         'only_matching': True, 
  66     def _real_extract(self
, url
): 
  67         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  68         video_id 
= mobj
.group('id') or mobj
.group('path') 
  70         webpage 
= self
._download
_webpage
(url
, video_id
) 
  72         video_url 
= self
._search
_regex
( 
  73             r
'<a[^>]+?href="([^"]+)"[^>]+?class="videoplayer"', 
  76         title 
= self
._og
_search
_title
(webpage
, default
=None) or self
._search
_regex
( 
  77             r
'<title>([^<]+)</title>', webpage
, 'title') 
  78         duration 
= int_or_none(self
._og
_search
_property
( 
  79             'video:duration', webpage
, 'duration', default
=None)) 
  85             'description': self
._og
_search
_description
(webpage
, default
=None), 
  86             'thumbnail': self
._og
_search
_thumbnail
(webpage
, default
=None),