GitHub - hassanaziz0012/spotify-downloader: An unofficial command-line based spo...
source link: https://github.com/hassanaziz0012/spotify-downloader
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Spotify Downloader
This is a small script that lets you download tracks and playlists from Spotify directly from the command line. See below for installation and usage instructions and examples.
Installation
Docker container (the recommended and easy way)
- Clone this repository.
git clone https://github.com/hassanaziz0012/spotify-downloader
- cd into the directory and run the following commands:
docker build -t spotify-downloader .
docker run -it -v your/music/folder:/app/music spotify-downloader
NOTE: Make sure to replace "your/music/folder"
with the actual directory where you keep your music. This is used to sync playlists and ignore tracks that already exist.
Compiling from source
- Clone this repository.
git clone https://github.com/hassanaziz0012/spotify-downloader
# install python packages, including yt-dlp
pip install -r requirements.txt
# install ytfzf
git clone https://github.com/pystardust/ytfzf
cd ytfzf
sudo make install doc
I recommend using Docker to install and run this script.
Usage
- Firstly, open
config.json
and set your Spotify client ID and client secret. You can get this after creating a developer app on Spotify: https://developer.spotify.com/dashboard/create - If you installed via Docker, then run the container using the following command:
docker run -it -v your/music/folder:/app/music spotify-downloader
Replace your/music/folder
with your music directory.
- If you installed from source, then open
spotify-downloader.py
and change theOUTPUT_DIR
variable's value to your music directory.
Downloading a single track
python spotify-downloader track {TRACK_ID}
Downloading a playlist
python spotify-downloader playlist {PLAYLIST_ID}
Sync a playlist
python spotify-downloader playlist {PLAYLIST_ID} -s
Download a track with a custom YT url
python spotify-downloader yt={YT_URL} track {TRACK_ID}
That's all, folks!
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK