3 import xml.etree.ElementTree
5 from .common import InfoExtractor
6 from ..utils import ExtractorError
9 class ClipfishIE(InfoExtractor):
12 _VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id>[0-9]+)/'
14 u'url': u'http://www.clipfish.de/special/game-trailer/video/3966754/fifa-14-e3-2013-trailer/',
15 u'file': u'3966754.mp4',
16 u'md5': u'2521cd644e862936cf2e698206e47385',
18 u'title': u'FIFA 14 - E3 2013 Trailer',
23 def _real_extract(self, url):
24 mobj = re.match(self._VALID_URL, url)
25 video_id = mobj.group(1)
27 info_url = ('http://www.clipfish.de/devxml/videoinfo/%s?ts=%d' %
28 (video_id, int(time.time())))
29 doc = self._download_xml(
30 info_url, video_id, note=u'Downloading info page')
31 title = doc.find('title').text
32 video_url = doc.find('filename').text
34 xml_bytes = xml.etree.ElementTree.tostring(doc)
35 raise ExtractorError(u'Cannot find video URL in document %r' %
37 thumbnail = doc.find('imageurl').text
38 duration_str = doc.find('duration').text
40 r'^(?P<hours>[0-9]+):(?P<minutes>[0-9]{2}):(?P<seconds>[0-9]{2}):(?P<ms>[0-9]*)$',
44 (int(m.group('hours')) * 60 * 60) +
45 (int(m.group('minutes')) * 60) +
46 (int(m.group('seconds')))
55 'thumbnail': thumbnail,