Download all your Soundcloud likes automatically

Tagged InAllMusicHacksHome Server

You never have to click that download button again

So I am a huge Soundcloud fan, I love the social aspect of sharing music and most of my favourite artists and djs very regular posters so your feed is always full of fresh new tunes from people you like.  My only gripe is streaming, most of the time it is great as I generally listen to the music in a browser, but there are occasions where it would be nice to have the actual mp3 also.  My ipod is one of those reasons, it has no internet access so I can't stream and thus I need the mp3.

Soundcloud has an API, and there are plenty of "soundcloud downloader" websites out there so I though surely someone has merged the two and made a nice little script to do all the work of downloading for me.  Sure enough someone has! flyingrub has made a great python script to do exactly what I wanted. It is creatively named "scdl" and can be found here: https://github.com/flyingrub/scdl

Installing

I have a linux server so my setup might be different to yours however, the great thing about python is it runs on practically everything so if you want to do this too, the steps should be pretty similar.

Step 1 - Install Python

SCDL requires Python 3, in fact some of its dependencies required 3.3 or greater, so the first thing to do is download and install the latest version, I used 3.5 (current). It went a bit like this:

Check your Python version (if you have a version greater than 3.3 you can skip to step 2)

python --version

Download and install the latest version.

wget http://python.org/ftp/python/3.5.0/Python-3.5.0.tgz
tar xvfz Python-3.5.0.tgz
cd Python-3.3.0
./configure --prefix=/opt/python3.5
make  
sudo make install

Test if it worked

/opt/python3.5/bin/python3

If you are running multiple versions of python, you might want/need to switch between them, you can do this with the following

/opt/python3.5/bin/pyvenv ~/py35
source ~/py35/bin/activate

Step 2 - Install pip

Pip is a great way of downloading python packages, you just need to install it first

easy_install pip

Step 3 - Install scdl

Now we can easily install scdl (and its dependencies) with a one liner

pip3 install scdl

Step 4 - Get your soundcloud token

This is only required if you want to access your own stuff eg. likes/stream/etc. Click here to get your token.

From the scdl github page "Soundcloud has banned all our client_id so we cannot use authentication for now.". As a workaround you can just specify the url to your own soundcloud page

Step 5 - Setup your config file

In your scdl.cnf file you set your soundcloud token and default download location.

nano ~/.config/scdl/scdl.cfg

Step 6 - Test!

Everything should be good to go now, test a download of all your likes with this:

scdl -f -c --onlymp3 -l https://soundcloud.com/MY_SOUNDCLOUD_USERNAME

Step 6 - Automate

To get this all automated, all you have to do is create a cron job with the above line. I set mine to do it once a day at 4pm but you can use this handy tool to customise it to your needs.

crontab -e

Add something like

0 16 * * * scdl -f -c --onlymp3 -l https://soundcloud.com/MY_SOUNDCLOUD_USERNAME > /dev/null

Save, exit and you are all done!

Other notes

Next Article