mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-07-05 21:08:33 +00:00
make jwt_is_expired
non-fatal
This commit is contained in:
parent
81c2fac721
commit
f6c24f54f3
@ -4764,7 +4764,8 @@ def jwt_decode_hs256(jwt):
|
||||
|
||||
|
||||
def jwt_is_expired(token, buffer=300, key='exp'):
|
||||
return jwt_decode_hs256(token)[key] - time.time() < buffer
|
||||
exp = traversal.traverse_obj(token, ({jwt_decode_hs256}, key, {int, float})) or 0
|
||||
return exp - time.time() < buffer
|
||||
|
||||
|
||||
WINDOWS_VT_MODE = False if os.name == 'nt' else None
|
||||
|
Loading…
Reference in New Issue
Block a user