]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/videofyme.py
   2 import xml
.etree
.ElementTree
 
   4 from .common 
import InfoExtractor
 
  10 class VideofyMeIE(InfoExtractor
): 
  11     _VALID_URL 
= r
'https?://(www.videofy.me/.+?|p.videofy.me/v)/(?P<id>\d+)(&|#|$)' 
  12     IE_NAME 
= u
'videofy.me' 
  15         u
'url': u
'http://www.videofy.me/thisisvideofyme/1100701', 
  16         u
'file':  u
'1100701.mp4', 
  17         u
'md5': u
'2046dd5758541d630bfa93e741e2fd79', 
  19             u
'title': u
'This is VideofyMe', 
  21             u
'uploader': u
'VideofyMe', 
  22             u
'uploader_id': u
'thisisvideofyme', 
  27     def _real_extract(self
, url
): 
  28         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  29         video_id 
= mobj
.group('id') 
  30         config_xml 
= self
._download
_webpage
('http://sunshine.videofy.me/?videoId=%s' % video_id
, 
  32         config 
= xml
.etree
.ElementTree
.fromstring(config_xml
.encode('utf-8')) 
  33         video 
= config
.find('video') 
  34         sources 
= video
.find('sources') 
  35         url_node 
= find_xpath_attr(sources
, 'source', 'id', 'HQ on') 
  37             url_node 
= find_xpath_attr(sources
, 'source', 'id', 'HQ off') 
  38         video_url 
= url_node
.find('url').text
 
  40         return {'id': video_id
, 
  41                 'title': video
.find('title').text
, 
  43                 'ext': determine_ext(video_url
), 
  44                 'thumbnail': video
.find('thumb').text
, 
  45                 'description': video
.find('description').text
, 
  46                 'uploader': config
.find('blog/name').text
, 
  47                 'uploader_id': video
.find('identifier').text
, 
  48                 'view_count': re
.search(r
'\d+', video
.find('views').text
).group(),