sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
895 stars 67 forks source link

Spotify authentication doesn't work #74

Closed benthillerkus closed 11 months ago

benthillerkus commented 11 months ago

Hey, not sure if I'm configuring stuff correctly, but in the Spotify app, I've set the redirect URL to localhost:8080.

When I run spotify_to_ytmusic commands that require Spotify auth, the browser opens first a Spotify login page, and after signing in redirects to a page that says INVALID_CLIENT: Invalid redirect URI. That page has a URL that looks like this:

https://accounts.spotify.com/authorize?scope=user-library-read&response_type=code&flow_ctx={{a uuid}}%3A{{a unix timestamp}}&redirect_uri=http%3A%2F%2Flocalhost&client_id={{the client id}}

Pasting that URL back into spotify_to_ytmusic does not work:

Could not get Spotify playlist. Please check the playlist link.
 Error: SpotifyOauthError('error: invalid_request, error_description: code must be supplied')
Traceback (most recent call last):
  File "/opt/homebrew/bin/spotify_to_ytmusic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/spotify_to_ytmusic/main.py", line 86, in main
    args.func(args)
  File "/opt/homebrew/lib/python3.11/site-packages/spotify_to_ytmusic/controllers.py", line 71, in create
    _create_ytmusic(args, playlist, ytmusic)
  File "/opt/homebrew/lib/python3.11/site-packages/spotify_to_ytmusic/controllers.py", line 58, in _create_ytmusic
    name = args.name + date if args.name else playlist["name"] + date
                                              ~~~~~~~~^^^^^^^^
TypeError: 'NoneType' object is not subscriptable