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',
|
'upload_date': '20230514',
|
||||||
'timestamp': 1684083791,
|
'timestamp': 1684083791,
|
||||||
},
|
},
|
||||||
|
|
||||||
}, {
|
}, {
|
||||||
# video clip
|
# video clip
|
||||||
'url': 'https://www3.nhk.or.jp/nhkworld/en/ondemand/video/9999011/',
|
'url': 'https://www3.nhk.or.jp/nhkworld/en/ondemand/video/9999011/',
|
||||||
|
@ -12,7 +12,7 @@ from ..utils import (
|
|||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
try_get,
|
try_get,
|
||||||
unescapeHTML,
|
unescapeHTML,
|
||||||
urljoin
|
urljoin,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -74,9 +74,10 @@ class PikselIE(InfoExtractor):
|
|||||||
if mobj:
|
if mobj:
|
||||||
return mobj.group('url')
|
return mobj.group('url')
|
||||||
|
|
||||||
def _call_api(self, app_token, resource, display_id, query, host="https://player.piksel.com", fatal=True):
|
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))
|
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) or {}).get('response')
|
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'])
|
failure = try_get(response, lambda x: x['failure']['reason'])
|
||||||
if failure:
|
if failure:
|
||||||
if fatal:
|
if fatal:
|
||||||
|
Loading…
Reference in New Issue
Block a user