remove_playlist_items: remove invalid items from list (closes #88)

This commit is contained in:
sigma67 2020-10-28 20:24:08 +01:00
commit c93f66471c
No known key found for this signature in database
GPG key ID: 1545A01D4474BAF0

View file

@ -252,7 +252,8 @@ class PlaylistsMixin:
:return: Status String or full response
"""
self._check_auth()
if not videos[0]['setVideoId']:
videos = list(filter(lambda x: 'videoId' in x and 'setVideoId' in x, videos))
if len(videos) == 0:
raise Exception(
"Cannot remove songs, because setVideoId is missing. Do you own this playlist?")