aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/utils.py
diff options
context:
space:
mode:
authorschnusch <schnusch@users.noreply.github.com>2022-10-10 22:31:01 +0200
committerGitHub <noreply@github.com>2022-10-11 02:01:01 +0530
commit2c98d998181c81ee49908be03c031204fd66d03d (patch)
tree8453d50b7169f4a66fcd28cac9eb9bf339604a41 /yt_dlp/utils.py
parent226c0f3a54faef19e2d2729d0072e7df43a7250b (diff)
downloadhypervideo-pre-2c98d998181c81ee49908be03c031204fd66d03d.tar.lz
hypervideo-pre-2c98d998181c81ee49908be03c031204fd66d03d.tar.xz
hypervideo-pre-2c98d998181c81ee49908be03c031204fd66d03d.zip
[extractors/podbayfm] Add extractor (#4971)
Authored by: schnusch
Diffstat (limited to 'yt_dlp/utils.py')
-rw-r--r--yt_dlp/utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 5a88a928d..c2327ae1d 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -5499,7 +5499,8 @@ def jwt_encode_hs256(payload_data, key, headers={}):
# 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('.')
- payload_data = json.loads(base64.urlsafe_b64decode(payload_b64))
+ # add trailing ='s that may have been stripped, superfluous ='s are ignored
+ payload_data = json.loads(base64.urlsafe_b64decode(f'{payload_b64}==='))
return payload_data