Skip to content

Commit

Permalink
Fix playback not working when no API key is provided #1018
Browse files Browse the repository at this point in the history
  • Loading branch information
MoojMidge committed Dec 7, 2024
1 parent 29a9340 commit 92cf1c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 2 additions & 0 deletions resources/lib/youtube_plugin/youtube/client/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2225,6 +2225,8 @@ def api_request(self,
abort = False
params['key'] = key
else:
if not client['_has_auth']:
abort = True
del params['key']
client['params'] = params

Expand Down
15 changes: 8 additions & 7 deletions resources/lib/youtube_plugin/youtube/helper/resource_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,14 @@ def get_videos(self,
notify=notify_and_raise,
raise_exc=notify_and_raise)
for list_of_50 in self._list_batch(to_update, n=50)]
if not any(new_data):
if any(new_data):
new_data = {
yt_item['id']: yt_item
for batch in new_data
for yt_item in batch.get('items', [])
if yt_item
}
else:
new_data = None
else:
new_data = None
Expand All @@ -353,12 +360,6 @@ def get_videos(self,
'\n\tVideo IDs: {ids}'
.format(ids=to_update)
)
new_data = {
yt_item['id']: yt_item
for batch in new_data
for yt_item in batch.get('items', [])
if yt_item
}
new_data = dict(dict.fromkeys(to_update, {'_unavailable': True}),
**new_data)
result.update(new_data)
Expand Down

0 comments on commit 92cf1c3

Please sign in to comment.