You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using spotify_to_ytmusic i ran into the issue that querying YT for some songs returned error 403 where the response could not be parsed by json.load() due to response.text being None.
This throws a JSONDecodeError which in turn bubbles up and cancels the whole process.
Using the --use-cached I was atleast able to search for the following songs until the next one returns a 403.
I was not able to use the oauth for YT but using the browser method worked.
I did not yet spend time to analyze why YT returns a 403 there but on retry the exception did not occur at that song again.
The issue is that when every 10th or 20th song fails and cancels the script it's becoming quite annoying to retry it every single time again.
With ~2600 songs and a failure every 15th song that would be 173 restarts...
Also it was not able to create the playlist in the end. Which was quite frustrating after that whole ordeal when checking with even fewer songs.
By adding a simple retry I was able to get the failing song on second try, or for whatever reason if it failed again, then atleast on the third one like this:
try:
response_text: JsonDict = json.loads(response.text)
except json.JSONDecodeError:
print("JSON parsing failed for song \"" + body["query"] + "\". Probably a 403 or other garbage response. Retrying.")
return self._send_request(endpoint, body, additionalParams)
This would need further error handling since catching every JSONDecodeError is suboptimal but I wouldn't even be able to get a playlist with more than 50 songs without running the script a few times.
Any specific reasons why that's not been done or does anyone have ideas why this happens to me?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Using spotify_to_ytmusic i ran into the issue that querying YT for some songs returned error 403 where the response could not be parsed by json.load() due to response.text being None.
This throws a JSONDecodeError which in turn bubbles up and cancels the whole process.
Using the --use-cached I was atleast able to search for the following songs until the next one returns a 403.
I was not able to use the oauth for YT but using the browser method worked.
I did not yet spend time to analyze why YT returns a 403 there but on retry the exception did not occur at that song again.
The issue is that when every 10th or 20th song fails and cancels the script it's becoming quite annoying to retry it every single time again.
With ~2600 songs and a failure every 15th song that would be 173 restarts...
Also it was not able to create the playlist in the end. Which was quite frustrating after that whole ordeal when checking with even fewer songs.
By adding a simple retry I was able to get the failing song on second try, or for whatever reason if it failed again, then atleast on the third one like this:
instead of here
ytmusicapi/ytmusicapi/ytmusic.py
Lines 237 to 241 in 1a9fc4f
This would need further error handling since catching every JSONDecodeError is suboptimal but I wouldn't even be able to get a playlist with more than 50 songs without running the script a few times.
Any specific reasons why that's not been done or does anyone have ideas why this happens to me?
All reactions