]>
Raphaël G. Git Repositories - youtubedl/blob - youtube_dl/extractor/lenta.py
   2 from __future__ 
import unicode_literals
 
   4 from .common 
import InfoExtractor
 
   7 class LentaIE(InfoExtractor
): 
   8     _VALID_URL 
= r
'https?://(?:www\.)?lenta\.ru/[^/]+/\d+/\d+/\d+/(?P<id>[^/?#&]+)' 
  10         'url': 'https://lenta.ru/news/2018/03/22/savshenko_go/', 
  14             'title': 'Надежду Савченко задержали', 
  15             'thumbnail': r
're:^https?://.*\.jpg$', 
  20             'skip_download': True, 
  23         # EaglePlatform iframe embed 
  24         'url': 'http://lenta.ru/news/2015/03/06/navalny/', 
  28             'title': 'Навальный вышел на свободу', 
  29             'description': 'md5:d97861ac9ae77377f3f20eaf9d04b4f5', 
  30             'thumbnail': r
're:^https?://.*\.jpg$', 
  36             'skip_download': True, 
  40     def _real_extract(self
, url
): 
  41         display_id 
= self
._match
_id
(url
) 
  43         webpage 
= self
._download
_webpage
(url
, display_id
) 
  45         video_id 
= self
._search
_regex
( 
  46             r
'vid\s*:\s*["\']?
(\d
+)', webpage, 'eagleplatform 
id', 
  49             return self.url_result( 
  50                 'eagleplatform
:lentaru
.media
.eagleplatform
.com
:%s' % video_id, 
  51                 ie='EaglePlatform
', video_id=video_id) 
  53         return self.url_result(url, ie='Generic
')