sl0mad's profile picture

Published by


Category: Web, HTML, Tech

Using Bash to download music from ektoplazm

My home internet connection's been annoyingly broken recently. Until it gets fixed, I'm starting to appreciate that you can actually *download* music locally again (because spotify is forever stalling while the internet sorts itself out). This blogpost will probably be useful to basically no one, so I'm writing it for mostly myself. But if it helps someone else, that's great.

One place I download a bunch of music from is It's a site that's existed for ages and has mostly psytrance and related genres (psychill, downtempo, progressive, etc). Problem is, it offers the music as a zip file with no subfolders. I play music from my home server, with all music stored in /storage/media/. When I download music from Ektoplazm, I wanted to store them under some directory here, with the album name being a further subdirectory. So, I wrote two little bash functions that handle this, the main one being called `ektoget`.

For example, take the following album: - on that page, you'll see an 'MP3 Download' button. Using my script, when SSH'd into my server, I simply type ektoget and it'll download the album to /storage/media/music/ektoplazm/Globular - Entangled Everything - 2018 - MP3, with each MP3 under that directory.

To use ektoget, add the following to your ~/.bashrc file. Then reload with source ~/.bashrc`.

    unzip "$file" -d "$dirname"
    rm "$file"

    pushd "$EKTODIR" || exit 1
    base="$(basename ${url})"
    filename=$(printf '%b' ${base//%/\\x})
    echo "base: $base"
    echo "url: $url"
    echo "filename: $filename"
    wget "${url}"
    ektozip "$filename"
    popd || exit 1

You'll want to set EKTODIR to whatever location you want to save music.

Sorry, I wrote all this in a hurry because I'm putting off doing my *actual* job. So if anything's unclear, just comment and I'll help you out.

0 Kudos


Displaying 0 of 0 comments ( View all | Add Comment )