mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-01-30 22:59:48 +00:00
Apply suggestions from code review
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
2fa52b7cb1
commit
322e222ce3
@ -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/',
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user