2 from __future__ import unicode_literals
4 from .common import InfoExtractor
11 class ClipfishIE(InfoExtractor):
12 _VALID_URL = r'https?://(?:www\.)?clipfish\.de/(?:[^/]+/)+video/(?P<id>[0-9]+)'
14 'url': 'http://www.clipfish.de/special/ugly-americans/video/4343170/s01-e01-ugly-americans-date-in-der-hoelle/',
15 'md5': '720563e467b86374c194bdead08d207d',
19 'title': 'S01 E01 - Ugly Americans - Date in der Hölle',
20 'description': 'Mark Lilly arbeitet im Sozialdienst der Stadt New York und soll Immigranten bei ihrer Einbürgerung in die USA zur Seite stehen.',
21 'upload_date': '20161005',
27 def _real_extract(self, url):
28 video_id = self._match_id(url)
30 video_info = self._download_json(
31 'http://www.clipfish.de/devapi/id/%s?format=json&apikey=hbbtv' % video_id,
36 m3u8_url = video_info.get('media_videourl_hls')
39 'url': m3u8_url.replace('de.hls.fra.clipfish.de', 'hls.fra.clipfish.de'),
44 mp4_url = video_info.get('media_videourl')
49 'width': int_or_none(video_info.get('width')),
50 'height': int_or_none(video_info.get('height')),
51 'tbr': int_or_none(video_info.get('bitrate')),
54 descr = video_info.get('descr')
60 'title': video_info['title'],
63 'thumbnail': video_info.get('media_content_thumbnail_large') or video_info.get('media_thumbnail'),
64 'duration': int_or_none(video_info.get('media_length')),
65 'upload_date': unified_strdate(video_info.get('pubDate')),
66 'view_count': int_or_none(video_info.get('media_views'))