- video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
-
- # if fsk-button
- real_url = self._html_search_regex(r'\"fsk-button\".+?href=\"([^"]+)',
- webpage, 'fsk_button', default=None)
- if real_url:
- webpage = self._download_webpage(real_url, video_id)
-
- title = self._html_search_regex(
- r'<div id="bg_brandableContent">.+?<h1>(.+?)</h1>',
- webpage, 'title', flags=re.DOTALL)
-
- sd_url = self._html_search_regex(
- r'{\"url\":\"([^"]+?)\",\"hd\":false',
- webpage, 'sd_url').replace('\\', '')
-
- formats = [{'format_id': 'sd', 'url': sd_url, 'quality': -2}]
-
- hd_url = self._html_search_regex(
- r'{\"url\":\"([^"]+?)\",\"hd\":true',
- webpage, 'hd_url', default=None)
- if hd_url:
- hd_url = hd_url.replace('\\', '')
- formats.append({'format_id': 'hd', 'url': hd_url, 'quality': -1})
-
- return {
- 'id': video_id,
- 'title': title,
- 'formats': formats,
- 'ext': 'mp4'
- }
+ path = self._match_id(url)
+ content_path = self._download_json(
+ 'http://www.puls4.com/api/json-fe/page/' + path, path)['content'][0]['url']
+ media = self._download_json(
+ 'http://www.puls4.com' + content_path,
+ content_path)['mediaCurrent']
+ player_content = media['playerContent']
+ info = self._extract_video_info(url, player_content['id'])
+ info.update({
+ 'id': compat_str(media['objectId']),
+ 'title': player_content['title'],
+ 'description': media.get('description'),
+ 'thumbnail': media.get('previewLink'),
+ 'upload_date': unified_strdate(media.get('date')),
+ 'duration': parse_duration(player_content.get('duration')),
+ 'episode': player_content.get('episodePartName'),
+ 'show': media.get('channel'),
+ 'season_id': player_content.get('seasonId'),
+ 'uploader': player_content.get('sourceCompany'),
+ })
+ return info