Skip to content

Commit

Permalink
Fix YouTube API connection failure
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mtsanovv committed Aug 22, 2022
1 parent 64ba137 commit 80ce2e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/youspotube/api/youtube.py
Expand Up @@ -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(
Expand Down

0 comments on commit 80ce2e8

Please sign in to comment.