Spotify-Downloader-Bash
Spotify-Downloader-Bash copied to clipboard
An automation script to download Spotify exported songs using yt-dlp / youtube-dl and FFMPEG.

An automation script to download Spotify exported songs using yt-dlp / youtube-dl and FFMPEG.
:pencil2: Key Features
:heavy_check_mark: Customizable
:heavy_check_mark: Parallel downloads
:heavy_check_mark: Full metadata handling
:heavy_check_mark: No additional overhead
:heavy_check_mark: No need to deal with the Spotify API
:page_with_curl: Legal Notice
Be aware, that this script is only an automation of yt-dlp / youtuble-dl.
All laws regarding the download of copyrighted content also apply here.
:clipboard: Script Setup
- Visit
Exportify, sign in with your Spotify credentials and export your desired playlists as a .csvfile. - Install a downloader (
yt-dlporyoutube-dl→ Check for a recent version! ) andFFMPEGwith your prefered package manager. - Get the script and make it executable:
wget https://raw.githubusercontent.com/Daenges/Spotify-Downloader-Bash/main/Downloader.sh &&\
chmod +x Downloader.sh
- Check the script one last time with your favourite editor before execution.
:arrow_forward: Script Execution
:arrow_right_hook: ./Downloader.sh "Path/To/YourPlaylist.csv" starts the script with default parameters.
These parameters are:
csvFile=""
downloader=""
processNumber=5
musicPath="./"
additionalKeywords=""
:bulb: Execution with Parameters: ./Downloader.sh "Path/To/YourPlaylist.csv" --additionalKeywords clean --processNumber 10
| Parameter | Usage |
|---|---|
csvFile |
Must be entered as first parameter on execution and sets the path of your playlist file. |
downloader |
Sets the download command. There is an automatic detection (prefering yt-dlp), that can be overwritten with: --downloader youtube-dl |
processNumber |
Number of parallel started Downloadprocesses. Can be altered with: --processNumber 10 |
musicPath |
Sets the path where the music is saved, default is the execution path of the script. Can be changed with: --musicPath /Your/New/Path/ |
additionalKeywords |
Since we are performing Youtube searches with Title and Author, some additional keywords(e.g. clean, lyrics, ...) might improve the results.Can be set with: --additionalKeywords clean |
:x: Errors
If you got any error, check the version of your downloader against their latest release (yt-dlp or youtube-dl). Most errors arise through Youtube updating their page which needs to be implemented into the downloaders. If you have a recent downloader version and still get errors, feel free to create an issue here.
:mag_right: What is the script doing in the background?
- Reading all parameters
- Getting the column number for the according data fields (
Artist Name,Track Name, ...) - Creating an array containing all lines of data
- Starting parallel jobs that handle the download process
- download picture and
.mp3into/temp/ - merge them with
FFMPEGwhile also applying metadata
- download picture and
:scroll: License
Copyright 2023 Daenges
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.