[ie/Boosty] use urllib.parse.unquote directly

This commit is contained in:
rasmus 2024-05-06 22:18:39 +02:00
parent 2fae8c3363
commit 4304bac272
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import json import json
import urllib
from .common import InfoExtractor from .common import InfoExtractor
from .youtube import YoutubeIE from .youtube import YoutubeIE
@ -10,7 +11,6 @@ from ..utils import (
url_or_none, url_or_none,
) )
from ..utils.traversal import traverse_obj from ..utils.traversal import traverse_obj
from ..compat import compat_urllib_parse_unquote
class BoostyIE(InfoExtractor): class BoostyIE(InfoExtractor):
@ -170,7 +170,7 @@ class BoostyIE(InfoExtractor):
auth_headers = {} auth_headers = {}
if auth_cookie is not None: if auth_cookie is not None:
try: try:
auth_data = json.loads(compat_urllib_parse_unquote(auth_cookie.value)) auth_data = json.loads(urllib.parse.unquote(auth_cookie.value))
auth_headers['Authorization'] = f'Bearer {auth_data["accessToken"]}' auth_headers['Authorization'] = f'Bearer {auth_data["accessToken"]}'
except (json.JSONDecodeError, KeyError): except (json.JSONDecodeError, KeyError):
self.report_warning('Failed to extract token from auth cookie.') self.report_warning('Failed to extract token from auth cookie.')