[clipsyndicate] Modernize

pull/8/head
Philipp Hagemeister 11 years ago
parent 6c072e7d25
commit e9c076c317

@ -1,3 +1,5 @@
from __future__ import unicode_literals
import re import re
from .common import InfoExtractor from .common import InfoExtractor
@ -11,13 +13,14 @@ class ClipsyndicateIE(InfoExtractor):
_VALID_URL = r'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)' _VALID_URL = r'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)'
_TEST = { _TEST = {
u'url': u'http://www.clipsyndicate.com/video/play/4629301/brick_briscoe', 'url': 'http://www.clipsyndicate.com/video/play/4629301/brick_briscoe',
u'md5': u'4d7d549451bad625e0ff3d7bd56d776c', 'md5': '4d7d549451bad625e0ff3d7bd56d776c',
u'info_dict': { 'info_dict': {
u'id': u'4629301', 'id': '4629301',
u'ext': u'mp4', 'ext': 'mp4',
u'title': u'Brick Briscoe', 'title': 'Brick Briscoe',
u'duration': 612, 'duration': 612,
'thumbnail': 're:^https?://.+\.jpg',
}, },
} }
@ -26,13 +29,13 @@ class ClipsyndicateIE(InfoExtractor):
video_id = mobj.group('id') video_id = mobj.group('id')
js_player = self._download_webpage( js_player = self._download_webpage(
'http://eplayer.clipsyndicate.com/embed/player.js?va_id=%s' % video_id, 'http://eplayer.clipsyndicate.com/embed/player.js?va_id=%s' % video_id,
video_id, u'Downlaoding player') video_id, 'Downlaoding player')
# it includes a required token # it includes a required token
flvars = self._search_regex(r'flvars: "(.*?)"', js_player, u'flvars') flvars = self._search_regex(r'flvars: "(.*?)"', js_player, 'flvars')
pdoc = self._download_xml( pdoc = self._download_xml(
'http://eplayer.clipsyndicate.com/osmf/playlist?%s' % flvars, 'http://eplayer.clipsyndicate.com/osmf/playlist?%s' % flvars,
video_id, u'Downloading video info', video_id, 'Downloading video info',
transform_source=fix_xml_ampersands) transform_source=fix_xml_ampersands)
track_doc = pdoc.find('trackList/track') track_doc = pdoc.find('trackList/track')

Loading…
Cancel
Save