★ wanayoo — archive 1999 https://github.com/JohnnyCrazy/SpotifyAPI-NET/issues/134Nouvelle recherche | Portail wanayoo
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

System.NullReferenceException @ GetStatus() #134

Closed
M4sterZer0 opened this issue Mar 9, 2017 · 18 comments
Closed

System.NullReferenceException @ GetStatus() #134

M4sterZer0 opened this issue Mar 9, 2017 · 18 comments

Comments

@M4sterZer0
Copy link

@M4sterZer0 M4sterZer0 commented Mar 9, 2017

Hi,
I get a System.NullReferenceException if I call the GetStatus() function.
IScreen

@jipjan
Copy link

@jipjan jipjan commented Mar 9, 2017

Do you make sure spotify is running and connected before requesting the status?

You can do this with if (Spotify.Connect()) { }

@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Mar 9, 2017

Mh, I can confirm something isn't working correctly ATM, it seems like spotify changed something with OAuth tokens, gonna need some time to find out what tho.

And btw, your status is null because it wasn't assigned yet, put a breakpoint after the GetStatus()

@M4sterZer0
Copy link
Author

@M4sterZer0 M4sterZer0 commented Mar 9, 2017

@jipjan Yes, I check it before I call the function.
Let's wait for a API fix. :)

@jipjan
Copy link

@jipjan jipjan commented Mar 9, 2017

But what is wrong with the OAuth? I'm using the API at this very moment and don't have any issues..

@M4sterZer0
Copy link
Author

@M4sterZer0 M4sterZer0 commented Mar 9, 2017

Do you have updated your Spotify (client)?

@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Mar 9, 2017 •

Can you guys please test the following endpoint: https://open.spotify.com/token
Do you receive a string with "faketoken" at the end? It seems it delivers fake tokens currently (at least for me)

@jipjan
Copy link

@jipjan jipjan commented Mar 9, 2017

Don't know, my version is 1.0.50.41368.gbd68dbef

@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Mar 9, 2017

And please test it within the API and with a browser. You can put a breakpoint in the RemoteHandler.cs constructor

@jipjan
Copy link

@jipjan jipjan commented Mar 9, 2017 •

nope, it's working, got: {"t":"NAowChgKB1Nwb3RpZnkSABoGmAEByAEBJfgbwlgSFM7t94j8ebJU4H0kGoaT_uEbk_O-"}

@M4sterZer0
Copy link
Author

@M4sterZer0 M4sterZer0 commented Mar 9, 2017

@jipjan I've the same version. hm.
@JohnnyCrazy No, I get this result:

{"t":"NAowChgKB1Nw*************xO5DUWTM7kG"}

@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Mar 9, 2017

Are those values gathered by the C# API client? Maybe just an issue on my side...

@jipjan
Copy link

@jipjan jipjan commented Mar 9, 2017

I'm using the compiled .dll in my project atm, so it's kinda hard for me to test this. As far as I can see everything is working fine in my solution.

@M4sterZer0
Copy link
Author

@M4sterZer0 M4sterZer0 commented Mar 9, 2017

So, I've created a new console application and installed this api with nuget.

Result:
Screenshot

@xcrow
Copy link

@xcrow xcrow commented Mar 9, 2017

Adding a "user-agent" Header in GetOAuthKey() method's WebClient worked for me.
Now it is returning token without the "faketoken" string attached at the end.

@henningms
Copy link

@henningms henningms commented Mar 9, 2017

Can confirm. Adding a User-Agent header in the GetOAuthKey will do the trick to get the local api working again.

henningms added a commit to henningms/SpotifyAPI-NET that referenced this issue Mar 9, 2017
@M4sterZer0 M4sterZer0 closed this Mar 9, 2017
JohnnyCrazy added a commit that referenced this issue Mar 9, 2017
#134 Adds User-Agent in the OAuth request due to recent changes in th…
@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Mar 9, 2017 •

Will be published as a Hotfix in 2.13.1 within the next hours

@ryandel13
Copy link

@ryandel13 ryandel13 commented Aug 7, 2018

Hello, Maybe this issue is open again.
From the endpoint "https://open.spotify.com/token" I only get a token with "faketoken" at the end. I already tried to update the User-Agent to "Spotify (1.0.86.337.ga8d5cef9)".

Any Ideas? Struggling with this issue since a couple of days...

@JohnnyCrazy
Copy link
Owner

@JohnnyCrazy JohnnyCrazy commented Aug 8, 2018

A simple search would help in a lot of times... #254

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

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.