music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.37k stars 52 forks source link

Soundcloud doesn't work -'Attempt to decode JSON with unexpected mimetype' #2301

Closed swiftbird07 closed 5 months ago

swiftbird07 commented 6 months ago

What version of Music Assistant has the issue?

2.0.4 (Docker)

What version of the Home Assistant Integration have you got installed?

2024.5.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

I am unable to connect Soundcloud:

I will just print the error: 0, message='Attempt to decode JSON with unexpected mimetype: ', url=URL('https://api-v2.soundcloud.com/me')

How to reproduce

1) Follow instructions at https://music-assistant.io/music-providers/soundcloud/ 2) Get error

Music Providers

Soundcloud

Player Providers

None

Full log output

log.txt

Additional information

Screenshot: Screenshot 2024-05-15 at 12 51 18

I am using the docker install method as I don't have HAOS.

What version of Home Assistant Core are your running

2024.4.4

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

Linux

OzGav commented 5 months ago

@gieljnssns

OzGav commented 5 months ago

@swiftbird07 have you tried a different browser to setup the provider?

danielkleinert commented 5 months ago

I have the same issue in regardless of the browser I am using.

The-Erf commented 5 months ago

I have the same problem on all 3 versions of stable - beta - dev, on homeassistant, on other music providers, there is no problem.

OzGav commented 5 months ago

@swiftbird07 @danielkleinert @The-Erf Can you of you confirm this has been fixed?

OzGav commented 5 months ago

Closing assumed fixed

danielkleinert commented 5 months ago

Sorry forgot to look into this earlier. The issue still persists.

Maybe the Patch is not included in my version? HACS says I am on 2024.5.1 with MA saying it's on 2.0.4. I also could not find the fix in the commits.... 🧐

OzGav commented 5 months ago

Will be in the beta and 2.0.5 when it comes out. Let us know if it isn’t working when that happens

danielkleinert commented 5 months ago

Does work in the current stable. 🎉

(Also i was trying to paste the track_authorisation from the URL and not the authorisation from the headers - probably contributed to the issue....)

nimbling commented 2 months ago

I'm getting the same error 2024-08-27 09:17:03.356 ERROR (MainThread) [music_assistant.webserver] Error handling message: config/providers/save: 401, message='Attempt to decode JSON with unexpected mimetype: ', url='https://api-v2.soundcloud.com/me'

I'm getting the: O-Auth token (without "O-Auth ") from the inspect > Application tab > Storage > Cookies > https://soundcloud.com client id from a search for "client_id" in the inspect > Network Tab

2.3.0b7 version of MAS

Does it matter that I'm trying this remotely?

OzGav commented 2 months ago

@nimbling Possibly. Try again when you are home

nimbling commented 2 months ago

I'm getting the same error at home using Safari and Chrome. Should I try setting the log level to more verbose?

MAS.log

OzGav commented 2 months ago

Please open a new issue and do NOT increase the log level but do include the whole thing from MA SETTINGS>> CORE

nimbling commented 2 months ago

Will do, thanks!

nimbling commented 2 months ago

Using Brave, this is working for me (just now) -now!

nimbling commented 2 months ago

By the way, I think the error was because I somehow managed to find and use the wrong OAuth key. There's more than one I think, and using the one mentioned in the readme (which I could not find at first) fixed this for me.

maphouse commented 1 month ago

I am having this exact issue. Was only able to find the oauth key via Inspect > Application > Storage > Cookie > oauth_token

I was totally unable to find the auth by following the readme https://music-assistant.io/music-providers/soundcloud/ I suspect the website has changed. Any assistance would be very appreciated

kristianschneider commented 1 month ago

I noticed if you type in OAuth 2-297731-684228-Fbxxxxxxxxxxxxxx it works but if you type in O-Auth 2-297731-684228-Fbxxxxxxxxxxxxxx it does not work and comes with that error.

So the documentation is perhaps a bit outdated image

OzGav commented 1 month ago

Thanks we will have a look and make a note in the docs.