JohnnyCrazy / SpotifyAPI-NET

:sound: A Client for the Spotify Web API, written in C#/.NET
http://johnnycrazy.github.io/SpotifyAPI-NET/
MIT License
1.5k stars 305 forks source link

SpotifyLocalAPIClass times out when running local example project #13

Closed ellkay-joshe closed 9 years ago

ellkay-joshe commented 9 years ago

DownloadString during SpotifyLocalAPIClass.Connect passing "http://127.0.0.1:4380/simplecsrf/token.json?&ref=&cors=&_=1423252676" fails with a standard timeout exception

System.Net.WebException occurred HResult=-2146233079 Message=The operation has timed out Source=System StackTrace: at System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) at System.Net.WebClient.DownloadString(Uri address) at System.Net.WebClient.DownloadString(String address) at SpotifyAPI.SpotifyLocalAPI.RemoteHandler.query(String request, Boolean oauth, Boolean cfid, Int32 wait) in c:\Users\joshe\Dropbox\dev\SpotifyUtility\SpotifyAPI-NET\SpotifyAPI\SpoitfyLocalAPI\RemoteHandler.cs:line 143 InnerException:

Netstat says that port is open, and navigating to that url in my browser just gives me "not found"

image

Spotify web helper is def running

image

JohnnyCrazy commented 9 years ago

Hey,

Actually, I can't test it myself at the moment, since the SpotifyWebHelper is crashing everytime I want to make calls to it. (IDK why it happens yet)

The "Not found" message is expected, it pretty much says the WebHelper is running (else Chrome would display an error)

gusper commented 9 years ago

@JohnnyCrazy, based on your response I get the feeling you're seeing what I'm running into as well. I have a simple app using your library that primarily just waits for events whenever a track changes. However, it quickly starts to no longer get events as a result of SpotifyWebHelper no longer running (possibly crashing). I'm assuming this isn't something you've seen happen much previously?

JohnnyCrazy commented 9 years ago

@gusper I noticed that too, but I'm unable to find any reason why it would crash yet. (It's also occuring randomly)

@whereismyspaceship Could you try these Steps:

This worked for me, maybe you are not allowed to start the WebHelper manually

gusper commented 9 years ago

Did some searching and mostly came up empty. However, I did find that there's a beta desktop client available now and it uses a SpotifyBetaWebHelper.exe instead. If I get some time, I might test adding support for it as well to see if the issue around SpotifyWebHelper.exe disappearing has been fixed.

gusper commented 9 years ago

Just sent you a PR with support for it. Will now test whether or not the beta version of spotifybetawebhelper.exe is more stable.