aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/puls4.py
diff options
context:
space:
mode:
authorPccode66 <49125134+Pccode66@users.noreply.github.com>2021-02-24 15:45:56 -0300
committerGitHub <noreply@github.com>2021-02-25 00:15:56 +0530
commit7a5c1cfe93924351387b44919b3c0b2f66c4b883 (patch)
tree6da63f3d7b16cf7d4b9fdb29b029125cab8bd0d3 /yt_dlp/extractor/puls4.py
parentc4218ac3f1146daac20308439cdc374e3561101a (diff)
downloadhypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.tar.lz
hypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.tar.xz
hypervideo-pre-7a5c1cfe93924351387b44919b3c0b2f66c4b883.zip
Completely change project name to yt-dlp (#85)
* All modules and binary names are changed * All documentation references changed * yt-dlp no longer loads youtube-dlc config files * All URLs changed to point to organization account Co-authored-by: Pccode66 Co-authored-by: pukkandan
Diffstat (limited to 'yt_dlp/extractor/puls4.py')
-rw-r--r--yt_dlp/extractor/puls4.py57
1 files changed, 57 insertions, 0 deletions
diff --git a/yt_dlp/extractor/puls4.py b/yt_dlp/extractor/puls4.py
new file mode 100644
index 000000000..80091b85f
--- /dev/null
+++ b/yt_dlp/extractor/puls4.py
@@ -0,0 +1,57 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .prosiebensat1 import ProSiebenSat1BaseIE
+from ..utils import (
+ unified_strdate,
+ parse_duration,
+ compat_str,
+)
+
+
+class Puls4IE(ProSiebenSat1BaseIE):
+ _VALID_URL = r'https?://(?:www\.)?puls4\.com/(?P<id>[^?#&]+)'
+ _TESTS = [{
+ 'url': 'http://www.puls4.com/2-minuten-2-millionen/staffel-3/videos/2min2miotalk/Tobias-Homberger-von-myclubs-im-2min2miotalk-118118',
+ 'md5': 'fd3c6b0903ac72c9d004f04bc6bb3e03',
+ 'info_dict': {
+ 'id': '118118',
+ 'ext': 'flv',
+ 'title': 'Tobias Homberger von myclubs im #2min2miotalk',
+ 'description': 'md5:f9def7c5e8745d6026d8885487d91955',
+ 'upload_date': '20160830',
+ 'uploader': 'PULS_4',
+ },
+ }, {
+ 'url': 'http://www.puls4.com/pro-und-contra/wer-wird-prasident/Ganze-Folgen/Wer-wird-Praesident.-Norbert-Hofer',
+ 'only_matching': True,
+ }, {
+ 'url': 'http://www.puls4.com/pro-und-contra/wer-wird-prasident/Ganze-Folgen/Wer-wird-Praesident-Analyse-des-Interviews-mit-Norbert-Hofer-416598',
+ 'only_matching': True,
+ }]
+ _TOKEN = 'puls4'
+ _SALT = '01!kaNgaiNgah1Ie4AeSha'
+ _CLIENT_NAME = ''
+
+ def _real_extract(self, url):
+ 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