spotify_to_ytmusic
spotify_to_ytmusic copied to clipboard
Exception: Server returned HTTP 400: Bad Request.
Hello, people. This happens to me when I'm moving a playlist from Spotify to Youtube Music. Is there any solution?
Traceback (most recent call last):
File "
It's probably a problem with the way you set up your credentials. Which setup method did you use? Can you check your settings.ini file?
It's probably a problem with the way you set up your credentials. Which setup method did you use? Can you check your settings.ini file?
Use the method as instructed in the Github First I made the Spotify dashboard. The redirect link is the one from http://localhost. And then I did the authorization by Google OAuth. Although I don't know if that is created automatically or where it is created?
If you did everything correctly it should probably work. To troubleshoot you need to manually inspect the settings.ini file, which is created automatically.
It should be in platformdirs.user_cache_dir
/spotify_to_ytmusic, depends on your platform where that is
I am having the same issue as djlivooo To be fair the playlist has 1002 tracks in it, another playlist transfered fine before I tried the large playlist I tried to transfer the larger one a second time and it worked.
Anyway I tried to find the settings.ini file you mentioned, I could find the example ini file but not the ehm "real" one?
I use scoop to install applications and used it to install python so it seems it saves installed python packages in its folder structure.
C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\spotify_to_ytmusic
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\Clovis\scoop\apps\python\current\Scripts\spotify_to_ytmusic.exe\__main__.py", line 7, in <module>
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\spotify_to_ytmusic\main.py", line 86, in main
args.func(args)
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\spotify_to_ytmusic\controllers.py", line 71, in create
_create_ytmusic(args, playlist, ytmusic)
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\spotify_to_ytmusic\controllers.py", line 60, in _create_ytmusic
videoIds = ytmusic.search_songs(playlist["tracks"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\spotify_to_ytmusic\ytmusic.py", line 32, in search_songs
result = self.api.search(query)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\ytmusicapi\mixins\search.py", line 165, in search
response = self._send_request(endpoint, body)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\site-packages\ytmusicapi\ytmusic.py", line 151, in _send_request
response_text = json.loads(response.text)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\json\__init__.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Clovis\scoop\apps\python\current\Lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
@Lod3 the settings file should be in %APPDATA%/spotify_to_ytmusic
I'm consistently seeing this with trying to import https://open.spotify.com/playlist/3YgiYNSYXeKWPkcVKZY4xc - it is a rather large playlist with thousands of entries, so that seems to match with the original report. I've successfully imported a far smaller one, so I believe my config should be right. I've not yet had the time to investigate further than this, but I thought I'd provide what is (to me) a consistent reproduction of these symptoms.
Maybe the issue is that too many videos are being passed to create_playlist
.
YouTube's playlist limit is at 5000: https://webapps.stackexchange.com/questions/77790/what-is-the-maximum-youtube-playlist-length
so it is in fact impossible to transfer this playlist. Could implement an exception for this case
Ah, I was wondering if there was some kind of API limit, I hadn't considered that there would just be a playlist size limit, thanks