'Problem with playlist_add_items in spotipy

Im having trouble with playlist_add_items on spotipy, im trying to add episodes to a new playlist

tt = ['https://open.spotify.com/episode/3nwfTNjbhDu8Cnp81TdmGO',
  'https://open.spotify.com/episode/3jZ5bleO9SCYZ0akgXhmpX']
sp.playlist_add_items(playlist_id=new_playlist_id_, items=tt)

I tryed with episode URLs, IDs and URIs and allways get this error:

Expected id of type track but found type episode https://open.spotify.com/episode/3nwfTNjbhDu8Cnp81TdmGO
Expected id of type track but found type episode https://open.spotify.com/episode/3jZ5bleO9SCYZ0akgXhmpX

And this is what the documentation say:

playlist_add_items(playlist_id, items, position=None)
Adds tracks/episodes to a playlist

Parameters:
playlist_id - the id of the playlist
items - a list of track/episode URIs, URLs or IDs
position - the position to add the tracks

I tryed with songs URLs and it works...



Solution 1:[1]

It worked with this code...

sp.playlist_add_items(playlist_id=playlist_id_new, items=['spotify:episode:3nwfTNjbhDu8Cnp81TdmGO'], position=None)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 VeirichR