]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/yourupload.py
40fc4165f402722eca38cbfbc7c06cf2e4409a64
   2 from __future__ 
import unicode_literals
 
   6 from .common 
import InfoExtractor
 
   9 class YourUploadIE(InfoExtractor
): 
  10     _VALID_URL 
= r
'''(?x)https?://(?:www\.)? 
  11         (?:yourupload\.com/watch| 
  12            embed\.yourupload\.com| 
  14         )/(?P<id>[A-Za-z0-9]+) 
  18             'url': 'http://yourupload.com/watch/14i14h', 
  19             'md5': 'bf5c2f95c4c917536e80936af7bc51e1', 
  23                 'title': 'BigBuckBunny_320x180.mp4', 
  24                 'thumbnail': 're:^https?://.*\.jpe?g', 
  28             'url': 'http://embed.yourupload.com/14i14h', 
  29             'only_matching': True, 
  32             'url': 'http://embed.yucache.net/14i14h?client_file_id=803349', 
  33             'only_matching': True, 
  37     def _real_extract(self
, url
): 
  38         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  39         video_id 
= mobj
.group('id') 
  41         url 
= 'http://embed.yucache.net/{0:}'.format(video_id
) 
  42         webpage 
= self
._download
_webpage
(url
, video_id
) 
  44         title 
= self
._og
_search
_title
(webpage
) 
  45         thumbnail 
= self
._og
_search
_thumbnail
(webpage
) 
  46         url 
= self
._og
_search
_video
_url
(webpage
) 
  57             'thumbnail': thumbnail
,