From 5ed77393a045c3b4948321b92526b33a05543d87 Mon Sep 17 00:00:00 2001 From: MoojMidge <56883549+MoojMidge@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:12:37 +1000 Subject: [PATCH] Fix API requests failing if not logged in - Regression from c0c09d6 --- resources/lib/youtube_plugin/youtube/client/request_client.py | 4 ++-- resources/lib/youtube_plugin/youtube/client/youtube.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/lib/youtube_plugin/youtube/client/request_client.py b/resources/lib/youtube_plugin/youtube/client/request_client.py index 2279dc63d..bf1fb5159 100644 --- a/resources/lib/youtube_plugin/youtube/client/request_client.py +++ b/resources/lib/youtube_plugin/youtube/client/request_client.py @@ -264,7 +264,7 @@ class YouTubeRequestClient(BaseRequestsClass): 'Authorization': 'Bearer {_access_token}', }, 'params': { - 'key': None, + 'key': ValueError, 'prettyPrint': 'false' }, }, @@ -360,7 +360,7 @@ def build_client(cls, client_name=None, data=None): else: if 'Authorization' in client['headers']: del client['headers']['Authorization'] - if 'key' in params and not params['key']: + if 'key' in params and params['key'] is ValueError: del params['key'] except KeyError: pass diff --git a/resources/lib/youtube_plugin/youtube/client/youtube.py b/resources/lib/youtube_plugin/youtube/client/youtube.py index 176ecb6dc..8295d2a16 100644 --- a/resources/lib/youtube_plugin/youtube/client/youtube.py +++ b/resources/lib/youtube_plugin/youtube/client/youtube.py @@ -113,6 +113,7 @@ class YouTube(LoginClient): ' Chrome/80.0.3987.162 Mobile Safari/537.36'), }, 'params': { + 'key': None, 'prettyPrint': 'false' }, },