[PLUGIN] SoundCloud

I’ve had a brief look at Mixcloud and I must say they did a good job at obfuscating almost everything that makes scraping close to impossible (given my current coding skills). Their site is heavily driven by Javascript with non-human readable function names and variables. I am not confident in doing this :frowning:

1 Like

Ok, thanks for checking!

So it appears they do have an API, BUT as you read further down the documentation:

The audio streams are not available through the Mixcloud API. There are two reasons for this.
Firstly, we need to know what has been listened to so that we can report usage, pay royalties and provide features such as ‘Suggested Shows’.Secondly, Mixcloud needs to pay the bills! We can’t give away the audio for free outside of mixcloud.com simply because it costs us to host and stream the files and pay royalties.

So the API lets you browse resources but not play them. I always wonder what purpose this kind of API serves… :thinking:

Very nice work @patrickkfkan,

I did a throw at it once, but was stuck on the authentication part, as I didn’t want to share my API key. For all the right reasons, reading your readme :wink: I seem to be able to authenticate, but requesting e.g. /me doesn’t work anymore. At least… not like it did before (saved everything in Postman).

Volumio uses a delegate for authentication. That means that particular delegate is the only component in need of API keys and secrets. Maybe Volumio already grabbed an API key before the lockdown (pun intended :stuck_out_tongue:).

I believe there’s some advantage to gain in logging in; e.g. own playlists and maybe some statistics (just thinking out loud here). I was unable to get search working from the API documentation at the time, but I see they’ve revamped the API docs (now OpenAPI).

Am I correct in understanding that this implementation uses scraping to gather data? I so, then you’ve done one hell of a job (and it probably took ages). Well done sir!

Also the plugin itself looks neatly coded, I’m liking the view more (pagination) option and entity ‘homepage’. All in all you did an awesome job. It integrates perfectly, you’ve done your homework on using the available framework options.

Thanks, @Saiyato.

When observing the network traffic on SC, I found that almost everything was fetched via an ‘API v2’. Understandably, since they have already shut down app registrations, you won’t find the new API in their developer docs. But it’s quite easy to find out the endpoints and the query params needed to get the correct data - you just have to look at the network requests when browsing the SC pages. This means the data-fetching part is really simple. If you’re interested, you can have a look at the soundcloud-fetch library I’ve written for the purpose. The harder part, really, is deciding how to put everything together and present them sensibly within the constraints of Volumio’s UI.

@Darmur,

Would you be able to test this?

Thanks.

-Patrick

1 Like

great, I will give it a try during the weekend!

Hi Patrick,

I‘m not in with mixcloud - but great - sounds good - thanks again.

Will also try this weekend.

Are you also preparing your great plugins for Volumio v3 or is this already taken into aspect ?

I am burning for v3 testing is released for plugins also :slight_smile:

Br
Josef

I’ll give v3 a test run over the weekend, then see if I could install my plugins on that.

this was easily #1 on my volumio wishlist. so many thanks! already listening to my favourite radio show. i had to use bluetooth from my phone before that.

Awesome! My most wanted Plugin, thank you so much. UI is brilliant. Now volumio makes much more sense :wink:

@Maegashira, @audiofan Thank you and let me know if you see room for improvement (within my abilities :laughing:)

How can I install plug-in for soundcloud or mixcloud into my Volumio Primo hifi edition, I don’t have practice, and I need something easy. thanks at all.

enable ssh
your_ip/dev or volumio.local if you didn’t change te name

if you got putty ssh in to your device again your_ip and login and password both are : volumio

after that go to the page of soundcloud

go to Getting Started follow the step there this should install the plugin and the same for mixcloud or youtube2

I’m going to get putty ssh, following your steps

if you need some help just say so :stuck_out_tongue:

I hope it’s easy

I just installed putty 64 bit, and after that?

do you know your ip of your primo?

I try to remember