Skip to content

Emboiss13/Spotify_Playlist_To_MP3_Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 

Repository files navigation

🎧 Spotify Playlist to MP3 Downloader + MP3 Tag Editor

This project helps you convert your private Spotify playlists into MP3 files by searching for matching videos on YouTube and downloading the audio. It also includes a separate script to batch-edit MP3 metadata (album, artist, genre, etc.), perfect for organising your files for an MP3 player.

Why did I decide to do this project? I was manually downloading my Spotify playlists into an MP3 player, and it was getting too tedious 🤭. So I thought hmmm... maybe I can automate this, and it went well!

📁 Project Structure

  • SpotifyPlaylistReader.py → Script to extract songs from Spotify and download them as MP3s
  • MP3TagEditor.py → Script to edit tags (album, artist, genre) of MP3 files

⬇️ Prerequisites

Make sure you have these installed:

  1. Python 3.9+
  2. Install Python packages: pip install spotipy yt-dlp mutagen https://spotipy.readthedocs.io/en/2.22.1/#getting-started
  3. Install FFmpeg (required by yt-dlp for MP3 conversion).

Script 1: SpotifyPlaylistReader.py

What it does:

  • Authenticates with your Spotify account
  • Lists your playlists
  • Let's you choose one playlist to download
  • Fetches the song titles and artists
  • Searches for each track on YouTube
  • Downloads the best audio and converts it to MP3

You will need:


image

Changes you MUST make to the code:

IMPORTANT❗️: Change CLIENT_ID = 'id' and CLIENT_SECRET = 'secret' in the 🔓 authentication section, to match your Spotify Developer Credentials.


Change line 115 to match the path you want to download the songs to:

def download_as_mp3(youtube_url, song_name, output_folder='[ADD YOUR PATH HERE]'):
    safe_filename = clean_filename(song_name)

Example:

def download_as_mp3(youtube_url, song_name, output_folder='/MyWindowsPC/Downloads'):

▶️ How to run:

Open a terminal in the folder where you've cloned this repo and run python3 SpotifyPlaylistReader.py



Script 2: MP3TagEditor.py


What it does:

  • Edits the metadata tags of all .mp3 files in a given folder
  • Supports adding album name, artist, and genre
  • Keeps things organised for MP3 players and music libraries

▶️ How to run:

Open a terminal in the folder where you've cloned this repo and run python3 MP3TagEditor.py


You'll be prompted to:

  • Enter a folder path with your MP3s
  • Optionally enter album, artist, and genre names


Legal & Ethical concerns:

  • These scripts do not upload or re-host any copyrighted content.
  • Always check YouTube’s and Spotify’s terms of use.
  • This project is intended for personal use only.

Author: Giuliana E — frontend developer exploring Python

About

Developed this project to automate converting my Spotify playlists into MP3 albums for me to use in my new MP3 player.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages