1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2026-03-03 12:49:37 +00:00

move _jwt_is_expired to utils

This commit is contained in:
Michaël De Boey
2025-03-16 23:37:39 +01:00
parent 98a68be9b8
commit 1b1117a9c5
12 changed files with 32 additions and 22 deletions

View File

@@ -4763,6 +4763,10 @@ def jwt_decode_hs256(jwt):
return json.loads(base64.urlsafe_b64decode(f'{payload_b64}==='))
def jwt_is_expired(token, buffer=300):
return jwt_decode_hs256(token)['exp'] - time.time() < buffer
WINDOWS_VT_MODE = False if os.name == 'nt' else None