From: Christian Heller Date: Sun, 23 Feb 2025 00:33:49 +0000 (+0100) Subject: Add fix for broken YouTube API. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/static/te"st.html?a=commitdiff_plain;h=HEAD;p=ytplom Add fix for broken YouTube API. --- diff --git a/src/ytplom/misc.py b/src/ytplom/misc.py index ae6b441..0a94f96 100644 --- 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']: + 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']