From f6c24f54f3d5a2c969bf11b8e8cbebdb1a5d38a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Mon, 17 Mar 2025 00:38:27 +0100 Subject: [PATCH] make `jwt_is_expired` non-fatal --- yt_dlp/utils/_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yt_dlp/utils/_utils.py b/yt_dlp/utils/_utils.py index bc03389e07..04521651d1 100644 --- a/yt_dlp/utils/_utils.py +++ b/yt_dlp/utils/_utils.py @@ -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