]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/gazeta.py
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   9 class GazetaIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'(?P<url>https?://(?:www\.)?gazeta\.ru/(?:[^/]+/)?video/(?:main/)*(?:\d{4}/\d{2}/\d{2}/)?(?P<id>[A-Za-z0-9-_.]+)\.s?html)' 
  12         'url': 'http://www.gazeta.ru/video/main/zadaite_vopros_vladislavu_yurevichu.shtml', 
  13         'md5': 'd49c9bdc6e5a7888f27475dc215ee789', 
  17             'title': '«70–80 процентов гражданских в Донецке на грани голода»', 
  18             'description': 'md5:38617526050bd17b234728e7f9620a71', 
  19             'thumbnail': r
're:^https?://.*\.jpg', 
  21         'skip': 'video not found', 
  23         'url': 'http://www.gazeta.ru/lifestyle/video/2015/03/08/master-klass_krasivoi_byt._delaem_vesennii_makiyazh.shtml', 
  24         'only_matching': True, 
  26         'url': 'http://www.gazeta.ru/video/main/main/2015/06/22/platit_ili_ne_platit_po_isku_yukosa.shtml', 
  27         'md5': '37f19f78355eb2f4256ee1688359f24c', 
  31             'title': '"Если по иску ЮКОСа придется платить, это будет большой удар по бюджету"', 
  33         'add_ie': ['EaglePlatform'], 
  36     def _real_extract(self
, url
): 
  37         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  39         display_id 
= mobj
.group('id') 
  40         embed_url 
= '%s?p=embed' % mobj
.group('url') 
  41         embed_page 
= self
._download
_webpage
( 
  42             embed_url
, display_id
, 'Downloading embed page') 
  44         video_id 
= self
._search
_regex
( 
  45             r
'<div[^>]*?class="eagleplayer"[^>]*?data-id="([^"]+)"', embed_page
, 'video id') 
  47         return self
.url_result( 
  48             'eagleplatform:gazeta.media.eagleplatform.com:%s' % video_id
, 'EaglePlatform')