From 80ce2e8a49c5def92ca94a4c5bbd33cd17a723b5 Mon Sep 17 00:00:00 2001 From: Marin Tsanov Date: Tue, 23 Aug 2022 02:41:59 +0300 Subject: [PATCH] Fix YouTube API connection failure Essentially, as described in googleapis/google-api-python-client#1109 and googleapis/google-api-python-client#876 - since version 2.0.0 google-api-python-client has included static documents for all Google Discovery APIs. To use them, you'd need to tell PyInstaller to include those static .json files in your build or use static_discovery=False which causes the library to dynamically download the API's discovery file from Google on build(). Otherwise, pyinstaller builds will fail. --- src/youspotube/api/youtube.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/youspotube/api/youtube.py b/src/youspotube/api/youtube.py index de7a5b5..a0b7f6a 100644 --- a/src/youspotube/api/youtube.py +++ b/src/youspotube/api/youtube.py @@ -11,7 +11,7 @@ def __init__(self, api_key): raise ConfigurationError("Test connection to YouTube API failed: %s" % str(e)) def _init_connection(self, api_key): - self.connection = build('youtube', 'v3', developerKey=api_key) + self.connection = build('youtube', 'v3', developerKey=api_key, static_discovery=False) def _test_connection(self): request = self.connection.channels().list(