[zdf] Fix extraction (closes #12117)
This commit is contained in:
parent
085f169ffe
commit
50de3dbad3
@ -20,9 +20,9 @@ from ..utils import (
|
|||||||
|
|
||||||
|
|
||||||
class ZDFBaseIE(InfoExtractor):
|
class ZDFBaseIE(InfoExtractor):
|
||||||
def _call_api(self, url, player, referrer, video_id):
|
def _call_api(self, url, player, referrer, video_id, item):
|
||||||
return self._download_json(
|
return self._download_json(
|
||||||
url, video_id, 'Downloading JSON content',
|
url, video_id, 'Downloading JSON %s' % item,
|
||||||
headers={
|
headers={
|
||||||
'Referer': referrer,
|
'Referer': referrer,
|
||||||
'Api-Auth': 'Bearer %s' % player['apiToken'],
|
'Api-Auth': 'Bearer %s' % player['apiToken'],
|
||||||
@ -104,7 +104,7 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
})
|
})
|
||||||
formats.append(f)
|
formats.append(f)
|
||||||
|
|
||||||
def _extract_entry(self, url, content, video_id):
|
def _extract_entry(self, url, player, content, video_id):
|
||||||
title = content.get('title') or content['teaserHeadline']
|
title = content.get('title') or content['teaserHeadline']
|
||||||
|
|
||||||
t = content['mainVideoContent']['http://zdf.de/rels/target']
|
t = content['mainVideoContent']['http://zdf.de/rels/target']
|
||||||
@ -116,7 +116,8 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
'http://zdf.de/rels/streams/ptmd-template'].replace(
|
'http://zdf.de/rels/streams/ptmd-template'].replace(
|
||||||
'{playerId}', 'portal')
|
'{playerId}', 'portal')
|
||||||
|
|
||||||
ptmd = self._download_json(urljoin(url, ptmd_path), video_id)
|
ptmd = self._call_api(
|
||||||
|
urljoin(url, ptmd_path), player, url, video_id, 'metadata')
|
||||||
|
|
||||||
formats = []
|
formats = []
|
||||||
track_uris = set()
|
track_uris = set()
|
||||||
@ -174,8 +175,9 @@ class ZDFIE(ZDFBaseIE):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _extract_regular(self, url, player, video_id):
|
def _extract_regular(self, url, player, video_id):
|
||||||
content = self._call_api(player['content'], player, url, video_id)
|
content = self._call_api(
|
||||||
return self._extract_entry(player['content'], content, video_id)
|
player['content'], player, url, video_id, 'content')
|
||||||
|
return self._extract_entry(player['content'], player, content, video_id)
|
||||||
|
|
||||||
def _extract_mobile(self, video_id):
|
def _extract_mobile(self, video_id):
|
||||||
document = self._download_json(
|
document = self._download_json(
|
||||||
|
Loading…
Reference in New Issue
Block a user