]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/engadget.py
   1 from __future__ 
import unicode_literals
 
   5 from .common 
import InfoExtractor
 
   6 from .fivemin 
import FiveMinIE
 
  12 class EngadgetIE(InfoExtractor
): 
  13     _VALID_URL 
= r
'''(?x)https?://www.engadget.com/ 
  14         (?:video/5min/(?P<id>\d+)| 
  19         'url': 'http://www.engadget.com/video/5min/518153925/', 
  20         'md5': 'c6820d4828a5064447a4d9fc73f312c9', 
  24             'title': 'Samsung Galaxy Tab Pro 8.4 Review', 
  26         'add_ie': ['FiveMin'], 
  29     def _real_extract(self
, url
): 
  30         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  31         video_id 
= mobj
.group('id') 
  33         if video_id 
is not None: 
  34             return FiveMinIE
._build
_result
(video_id
) 
  36             title 
= url_basename(url
) 
  37             webpage 
= self
._download
_webpage
(url
, title
) 
  38             ids 
= re
.findall(r
'<iframe[^>]+?playList=(\d+)', webpage
) 
  42                 'entries': [FiveMinIE
._build
_result
(id) for id in ids
]