1 from __future__ import unicode_literals
3 from .common import InfoExtractor
12 class ClipfishIE(InfoExtractor):
15 _VALID_URL = r'^https?://(?:www\.)?clipfish\.de/.*?/video/(?P<id>[0-9]+)/'
17 'url': 'http://www.clipfish.de/special/game-trailer/video/3966754/fifa-14-e3-2013-trailer/',
18 'md5': '79bc922f3e8a9097b3d68a93780fd475',
22 'title': 'FIFA 14 - E3 2013 Trailer',
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
29 webpage = self._download_webpage(url, video_id)
30 video_info = self._parse_json(
31 js_to_json(self._html_search_regex('var videoObject = ({[^}]+?})', webpage, 'videoObject')),
34 info_url = self._parse_json(
35 js_to_json(self._html_search_regex('var globalFlashvars = ({[^}]+?})', webpage, 'globalFlashvars')),
39 doc = self._download_xml(
40 info_url, video_id, note='Downloading info page')
41 title = doc.find('title').text
42 video_url = doc.find('filename').text
43 thumbnail = doc.find('imageurl').text
44 duration = int_or_none(video_info['length'])
45 formats = [{'url': video_info['videourl']},{'url': video_url}]
46 self._sort_formats(formats)
52 'thumbnail': thumbnail,