[GH-ISSUE #88] 'remove_playlist_items()' does not work nor does it produce an error when 'videoId' and 'setVideoId' == None #69

Closed
opened 2026-02-27 22:07:51 +03:00 by kerem · 1 comment
Owner

Originally created by @dvdslv on GitHub (Oct 19, 2020).
Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/88

github.com/sigma67/ytmusicapi@bdbaada36a/ytmusicapi/mixins/playlists.py (L244)

My local solution is to add a continue to my iteration when removing tracks from a playlist where 'videoId' and 'setVideoId' == None.

Example:

if (tracks[x]['videoId'] == None) or (tracks[x]['setVideoId'] == None):
    continue

Here is a sample album with a couple of tracks that were removed.

https://music.youtube.com/playlist?list=OLAK5uy_m9fhpjoINvcfPzPibD7EMBXxpG_8txoGM

Originally created by @dvdslv on GitHub (Oct 19, 2020). Original GitHub issue: https://github.com/sigma67/ytmusicapi/issues/88 https://github.com/sigma67/ytmusicapi/blob/bdbaada36ab339024ed583e66d1071f3796dd3eb/ytmusicapi/mixins/playlists.py#L244 My local solution is to add a `continue` to my iteration when removing tracks from a playlist where 'videoId' and 'setVideoId' == None. Example: ``` if (tracks[x]['videoId'] == None) or (tracks[x]['setVideoId'] == None): continue ``` Here is a sample album with a couple of tracks that were removed. https://music.youtube.com/playlist?list=OLAK5uy_m9fhpjoINvcfPzPibD7EMBXxpG_8txoGM
kerem closed this issue 2026-02-27 22:07:51 +03:00
Author
Owner

@sigma67 commented on GitHub (Oct 19, 2020):

I'd say this is working as intended, but I think we can do better than that. My proposed solution would be to remove all items from the list which are missing either videoId or setVideoId, before sending the request. This would replace the following lines:

github.com/sigma67/ytmusicapi@bdbaada36a/ytmusicapi/mixins/playlists.py (L254-L256)

Would this fix your issue?

<!-- gh-comment-id:711926279 --> @sigma67 commented on GitHub (Oct 19, 2020): I'd say this is working as intended, but I think we can do better than that. My proposed solution would be to remove all items from the list which are missing either videoId or setVideoId, before sending the request. This would replace the following lines: https://github.com/sigma67/ytmusicapi/blob/bdbaada36ab339024ed583e66d1071f3796dd3eb/ytmusicapi/mixins/playlists.py#L254-L256 Would this fix your issue?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ytmusicapi#69
No description provided.