1
0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-06-22 07:26:53 +02:00

[ie/Boosty] improve error handling during auth cookie parsing

This commit is contained in:
Rasmus Antons 2024-03-29 02:15:46 +01:00 committed by rasmus
parent 22acb01956
commit 3cf701bc59

View File

@ -171,7 +171,7 @@ def _real_extract(self, url):
if auth_cookie is not None:
try:
auth_data = json.loads(compat_urllib_parse_unquote(auth_cookie.value))
auth_headers['Authorization'] = f'Bearer {auth_data.get("accessToken")}'
auth_headers['Authorization'] = f'Bearer {auth_data["accessToken"]}'
except (json.JSONDecodeError, KeyError):
self.report_warning('Failed to extract token from auth cookie.')