1 from __future__ import unicode_literals
5 from .common import InfoExtractor
12 class ClipsyndicateIE(InfoExtractor):
13 _VALID_URL = r'http://(?:chic|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',
26 'url': 'http://chic.clipsyndicate.com/video/play/5844117/shark_attack',
27 'only_matching': True,
30 def _real_extract(self, url):
31 mobj = re.match(self._VALID_URL, url)
32 video_id = mobj.group('id')
33 js_player = self._download_webpage(
34 'http://eplayer.clipsyndicate.com/embed/player.js?va_id=%s' % video_id,
35 video_id, 'Downlaoding player')
36 # it includes a required token
37 flvars = self._search_regex(r'flvars: "(.*?)"', js_player, 'flvars')
39 pdoc = self._download_xml(
40 'http://eplayer.clipsyndicate.com/osmf/playlist?%s' % flvars,
41 video_id, 'Downloading video info',
42 transform_source=fix_xml_ampersands)
44 track_doc = pdoc.find('trackList/track')
47 node = find_xpath_attr(track_doc, './/param', 'name', name)
49 return node.attrib['value']
53 'title': find_param('title'),
54 'url': track_doc.find('location').text,
55 'thumbnail': find_param('thumbnail'),
56 'duration': int(find_param('duration')),