1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-06-02 10:29:28 +00:00

Apply suggestions from code review

Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
menschel 2023-05-26 17:13:18 +02:00 committed by GitHub
parent 2fa52b7cb1
commit 322e222ce3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -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/',

View file

@ -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: