A Python tool that helps you quickly convert a Spotify playlist into a YouTube playlist — and generates a beautiful, mobile-friendly HTML page with all your tracks and links.
Built with Spotipy, Google API, TailwindCSS, and lots of love. ❤️
- 🔄 Convert a Spotify playlist into a YouTube playlist automatically
- 🌐 Generate an HTML page with:
- Embedded YouTube playlist player
- Link to the original Spotify playlist
- Toggleable track list (show/hide)
- Beautiful responsive design with dark mode
- 🌓 Dark mode support (follows system preferences)
- 📜 Simple, clean codebase with easy customization
- ⚡ Fast and lightweight, no server needed — just open the HTML file!
See my example Spotimy page here
![]() |
![]() |
- A Spotify Premium account to create an app and access the Spotify WebAPI
- Goolge account to create an app and access the YouTube Data API v3
-
Clone the repository:
git clone https://github.com/mcguirepr89/spotimy.git cd spotimy
-
Create a Spotify Developer App at Spotify Developer Dashboard
-
Add a Redirect URI
http://127.0.0.1:8888/callback
in the app settings. -
Copy your Client ID and Client Secret and put them in a
.env
file like so:spotimy/.env
:SPOTIFY_CLIENT_ID=mylongclientid SPOTIFY_CLIENT_SECRET=mylongclientsecret
-
Generate a YouTube Data API v3 key:
- Go to the Google Cloud Console.
- Enable the YouTube Data API v3.
- Generate OAuth 2.0 credentials with
https://www.googleapis.com/auth/youtube.force-ssl
scope. - Download your client credentials
JSON
file and rename itclient_secret.json
-
Install dependencies in a virtual environment in the
spotimy
directory:-
python3 -m venv venv && source ./venv/bin/activate
-
pip install -U pip && pip install -r requirements.txt
-
usage: spotimy.py [-h] [--resume RESUME] [--generate-html] [--spotify-add SPOTIFY_ADD]
Spotify to YouTube playlist converter and web page creator.
options:
-h, --help show this help message and exit
--resume RESUME Path to a resume JSON file to continue a previous session.
--generate-html Generate an HTML page with links and optional embed.
--spotify-add SPOTIFY_ADD
Path to file containing Spotify track IDs for adding to Spotify playlist.
Run the script interactively:
python spotimy.py
You will be prompted to:
- Choose a Spotify playlist
- Optionally create a YouTube playlist or select an existing one
- Export a mobile-friendly HTML page with embedded YouTube links
You can then open the generated youtube_links.html
in any web browser!
OR resume from a previous conversion (see Limitations below for why this might be needed/helpful):
python spotimy.py --resume Spotify_playlist-to-Youtube_playlist.json
AND you can add tracks from a tracklist to a new or existing Spotify playlist (see Hints below for tips on using this feature):
python spotimy.py --spotify-add ListOfSpotifyTrackIDs_OR_song_links.txt
This project is licensed under the MIT License. See the LICENSE file for details.
Since this tool works by adding the first video from the YouTube search of format Track Title - Artist Name (Album: Album Name)
, mistakes are bound to happen. One problem that seems to be pretty common is that "Full Album" videos get added when a song is also an album name.
Example: Colour Green - Sibylle Baier (Album: Colour Green)
adds the video Sibylle Baier - Colour Green (Full Album)
The API requests are limited. At the time of writing, (April 14th, 2025), I've only been able to convert 68 Spotify tracks into YouTube playlist items before hitting the API daily rate limit.
Spotify deprecated being able to get the tracks from their currated playlists. This little javascript code snippet can be used to extract all of the href
targets from the <a>
tags when you open those playlist pages in your browser, zoom ALLLLL the way out so that every track is loaded and visible, and then dumping those into a file.
const trackLinks = Array.from(document.querySelectorAll('a'))
.map(a => a.getAttribute('href'))
.filter(href => href && href.includes('track'))
.map(href => href.split('/track/')[1]);
console.log(trackLinks.join('\n'));
Example workflow using Chrome:
- Go to the playlist in the web browser.
- Press
Ctrl
+Shift
+I
to enter the browser's web inspector. - Using the element explorer, highlight the
<div
> element that contains the playlist track listing and right click to "cut" it into your clipboard. - Delete the entire
<body>
element - Append (paste) the
<div>
from your clipboard. - Go to the web inspector's "Console" to paste the javascript snippet above.
- Copy and paste the results into a text file.