Tool for downloading music
Install third-party tools youtube-dl and
ffmpeg. Generally it’s easy.
Mac
brew install ffmpeg youtube-dl
Ubuntu
sudo apt-get install ffmpeg youtube-dl
Install missing gems
bundle install
Copy yaml file with credentials and fill it in with your keys. For testing purposes you can use keys provided in secrets.yml.public
, but please create your own keys ASAP to allow other people to test this tool, because free usage limits are too low for several users.
cp secrets.yml.public secrets.yml
Please add your own youtube google api key to secrets.yml
file. It can be created here https://console.developers.google.com/
To download songs from spotify playlists please add spotify api credentials (top 10 works without credentials).
Spotify client id and client secret can be created here https://developer.spotify.com/my-applications. Add them to secrets.yml
file.
And save it to ~/Music
folder. Use -d
option to specify destination folder. It can be used together with any other options. Without it tracks will be saved to ./audio
folder.
ruby main.rb -t 'r you mine' -d ~/Music
ruby main.rb -a 'arctic monkeys'
echo 'оксимирон imperial\nsoad toxicity\nмаршрутка' > songs.txt
ruby main.rb -f 'songs.txt'
ruby main.rb -p 'https://open.spotify.com/user/1249251980/playlist/3SC5B4DyGykKQIcNA7uemX'
By default tracks get downloaded from YouTube. You can use mail.ru/music passing -m
option.
ruby main.rb -t 'mutter' -m
ruby main.rb --help
You can find documentation about youtube api here
https://developers.google.com/youtube/v3/docs/search/list