Do you want to download your songs on Spotify and listen to them offline? Use this bot to convert any Spotify song to .mp3 file.
Important
This bot does not use Spotify database to download songs. Instead, it will search for the particular song on YouTube, SoundCloud and many other open-source platforms to extract the song! Also, bot can so far process only individual songs only, not playlists.
- User sends a Spotify song link
- Bot gets the song details using spotipy library
- Bot uses yt-dlp library to find the song
- It uses yt-dlp to download the file as .mp4
- Then it converts the song to .mp3 format
- It uses moviepy built on ffmpeg for convertion
- Lastly, bot sends the .mp3 file to the user
To install the project and necessary dependencies, follow these steps:
-
Clone this repository:
git clone https://github.com/mrbekacs/Spotify-Extract-Bot.git cd Spotify-Extract-Bot
-
Install the required Python libraries:
pip install -r requirements.txt
-
In the directory, create .env file to store following keys:
SPOTIPY_CLIENT_ID=your_client_id SPOTIPY_CLIENT_SECRET=your_client_secret TELEGRAM_BOT_TOKEN=your_bot_token
-
In telegram, use @BotFather to simply create your bot. After following the creation steps, get the token and use it in .env file.
To start the bot, run the following command:
python spotify_extract_bot.py
Then, go to your telegram, start the bot, and send a Spotify song link.
Eventually, the bot will send you the song in .mp3 file which you can downlaod.