Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximum spotify api requets #5

Open
marianolatorre opened this issue Jul 11, 2015 · 4 comments
Open

maximum spotify api requets #5

marianolatorre opened this issue Jul 11, 2015 · 4 comments

Comments

@marianolatorre
Copy link

Hi there, congrats for this tool. its really useful, specially when you want to try all the new streaming services out there.

do you know how many api requets is spotify supporting at the moment? I was able to run it half of my playlist, 4K songs. I was also wondering if the cache you implemented is to avoid requesting again for the already processed tracks? in this case, maybe I can try resuming it tomorrow? oh yeh...do you know after how long its a good time to try again?

cheers!

@marianolatorre
Copy link
Author

ok I found the problem, it's to do with the fact that some spotify URLs are pointing to local songs.

/lookup/1/.json?uri=https://open.spotify.com/local/David%20Sylvian%2FRobert%20Fripp/The%20First%20Day/God%27S%20Monkey/297                  |
#<Net::HTTP::Get:0x007f9a2d013ca8>
#<Net::HTTPBadRequest:0x007f9a2d011a70>
A JSON text must at least contain two octets!
marianos-MacBook-Pro:spotify-export marianolatorre$ grep local amazingsongs.txt 
https://open.spotify.com/local/David%20Sylvian%2FRobert%20Fripp/The%20First%20Day/God%27S%20Monkey/297

A possible soultion could be to do the requets and the parsing in different rescue so that when parsing the json fails, we don't keep trying to request after 5 seconds. Another way could be to avoid url containing this "open.spotify.com/local"

@jlund
Copy link
Owner

jlund commented Jul 12, 2015

At one point this was working for mixed playlists that contained both standard and local songs, but the playlist format for that may have changed. I'll check it out when I get back to a computer.

Thanks for the feedback!

@jlund
Copy link
Owner

jlund commented Jul 12, 2015

I have never run it on a playlist that large or hit an API limit, so I'm not sure how long they take to timeout. The cache will have saved all of the already processed tracks though, so resuming it should be fast :)

@jlund
Copy link
Owner

jlund commented Sep 30, 2016

Just looked at this again, and I can't reproduce it. It's a longshot given how much time has passed, but do you have an example of a recent playlist that still exhibits this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants