Compare commits

..

No commits in common. "5c799fb394402d902e13c19dc3ad4faeef847263" and "a3473edb7fcf65799899e0c13c867ca30a01ea2d" have entirely different histories.

View File

@ -6,12 +6,13 @@ from ..utils import (
js_to_json, js_to_json,
url_or_none, url_or_none,
) )
from ..utils.traversal import traverse_obj from ..utils.traversal import traverse_obj
class NTVDeIE(InfoExtractor): class NTVDeIE(InfoExtractor):
IE_NAME = 'n-tv.de' IE_NAME = 'n-tv.de'
_VALID_URL = r'https?://(?:www\.)?n-tv\.de/mediathek/(?:videos|magazine)/[^/?#]+/[^/?#]+-article(?P<id>[^/?#]+)\.html' _VALID_URL = r'https?://(?:www\.)?n-tv\.de/mediathek/videos/[^/?#]+/[^/?#]+-article(?P<id>.+)\.html'
_TESTS = [{ _TESTS = [{
'url': 'http://www.n-tv.de/mediathek/videos/panorama/Schnee-und-Glaette-fuehren-zu-zahlreichen-Unfaellen-und-Staus-article14438086.html', 'url': 'http://www.n-tv.de/mediathek/videos/panorama/Schnee-und-Glaette-fuehren-zu-zahlreichen-Unfaellen-und-Staus-article14438086.html',
@ -27,20 +28,6 @@ class NTVDeIE(InfoExtractor):
'timestamp': 1422892797, 'timestamp': 1422892797,
'upload_date': '20150202', 'upload_date': '20150202',
}, },
}, {
'url': 'https://www.n-tv.de/mediathek/magazine/auslandsreport/Juedische-Siedler-wollten-Rache-die-wollten-nur-toeten-article24523089.html',
'md5': 'c5c6014c014ccc3359470e1d34472bfd',
'info_dict': {
'id': '24523089',
'ext': 'mp4',
'thumbnail': r're:^https?://.*\.jpg$',
'title': 'Jüdische Siedler "wollten Rache, die wollten nur töten"',
'alt_title': 'Israelische Gewalt fern von Gaza',
'description': 'Vier Tage nach dem Massaker der Hamas greifen jüdische Siedler das Haus einer palästinensischen Familie im Westjordanland an. Die Überlebenden berichten, sie waren unbewaffnet, die Angreifer seien nur auf "Rache und Töten" aus gewesen. Als die Toten beerdigt werden sollen, eröffnen die Siedler erneut das Feuer.',
'duration': 326,
'timestamp': 1699688294,
'upload_date': '20231111',
},
}] }]
def _real_extract(self, url): def _real_extract(self, url):
@ -48,24 +35,25 @@ class NTVDeIE(InfoExtractor):
webpage = self._download_webpage(url, video_id) webpage = self._download_webpage(url, video_id)
info = self._search_json( info = self._search_json(
r'article:', webpage, 'info', video_id, transform_source=js_to_json) r'article:\s*', webpage, 'info', video_id, transform_source=js_to_json)
vdata = self._search_json( player_data = self._search_json(
r'\$\(\s*"#playerwrapper"\s*\)\s*\.data\(\s*"player",', r'\$\(\s*"#playerwrapper"\s*\)\s*\.data\(\s*"player",\s*',
webpage, 'player data', video_id, webpage, 'player data', video_id,
transform_source=lambda s: js_to_json(re.sub(r'ivw:[^},]+', '', s)))['setup']['source'] transform_source=lambda s: js_to_json(re.sub(r'ivw:[^},]+', '', s)))
vdata = traverse_obj(player_data, ('setup', 'source')) or {}
formats = [] formats = []
if vdata.get('progressive'): if vdata.get('progressive'):
formats.append({ formats.append({
'format_id': 'http', 'format_id': 'mp4-0',
'url': vdata['progressive'], 'url': vdata['progressive'],
}) })
if vdata.get('hls'): if vdata.get('hls'):
formats.extend(self._extract_m3u8_formats( formats.extend(self._extract_m3u8_formats(
vdata['hls'], video_id, 'mp4', m3u8_id='hls', fatal=False)) vdata['hls'], video_id, 'mp4', m3u8_id='hls', fatal=False))
if vdata.get('dash'): if vdata.get('dash'):
formats.extend(self._extract_mpd_formats(vdata['dash'], video_id, fatal=False, mpd_id='dash')) formats.extend(self._extract_mpd_formats(vdata['dash'], video_id, fatal=False))
return { return {
'id': video_id, 'id': video_id,