SoundCloud downloader
Fri Mar 17 2023
Quick writeup of this project that I built tonight. I had just finished adding ID3 tags manually to a few mp3s and decided to make something to speed up the process for songs on SoundCloud.
I wrote it in Typescript and outsourced a lot of the hard stuff to random npm packages.
Reminder to future me: if ts-node
isn't working, try adding this to the tsconfig
:
|
|
|
|
Anyway, it parses command line arguments with ts-command-line-args
,
fetches the song data with soundcloud-scraper
,
and writes the ID3 tags with node-id3
.
There's some other utilities too like
chalk
,
mkdirp
,
rimraf
, and
sanitize-filename
.
Why reinvent the wheel?
We read the passed urls and files possibly containing more urls, then download the thumbnail and mp3 for each one and write the ID3 tags.
I haven't looked into creating a binary to make it more portable yet.
I think I'll need to change the out
and temp
paths to be less hardcoded
(right now they're relative to import.meta.url
? I'm not sure how that would work after packaging everything).
I might try to add searching for tracks by name as well. Other than that, it works good enough for me. You can use it if you want. Thanks for reading.