]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/auengine.py
   1 from __future__ 
import unicode_literals
 
   5 from .common 
import InfoExtractor
 
  13 class AUEngineIE(InfoExtractor
): 
  15         'url': 'http://auengine.com/embed.php?file=lfvlytY6&w=650&h=370', 
  16         'file': 'lfvlytY6.mp4', 
  17         'md5': '48972bdbcf1a3a2f5533e62425b41d4f', 
  19             'title': '[Commie]The Legend of the Legendary Heroes - 03 - Replication Eye (Alpha Stigma)[F9410F5A]' 
  22     _VALID_URL 
= r
'(?:http://)?(?:www\.)?auengine\.com/embed\.php\?.*?file=([^&]+).*?' 
  24     def _real_extract(self
, url
): 
  25         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  26         video_id 
= mobj
.group(1) 
  27         webpage 
= self
._download
_webpage
(url
, video_id
) 
  28         title 
= self
._html
_search
_regex
(r
'<title>(?P<title>.+?)</title>', 
  31         links 
= re
.findall(r
'\s(?:file|url):\s*["\']([^
\'"]+)["\']', webpage) 
  32         links = map(compat_urllib_parse.unquote, links) 
  37             if link.endswith('.png
'): 
  39             elif '/videos
/' in link: 
  42             raise ExtractorError(u'Could 
not find video URL
') 
  43         ext = '.' + determine_ext(video_url) 
  44         if ext == title[-len(ext):]: 
  45             title = title[:-len(ext)] 
  51             'thumbnail
': thumbnail,