1
0
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:
Michaël De Boey 2025-03-17 00:38:27 +01:00
parent 81c2fac721
commit f6c24f54f3
No known key found for this signature in database

View File

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