diff --git a/youtube_dl/extractor/nhk.py b/youtube_dl/extractor/nhk.py index 8ebd1969f..9bff8eab5 100644 --- a/youtube_dl/extractor/nhk.py +++ b/youtube_dl/extractor/nhk.py @@ -39,7 +39,6 @@ class NhkVodIE(NhkBaseIE): 'upload_date': '20230514', 'timestamp': 1684083791, }, - }, { # video clip 'url': 'https://www3.nhk.or.jp/nhkworld/en/ondemand/video/9999011/', diff --git a/youtube_dl/extractor/piksel.py b/youtube_dl/extractor/piksel.py index aad4e7f7d..68611953f 100644 --- a/youtube_dl/extractor/piksel.py +++ b/youtube_dl/extractor/piksel.py @@ -12,7 +12,7 @@ from ..utils import ( parse_iso8601, try_get, unescapeHTML, - urljoin + urljoin, ) @@ -74,9 +74,10 @@ class PikselIE(InfoExtractor): if mobj: return mobj.group('url') - def _call_api(self, app_token, resource, display_id, query, host="https://player.piksel.com", fatal=True): - url = urljoin(base=host, path='/ws/ws_%s/api/%s/mode/json/apiv/5' % (resource, app_token)) - response = (self._download_json(url, display_id, query=query, fatal=fatal) or {}).get('response') + def _call_api(self, app_token, resource, display_id, query, host='https://player.piksel.com', fatal=True): + url = urljoin(host, '/ws/ws_%s/api/%s/mode/json/apiv/5' % (resource, app_token)) + response = self._download_json(url, display_id, query=query, fatal=fatal) + response = traverse_obj(response, 'response', expected_type=dict) or {} failure = try_get(response, lambda x: x['failure']['reason']) if failure: if fatal: