]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/clipsyndicate.py
02a1667fa3fbf7cbe1a822db7b82f9c087864249
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
12 class ClipsyndicateIE(InfoExtractor
):
13 _VALID_URL
= r
'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)'
16 'url': 'http://www.clipsyndicate.com/video/play/4629301/brick_briscoe',
17 'md5': '4d7d549451bad625e0ff3d7bd56d776c',
21 'title': 'Brick Briscoe',
23 'thumbnail': 're:^https?://.+\.jpg',
27 def _real_extract(self
, url
):
28 mobj
= re
.match(self
._VALID
_URL
, url
)
29 video_id
= mobj
.group('id')
30 js_player
= self
._download
_webpage
(
31 'http://eplayer.clipsyndicate.com/embed/player.js?va_id=%s' % video_id
,
32 video_id
, 'Downlaoding player')
33 # it includes a required token
34 flvars
= self
._search
_regex
(r
'flvars: "(.*?)"', js_player
, 'flvars')
36 pdoc
= self
._download
_xml
(
37 'http://eplayer.clipsyndicate.com/osmf/playlist?%s' % flvars
,
38 video_id
, 'Downloading video info',
39 transform_source
=fix_xml_ampersands
)
41 track_doc
= pdoc
.find('trackList/track')
43 node
= find_xpath_attr(track_doc
, './/param', 'name', name
)
45 return node
.attrib
['value']
49 'title': find_param('title'),
50 'url': track_doc
.find('location').text
,
51 'thumbnail': find_param('thumbnail'),
52 'duration': int(find_param('duration')),