sigma67 / spotify_to_ytmusic

Clone a Spotify playlist to YouTube Music
MIT License
954 stars 72 forks source link

Server returned HTTP 400: Bad request. Request contains an invalid argument. #118

Closed nikinators closed 1 week ago

nikinators commented 1 week ago

Hello! I was trying to clone all my public playlist to spotify, but got this error when running "spotify_to_ytmusic all < spotifyuserid >."

Playlist 7: .
Getting Spotify tracks...
Spotify tracks: 100/136
Spotify tracks: 136/136
Searching YouTube...
Could not transfer playlist .. Server returned HTTP 400: Bad Request.
Request contains an invalid argument.

also cloning single playlists dont seem to work, running "spotify_to_ytmusic create < link >" returns :

Getting Spotify tracks...
Spotify tracks: 100/131
Spotify tracks: 131/131
Searching YouTube...
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "S:\pythomn\Scripts\spotify_to_ytmusic.exe\__main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "S:\pythomn\Lib\site-packages\spotify_to_ytmusic\main.py", line 98, in main
    args.func(args)
    ~~~~~~~~~^^^^^^
  File "S:\pythomn\Lib\site-packages\spotify_to_ytmusic\controllers.py", line 77, in create
    _create_ytmusic(args, playlist, ytmusic)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "S:\pythomn\Lib\site-packages\spotify_to_ytmusic\controllers.py", line 63, in _create_ytmusic
    videoIds = ytmusic.search_songs(playlist["tracks"])
  File "S:\pythomn\Lib\site-packages\spotify_to_ytmusic\ytmusic.py", line 35, in search_songs
    result = self.api.search(query)
  File "S:\pythomn\Lib\site-packages\ytmusicapi\mixins\search.py", line 183, in search
    response = self._send_request(endpoint, body)
  File "S:\pythomn\Lib\site-packages\ytmusicapi\ytmusic.py", line 241, in _send_request
    raise YTMusicServerError(message + error)
ytmusicapi.exceptions.YTMusicServerError: Server returned HTTP 400: Bad Request.
Request contains an invalid argument.

Any fixes?

simonsazian commented 1 week ago

I'm having the same issue only for Spotify created playlists (Spotify Wrapped - Your Top Songs YYYY). Otherwise this worked for me just fine a few months ago.

sigma67 commented 1 week ago

see https://github.com/sigma67/spotify_to_ytmusic/pull/117