home
·
contact
·
privacy
projects
/
ytplom
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
dcc1025
)
Add fix for broken YouTube API.
master
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 23 Feb 2025 00:33:49 +0000
(
01:33
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 23 Feb 2025 00:33:49 +0000
(
01:33
+0100)
src/ytplom/misc.py
patch
|
blob
|
history
diff --git
a/src/ytplom/misc.py
b/src/ytplom/misc.py
index ae6b441fa2768f1d9b7df54d002e03f619f82665..0a94f96d654a0d195f70af52f619a599ea53b97a 100644
(file)
--- a/
src/ytplom/misc.py
+++ b/
src/ytplom/misc.py
@@
-226,6
+226,8
@@
class YoutubeQuery(DbData):
results: list[YoutubeVideo] = []
ids_to_detail: list[YoutubeId] = []
for item in search_request.execute()['items']:
results: list[YoutubeVideo] = []
ids_to_detail: list[YoutubeId] = []
for item in search_request.execute()['items']:
+ if 'videoId' not in item['id']: # for whatever reason, the API
+ continue # may return channels (no videoId)
video_id: YoutubeId = item['id']['videoId']
ids_to_detail += [video_id]
snippet = item['snippet']
video_id: YoutubeId = item['id']['videoId']
ids_to_detail += [video_id]
snippet = item['snippet']