mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-06-23 19:24:39 +00:00
Apply suggestions from code review
Co-authored-by: sepro <sepro@sepr0.com>
This commit is contained in:
parent
8c2d740997
commit
2d285b543e
@ -206,7 +206,7 @@ class WeverseBaseIE(InfoExtractor):
|
|||||||
'platform': self._CLIENT_PLATFORM,
|
'platform': self._CLIENT_PLATFORM,
|
||||||
'wpf': 'pc',
|
'wpf': 'pc',
|
||||||
})
|
})
|
||||||
for retry in (False, True):
|
for is_retry in (False, True):
|
||||||
wmsgpad = int(time.time() * 1000)
|
wmsgpad = int(time.time() * 1000)
|
||||||
wmd = base64.b64encode(hmac.HMAC(
|
wmd = base64.b64encode(hmac.HMAC(
|
||||||
self._SIGNING_KEY, f'{api_path[:255]}{wmsgpad}'.encode(),
|
self._SIGNING_KEY, f'{api_path[:255]}{wmsgpad}'.encode(),
|
||||||
@ -225,7 +225,7 @@ class WeverseBaseIE(InfoExtractor):
|
|||||||
'wmd': wmd,
|
'wmd': wmd,
|
||||||
})
|
})
|
||||||
except ExtractorError as e:
|
except ExtractorError as e:
|
||||||
if retry or not isinstance(e.cause, HTTPError):
|
if is_retry or not isinstance(e.cause, HTTPError):
|
||||||
raise
|
raise
|
||||||
elif self._is_logged_in and e.cause.status == 401:
|
elif self._is_logged_in and e.cause.status == 401:
|
||||||
self._refresh_access_token()
|
self._refresh_access_token()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user