]>
Commit | Line | Data |
---|---|---|
9d54b02b | 1 | from .prosiebensat1 import ProSiebenSat1BaseIE |
14f25df2 | 2 | from ..utils import parse_duration, unified_strdate |
7862ad88 H |
3 | |
4 | ||
9d54b02b | 5 | class Puls4IE(ProSiebenSat1BaseIE): |
74394b5e | 6 | _VALID_URL = r'https?://(?:www\.)?puls4\.com/(?P<id>[^?#&]+)' |
7862ad88 | 7 | _TESTS = [{ |
9d54b02b RA |
8 | 'url': 'http://www.puls4.com/2-minuten-2-millionen/staffel-3/videos/2min2miotalk/Tobias-Homberger-von-myclubs-im-2min2miotalk-118118', |
9 | 'md5': 'fd3c6b0903ac72c9d004f04bc6bb3e03', | |
7862ad88 | 10 | 'info_dict': { |
9d54b02b RA |
11 | 'id': '118118', |
12 | 'ext': 'flv', | |
13 | 'title': 'Tobias Homberger von myclubs im #2min2miotalk', | |
14 | 'description': 'md5:f9def7c5e8745d6026d8885487d91955', | |
15 | 'upload_date': '20160830', | |
6c87c2ee S |
16 | 'uploader': 'PULS_4', |
17 | }, | |
74394b5e S |
18 | }, { |
19 | 'url': 'http://www.puls4.com/pro-und-contra/wer-wird-prasident/Ganze-Folgen/Wer-wird-Praesident.-Norbert-Hofer', | |
20 | 'only_matching': True, | |
21 | }, { | |
22 | 'url': 'http://www.puls4.com/pro-und-contra/wer-wird-prasident/Ganze-Folgen/Wer-wird-Praesident-Analyse-des-Interviews-mit-Norbert-Hofer-416598', | |
23 | 'only_matching': True, | |
6c87c2ee | 24 | }] |
9d54b02b RA |
25 | _TOKEN = 'puls4' |
26 | _SALT = '01!kaNgaiNgah1Ie4AeSha' | |
27 | _CLIENT_NAME = '' | |
7862ad88 H |
28 | |
29 | def _real_extract(self, url): | |
9d54b02b RA |
30 | path = self._match_id(url) |
31 | content_path = self._download_json( | |
32 | 'http://www.puls4.com/api/json-fe/page/' + path, path)['content'][0]['url'] | |
33 | media = self._download_json( | |
34 | 'http://www.puls4.com' + content_path, | |
35 | content_path)['mediaCurrent'] | |
36 | player_content = media['playerContent'] | |
37 | info = self._extract_video_info(url, player_content['id']) | |
38 | info.update({ | |
add96eb9 | 39 | 'id': str(media['objectId']), |
9d54b02b RA |
40 | 'title': player_content['title'], |
41 | 'description': media.get('description'), | |
42 | 'thumbnail': media.get('previewLink'), | |
43 | 'upload_date': unified_strdate(media.get('date')), | |
44 | 'duration': parse_duration(player_content.get('duration')), | |
45 | 'episode': player_content.get('episodePartName'), | |
46 | 'show': media.get('channel'), | |
47 | 'season_id': player_content.get('seasonId'), | |
48 | 'uploader': player_content.get('sourceCompany'), | |
49 | }) | |
50 | return info |