soundcloud / api

A public repo for our Developer Community to engage about bugs and feature requests on our Public API
144 stars 23 forks source link

Plays via API not reflecting on artist profiles #149

Open jasongrishkoff opened 2 years ago

jasongrishkoff commented 2 years ago

Hi there, it looks like play counts via the API are not properly registering. I can see this on both of my applications (SubmitHub and Indie Shuffle).

The way I get the streaming endpoint is as follows:

For example, this song published on Indie Shuffle has had 750+ plays: https://www.indieshuffle.com/flamingo-zamperoni-calm-waters/

But on SoundCloud it's only showing 5 plays: https://soundcloud.com/bensnburner/starry/s-9gBTqOLrNxl

rahul-sc commented 2 years ago

Hey @jasongrishkoff there are many layers of checks for plays captured from API integrations (ex: security, abuse, verified identity etc) and it's hard to pin-point a reason from a high level diagnosis. Just double checking here - is this still the case?

jasongrishkoff commented 2 years ago

Yes, this is definitely still the case. On both SubmitHub and Indie Shuffle plays aren't counting when using the http_mp3_128_url field returned from a URL like this: https://api.soundcloud.com/tracks/230805499/streams.

The streams endpoint is fetched using the proper Auth headers. Requests to the corresponding http_mp3_128_url are not using auth headers, as that's not possible using HTTP5 Audio (as referenced in #152).

rahul-sc commented 2 years ago

We might need help in narrowing this down. Is this happening for http_mp3_128_url only? or via HLS urls too? Have you tried?

jasongrishkoff commented 2 years ago

I've only been using http_mp3_128_url. I tried a few plays from the hls_mp3_128_url endpoint but after 5 minutes they hadn't reflected on the main SoundCloud website. Not sure if I should wait longer.

jasongrishkoff commented 2 years ago

Anything else I can do to help here? I keep getting complaints from artists we feature on Indie Shuffle as well as artists using SubmitHub.

egm0121 commented 2 years ago

Same issue here, also using http_mp3_128_url to stream the tracks

rahul-sc commented 2 years ago

Heya. We're looking into this.

jasongrishkoff commented 2 years ago

Hi @rahul-sc, has your team managed to make any progress here?

rahul-sc commented 2 years ago

Hello, this is not an immediate fix, unfortunately. As an interim workaround, you can use the /tracks/:id/stream endpoint. Please note, that this is undocumented & experimental.

jasongrishkoff commented 2 years ago

Hi @rahul-sc - that endpoint returns an MP3 rather than an actual streaming endpoint. HTML Audio can't pass headers client-side, so I need to first do a server-side request for the signed endpoint, thus using the http_mp3_128_url from the /tracks/:id:/streams endpoint.

mgoodfellow commented 2 years ago

@jasongrishkoff - no, that endpoint returns a redirect response. Don't follow the redirect on your server, and instead return the value in the Location header to your client.

jasongrishkoff commented 2 years ago

Okay, I'll go ahead and do that and see if it starts tracking plays. Thanks.

jasongrishkoff commented 2 years ago

Update: so far, no plays are being counted by following the 301 redirect of the /tracks/:id:/stream endpoint using the Location header. As an example, this song has 300+ plays on Indie Shuffle, but only 174 on SoundCloud (and it's been online for 2 months, so those likely weren't via our API): https://soundcloud.com/gglum/navy-1

Anyone else able to confirm that plays are being counted with this approach?

jasongrishkoff commented 2 years ago

I wonder if maybe there's a delay in how long it takes to reflect the plays? I am getting reports from users that the plays are starting to reflect on their SoundCloud pages. And I saw the above-linked track jump by ~300 plays, which is likely from Indie Shuffle (still a far cry from what we've seen on our website).

Can someone from SoundCloud confirm how long it typically takes for plays via the API to reflect on SoundCloud's website?