mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-10-03 16:51:50 +00:00
@@ -4770,7 +4770,7 @@ def jwt_encode(payload_data, key, *, alg='HS256', headers=None):
|
||||
|
||||
# can be extended in future to verify the signature and parse header and return the algorithm used if it's not HS256
|
||||
def jwt_decode_hs256(jwt):
|
||||
header_b64, payload_b64, signature_b64 = jwt.split('.')
|
||||
_header_b64, payload_b64, _signature_b64 = jwt.split('.')
|
||||
# add trailing ='s that may have been stripped, superfluous ='s are ignored
|
||||
return json.loads(base64.urlsafe_b64decode(f'{payload_b64}==='))
|
||||
|
||||
|
Reference in New Issue
Block a user