]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/clipsyndicate.py
   3 from .common 
import InfoExtractor
 
  10 class ClipsyndicateIE(InfoExtractor
): 
  11     _VALID_URL 
= r
'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)' 
  14         u
'url': u
'http://www.clipsyndicate.com/video/play/4629301/brick_briscoe', 
  15         u
'md5': u
'4d7d549451bad625e0ff3d7bd56d776c', 
  19             u
'title': u
'Brick Briscoe', 
  24     def _real_extract(self
, url
): 
  25         mobj 
= re
.match(self
._VALID
_URL
, url
) 
  26         video_id 
= mobj
.group('id') 
  27         js_player 
= self
._download
_webpage
( 
  28             'http://eplayer.clipsyndicate.com/embed/player.js?va_id=%s' % video_id
, 
  29             video_id
, u
'Downlaoding player') 
  30         # it includes a required token 
  31         flvars 
= self
._search
_regex
(r
'flvars: "(.*?)"', js_player
, u
'flvars') 
  33         pdoc 
= self
._download
_xml
( 
  34             'http://eplayer.clipsyndicate.com/osmf/playlist?%s' % flvars
, 
  35             video_id
, u
'Downloading video info', 
  36             transform_source
=fix_xml_ampersands
) 
  38         track_doc 
= pdoc
.find('trackList/track') 
  40             node 
= find_xpath_attr(track_doc
, './/param', 'name', name
) 
  42                 return node
.attrib
['value'] 
  46             'title': find_param('title'), 
  47             'url': track_doc
.find('location').text
, 
  48             'thumbnail': find_param('thumbnail'), 
  49             'duration': int(find_param('duration')),