abhishekmj303 / ytm2spt

Transfer Playlists from YouTube Music to Spotify
https://pypi.org/project/ytm2spt
GNU General Public License v3.0
130 stars 7 forks source link

KeyError when transferring playlist #10

Closed misterissac closed 4 months ago

misterissac commented 4 months ago

Hi there, I've just installed the software and am trying to transfer a playlist when I encountered this error:

(base) issaccheung@Issacs-MacBook-Air ytm2spt-main % python src/main.py -yt "PLZIy8xuFMWodrHViO7D3TqdCgOqDFegLP" INFO - Youtube Playlist ID: PLZIy8xuFMWodrHViO7D3TqdCgOqDFegLP INFO - Youtube Playlist Name: All Traceback (most recent call last): File "/Users/issaccheung/ytm2spt-main/src/main.py", line 149, in spotify_id = get_spotify_playlist_id(spotify_arg, spotify_playlist_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/issaccheung/ytm2spt-main/src/main.py", line 51, in get_spotify_playlist_id return sp.create_playlist(yt.get_playlist_title()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/issaccheung/ytm2spt-main/src/spotify.py", line 97, in create_playlist return playlist['id']


KeyError: 'id'

Any help is appreciated, thanks!
abhishekmj303 commented 4 months ago

In .env the SPOTIFY_USER_ID is not the email address. You will get the username here: https://www.spotify.com/in-en/account/profile/

Run this again after editing the file

source .env
misterissac commented 4 months ago

That fixed it, thanks a lot!!