1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2025-12-24 08:58:53 +00:00

use jwt_is_expired in NFL extractor

This commit is contained in:
Michaël De Boey
2025-03-17 00:01:48 +01:00
parent 711e3e0c45
commit baba0a95ed
2 changed files with 4 additions and 6 deletions

View File

@@ -4763,8 +4763,8 @@ 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
def jwt_is_expired(token, buffer=300, key='exp'):
return jwt_decode_hs256(token)[key] - time.time() < buffer
WINDOWS_VT_MODE = False if os.name == 'nt' else None