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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user