mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-12-17 14:45:42 +07:00
[utils] Add improved jwt_encode function (#14071)
Also deprecates `jwt_encode_hs256` Authored by: bashonly
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
get_element_html_by_class,
|
||||
int_or_none,
|
||||
jwt_decode_hs256,
|
||||
jwt_encode_hs256,
|
||||
jwt_encode,
|
||||
make_archive_id,
|
||||
merge_dicts,
|
||||
parse_age_limit,
|
||||
@@ -98,9 +98,9 @@ def _call_api(self, video_id, client='null', id_token=None, version='v2'):
|
||||
'Content-Type': 'application/json',
|
||||
}, data=json.dumps({
|
||||
'identityToken': id_token or '',
|
||||
'playerInfo': jwt_encode_hs256(player_info, self._JWT_SIGNING_KEY, headers={
|
||||
'playerInfo': jwt_encode(player_info, self._JWT_SIGNING_KEY, headers={
|
||||
'kid': self._JWT_KEY_ID,
|
||||
}).decode(),
|
||||
}),
|
||||
}, separators=(',', ':')).encode())['vrtPlayerToken']
|
||||
|
||||
return self._download_json(
|
||||
|
||||
Reference in New Issue
Block a user