项目作者: music-dl

项目描述 :
Tool for downloading music
高级语言: Ruby
项目地址: git://github.com/music-dl/music-dl.git
创建时间: 2016-12-03T08:36:36Z
项目社区:https://github.com/music-dl/music-dl

开源协议:

下载


Installation

Required part

Install third-party tools youtube-dl and
ffmpeg. Generally it’s easy.

Mac

  1. brew install ffmpeg youtube-dl

Ubuntu

  1. sudo apt-get install ffmpeg youtube-dl

Install missing gems

  1. 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.

  1. 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/

Optional part

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.

Usage

Download one track

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.

  1. ruby main.rb -t 'r you mine' -d ~/Music
Download artist’s top 10 tracks
  1. ruby main.rb -a 'arctic monkeys'
Download tracks from file
  1. echo 'оксимирон imperial\nsoad toxicity\nмаршрутка' > songs.txt
  2. ruby main.rb -f 'songs.txt'
Download tracks from spotify playlist
  1. ruby main.rb -p 'https://open.spotify.com/user/1249251980/playlist/3SC5B4DyGykKQIcNA7uemX'
Specify music provider

By default tracks get downloaded from YouTube. You can use mail.ru/music passing -m option.

  1. ruby main.rb -t 'mutter' -m
See full list of options
  1. ruby main.rb --help

TODO

  1. Syncronize songs (via daemon or runnable script) with folder in filesystem, Dropbox, GoogleDrive etc.
  2. Distribution via Rubygems or Traveling Ruby.
  3. Web application.

For developers

You can find documentation about youtube api here
https://developers.google.com/youtube/v3/docs/search/list