mopidy-soundcloud icon indicating copy to clipboard operation
mopidy-soundcloud copied to clipboard

SoundCloud API randomly returns 403

Open lealoureiro opened this issue 4 years ago • 8 comments

Hi Guys,

I'm using Mopidy-Soundcloud extension and the API sometimes returns 403 code when i want to play a set:

Got ERROR bus message: error=GLib.Error('Forbidden', 'gst-resource-error-quark', 15) debug='gstsouphttpsrc.c(1431): gst_soup_http_src_parse_status (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin2/GstSoupHTTPSrc:source:\nForbidden (403), URL: https://cf-media.sndcdn.com/dYSpqOXuN4m7.128.mp3?Policy=xx&Signature=xx&Key-Pair-Id=xx, Redirect to: (NULL)'

This makes the plugin very unstable.

Regards, Leandro

lealoureiro avatar Apr 21 '20 08:04 lealoureiro

You probably hit the API's daily rate limit. Soundcloud, over years and years now, have done nothing to address their woefully inadequate API rate limits, or anything to better secure their endpoints. When people hammer the endpoints using our code (due to bugged software or unhelpful behaviour or whatever) they eat up our allowance. You can't even get apply for a new API account these days. I've previously tried to minimise our hits but I'd welcome anyone else having another go. Else there's nothing we can do about this.

kingosticks avatar Apr 21 '20 08:04 kingosticks

Or, will trying to play a different set then work afterwards? I'd love it if this was not a rate limit problem.

kingosticks avatar Apr 21 '20 08:04 kingosticks

Other sets works, but not all...

So the fight is always to find one that works :(

But same set was working and able to listen yesterday night, 1st time this morning is failing ...

lealoureiro avatar Apr 21 '20 08:04 lealoureiro

I guess if you could try and work out the uri difference for a given set when it works and doesn't that might help. But ultimately when a soundcloud endpoint gives us a 403 I'm not sure what we can do. Especially since it was their API response that provided us with that CDN media URI.

It'll be tricky to fix this as they don't support API users. Maybe comparing with accessing this set on their official app might be helpful.

kingosticks avatar Apr 21 '20 08:04 kingosticks

What you mean by work out the URI?

lealoureiro avatar Apr 21 '20 08:04 lealoureiro

You said that set worked at some point. And there might be some difference between the CDN uri provided by soundclouds API when it worked and when it didn't work. Can we guess what might be the problem. And maybe if we are really really really lucky there is something we can do about it.

kingosticks avatar Apr 21 '20 08:04 kingosticks

Is that one visible in playlists in file system or only when we press play in interface via logs?

lealoureiro avatar Apr 21 '20 10:04 lealoureiro

In the logs only, I think

kingosticks avatar Apr 21 '20 10:04 kingosticks