]>
jfr.im git - yt-dlp.git/blob - youtube_dlc/extractor/phoenix.py
1 from __future__
import unicode_literals
3 from .common
import InfoExtractor
4 from ..utils
import ExtractorError
7 class PhoenixIE(InfoExtractor
):
9 _VALID_URL
= r
'''https?://(?:www\.)?phoenix.de/\D+(?P<id>\d+)\.html'''
12 'url': 'https://www.phoenix.de/sendungen/dokumentationen/unsere-welt-in-zukunft---stadt-a-1283620.html',
13 'md5': '5e765e838aa3531c745a4f5b249ee3e3',
17 'title': 'Unsere Welt in Zukunft - Stadt',
18 'description': 'md5:9bfb6fd498814538f953b2dcad7ce044',
19 'upload_date': '20190912',
20 'uploader': 'phoenix',
21 'uploader_id': 'phoenix',
25 'url': 'https://www.phoenix.de/drohnenangriffe-in-saudi-arabien-a-1286995.html?ref=aktuelles',
26 'only_matching': True,
28 # an older page: https://www.phoenix.de/sendungen/gespraeche/phoenix-persoenlich/im-dialog-a-177727.html
29 # seems to not have an embedded video, even though it's uploaded on youtube: https://www.youtube.com/watch?v=4GxnoUHvOkM
32 def extract_from_json_api(self
, video_id
, api_url
):
33 doc
= self
._download
_json
(
35 note
="Downloading webpage metadata",
36 errnote
="Failed to load webpage metadata")
38 for a
in doc
["absaetze"]:
39 if a
["typ"] == "video-youtube":
41 '_type': 'url_transparent',
43 'title': doc
["titel"],
44 'url': "https://www.youtube.com/watch?v=%s" % a
["id"],
47 raise ExtractorError("No downloadable video found", expected
=True)
49 def _real_extract(self
, url
):
50 page_id
= self
._match
_id
(url
)
51 api_url
= 'https://www.phoenix.de/response/id/%s' % page_id
52 return self
.extract_from_json_api(page_id
, api_url
)