Welcome to this repository! My program allows you to download playlists and songs from Spotify absolutely free (you don’t need Spotify premium to use the program, it doesn’t even need to know anything about your personal account, to be honest).
- Playlists: Download Spotify playlists with just 1 url
- Songs: Download Spotify song with just 1 url
- Metadata: All needed metadata from songs downloads with them (including name, artists, album and cover art)
- Cutting: You can "cut out" the piece of your playlist your want by using flags when run the program
- Progress tracking: You don't have to sit in front of your computer and check if each song has been downloaded - program inform you about progress after every song downloaded so you can check it all later.
- Safety: You don't need to worry about songs that have the same name or that song has age restriction etc. This program cares for all of this (though, there still might be unexpecting errors but program will inform you about this)
Important
If you encounter any problem, don't be afraid to report it in the bugs and issues section of this repository.
Explore the source code and contribute to the development on GitHub:
Follow these steps to set up the SpotifyDownloader on your local machine:
-
Give a star this repo if you find it interesting or useful⭐
Thanks ❤️ -
Clone the repository:
git clone https://github.com/Heir-of-God/SpotifyDownloader
-
Install dependencies:
cd SpotifyDownloader pip install -r requirements.txt
-
Create Spotify API:
To grab information from Spotify you need Spotify API app. Here how to create it in 3 steps:- Go to https://developer.spotify.com/. Create or login into your account.
- After agreeing to all their requirements, you need to create the application. Click on your profile -> Dashboard -> Create app. Enter any app name, description, left website empty and add to redirect URIs just http://localhost/. In API choose only "Web API" and click save.
- After creating app go to its page, click settings and from "Basic Information" you will need cliend id and client secret. Go to the next step with this information.
-
Set up environment variables:
- Create a
.env
file in the root directory. - Define the following environment variables:
CLIENT_ID
: Copy there your client_id from Spotify APICLIENT_SECRET
: Copy there your client_secret from Spotify API
- Create a
-
Setting up ffmpeg:
To convert .webm files from PyTube to .mp3 files my program uses ffmpeg, so you need to install it and add it to PATH variable.There is the guide how to install ffmpeg correctly: Installation guide.
-
VERY IMPORTANT:
If you want program to work correctly you will need to change PyTube's source code a bit. I'm sorry, I have nothing to do with it and have struggled to fix their "bugs" as I could.- You need to add some lines of code in search.py. Add this at line 151:
if 'reelShelfRenderer' in video_details: continue if 'adSlotRenderer' in video_details: continue if 'movieRenderer' in video_details: continue
- You need to document or delete some lines of code in __main__.py like this (from 177 to 190):
After completing these steps, you'll have the SpotifyDownloader ready to use locally.
- The program is CLI (Command Line Interface) so you will need basic knowledge about cmd or bash or whatever you will use as a command line.
- Run your command line and go to the root directory of SpotifyDownloader
- Run and check all information about CLI interface.
Run your first downloading and enjoy results :)
py SpotifyDownloader.py -h
Contributions welcome! Open issues or submit pull requests.
This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.