Skip to content

Commit 76b5c30

Browse files
committed
Check that library item has an album before trying to get the album ID
1 parent 2ed818a commit 76b5c30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ytmusic_deleter/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def remove_library_items(library_items):
204204
if id:
205205
logging.debug(f"Removing album using id: {id}")
206206
response = yt_auth.rate_playlist(id, common.INDIFFERENT)
207-
elif item.get("feedbackTokens") and isinstance(item.get("feedbackTokens"), dict):
207+
elif item.get("feedbackTokens") and isinstance(item.get("feedbackTokens"), dict) and item.get("album"):
208208
logging.debug("This is a song, removing item by removing containing album.")
209209
album_browse_id = item["album"]["id"]
210210
audio_playlist_id = common.get_album_audio_playlist_id(album_browse_id)

0 commit comments

Comments
 (0)