diff options
author | Pccode66 <49125134+Pccode66@users.noreply.github.com> | 2021-02-24 15:45:56 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-25 00:15:56 +0530 |
commit | 7a5c1cfe93924351387b44919b3c0b2f66c4b883 (patch) | |
tree | 6da63f3d7b16cf7d4b9fdb29b029125cab8bd0d3 /yt_dlp/extractor/phoenix.py | |
parent | c4218ac3f1146daac20308439cdc374e3561101a (diff) | |
download | hypervideo-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/phoenix.py')
-rw-r--r-- | yt_dlp/extractor/phoenix.py | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/yt_dlp/extractor/phoenix.py b/yt_dlp/extractor/phoenix.py new file mode 100644 index 000000000..8d52ad3b4 --- /dev/null +++ b/yt_dlp/extractor/phoenix.py @@ -0,0 +1,52 @@ +from __future__ import unicode_literals + +from .common import InfoExtractor +from ..utils import ExtractorError + + +class PhoenixIE(InfoExtractor): + IE_NAME = 'phoenix.de' + _VALID_URL = r'''https?://(?:www\.)?phoenix.de/\D+(?P<id>\d+)\.html''' + _TESTS = [ + { + 'url': 'https://www.phoenix.de/sendungen/dokumentationen/unsere-welt-in-zukunft---stadt-a-1283620.html', + 'md5': '5e765e838aa3531c745a4f5b249ee3e3', + 'info_dict': { + 'id': '0OB4HFc43Ns', + 'ext': 'mp4', + 'title': 'Unsere Welt in Zukunft - Stadt', + 'description': 'md5:9bfb6fd498814538f953b2dcad7ce044', + 'upload_date': '20190912', + 'uploader': 'phoenix', + 'uploader_id': 'phoenix', + } + }, + { + 'url': 'https://www.phoenix.de/drohnenangriffe-in-saudi-arabien-a-1286995.html?ref=aktuelles', + 'only_matching': True, + }, + # an older page: https://www.phoenix.de/sendungen/gespraeche/phoenix-persoenlich/im-dialog-a-177727.html + # seems to not have an embedded video, even though it's uploaded on youtube: https://www.youtube.com/watch?v=4GxnoUHvOkM + ] + + def extract_from_json_api(self, video_id, api_url): + doc = self._download_json( + api_url, video_id, + note="Downloading webpage metadata", + errnote="Failed to load webpage metadata") + + for a in doc["absaetze"]: + if a["typ"] == "video-youtube": + return { + '_type': 'url_transparent', + 'id': a["id"], + 'title': doc["titel"], + 'url': "https://www.youtube.com/watch?v=%s" % a["id"], + 'ie_key': 'Youtube', + } + raise ExtractorError("No downloadable video found", expected=True) + + def _real_extract(self, url): + page_id = self._match_id(url) + api_url = 'https://www.phoenix.de/response/id/%s' % page_id + return self.extract_from_json_api(page_id, api_url) |