spec | ||
src | ||
.editorconfig | ||
.gitignore | ||
.travis.yml | ||
LICENSE | ||
README.md | ||
shard.lock | ||
shard.yml |
irs
AKA Ironic Repositioning System
A music scraper that understands your metadata needs.
Installation
- Download the latest release for your platform here
- Create a
.yaml
config file somewhere on your system - Copy the following into it
binary_directory: ~/.irs/bin music_directory: ~/Music client_key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX client_secret: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX single_folder_playlist: enabled: true retain_playlist_order: true overwrite_album: false
- Set the environment variable
IRS_CONFIG_LOCATION
pointing to that file - Go to
https://developer.spotify.com/dashboard/
- Log in or create an account
- Click
CREATE A CLIENT ID
- Enter all necessary info, true or false, continue
- Find your client key and client secret
- Copy them into where all the X's are in your config file from above
You should be good to go! Run the file from your command line to get help on usage or keep reading!
Optionally From Source
Or if you're one of those cool people who compiles from source
- Install crystal-lang (
https://crystal-lang.org/install/
) - Clone it (
git clone https://github.com/cooperhammond/irs
) - CD it (
cd irs
) - Build it (
shards build
)
Usage
How it works
At it's core irs
downloads individual songs. It does this by interfacing with the Spotify API, grabbing metadata, and then searching Youtube for a video containing the song's audio. It will download the video using youtube-dl
, extract the audio using ffmpeg
, and then pack the audio and metadata together into an MP3.
From the core, it has been extended to download the index of albums and playlists through the spotify API, and then iteratively use the method above for downloading each song.
It used to be in python
, but
- I wasn't a fan of python's limited ability to distribute standalone binaries
- It was a clusterfuck of code that I made when I was little and I wanted to refine it
crystal-lang
made some promises and I was interested in seeing how well it did (verdict: if you're building high-level tools you want to run quickly and distribute, it's a joy to work in)
Contributing
Any and all contributions are welcome. If you think of a cool feature, send a PR or shoot me an email. If you think something could be implemented better, please shoot me an email. If you like what I'm doing here, pretty please shoot me an email.
- Fork it (https://github.com/your-github-user/irs/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request