As an open-source project, linsomniac/spotify_to_ytmusic has picked up 4.6k stars on GitHub (Python). Copy playlists and liked music from Spotify to YTMusic
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
This is a set of scripts for copying "liked" songs and playlists from Spotify to YTMusic. It provides a GUI (implemented by Yoween, formerly called spotify_to_ytmusic_gui).
Preparation/Pre-Conditions
Install Python and Git (you may already have them installed).
Uninstall the pip package from the original repository (if you previously installed linsomniac/spotify_to_ytmusic):
On Windows:
python -m pip uninstall spotify2ytmusic
On Linux or Mac:
python3 -m pip uninstall spotify2ytmusic
Setup Instructions
1. Clone, Create a Virtual Environment, and Install Required Packages
Start by creating and activating a Python virtual environment to isolate dependencies.
git clone https://github.com/linsomniac/spotify_to_ytmusic.git
cd spotify_to_ytmusic
To use the YouTube Music API, you need to generate valid credentials. Follow these steps:
Log in to YouTube Music: Open YouTube Music in Firefox and ensure you are logged in.
Open the Inspection Tool: Press F12 or right-click and select Inspect to open the browser's inspection tool.
Access the Network Tab: Navigate to the Network tab and filter by /browse.
Select a Request: Click one of the requests under the filtered results and locate the Request Headers section.
Toggle RAW View: Click the RAW toggle button to view the headers in raw format.
Copy Headers: Right-click, choose Select All, and copy the content.
Paste into raw_headers.txt: Open the raw_headers.txt file located in the main directory of this project and paste the copied content into it.
Run the Script:
Execute the following command to generate the credentials file:
On Windows:
python spotify2ytmusic/ytmusic_credentials.py
On Linux or Mac:
python3 spotify2ytmusic/ytmusic_credentials.py
Important: After running this script, the authentication file will be created.
When you launch the GUI in the next step, it will automatically detect this file and log in to YouTube Music without requiring manual input. You’ll see a log message confirming this:
File detected, auto login
The GUI will ignore the 'Login to YT Music' tab and jump straight to the 'Spotify Backup' tab.
3. Use the GUI for Migration
Now you can use the graphical user interface (GUI) to migrate your playlists and liked songs to YouTube Music. Start the GUI with the following command:
On Windows:
python -m spotify2ytmusic gui
On Linux or Mac:
python3 -m spotify2ytmusic gui
GUI Features
Once the GUI is running, you can:
Backup Your Spotify Playlists: Save your playlists and liked songs into the file playlists.json.
Load Liked Songs: Migrate your Spotify liked songs to YouTube Music.
List Playlists: View your playlists and their details.
Copy All Playlists: Migrate all Spotify playlists to YouTube Music.
Copy a Specific Playlist: Select and migrate a specific Spotify playlist to YouTube Music.
Import Your Liked Songs - Tab 3
Click the import button, and wait until it finished and switched to the next tab
It will go through your Spotify liked songs, and like them on YTMusic. It will display
the song from Spotify and then the song that it found on YTMusic that it is liking. I've
spot-checked my songs and it seems to be doing a good job of matching YTMusic songs with
Spotify. So far I haven't seen a single failure across a couple hundred songs, but more
esoteric titles it may have issues with.
List Your Playlists - Tab 4
Click the list button, and wait until it finished and switched to the next tab
This will list the playlists you have on both Spotify and YTMusic, so you can individually copy them.
Copy Your Playlists - Tab 5
You can either copy all playlists, or do a more surgical copy of individual playlists.
Copying all playlists will use the name of the Spotify playlist as the destination playlist name on YTMusic.
To copy all the playlists click the copy button, and wait until it finished and switched to the next tab
NOTE: This does not copy the Liked playlist (see above to do that).
Copy specific Playlist - Tab 6
In the list output, find the "playlist id" (the first column) of the Spotify playlist and of the YTMusic playlist.
Then fill both input fields and click the copy button
The copy playlist will take the name of the YTMusic playlist and will create the
playlist if it does not exist, if you start the YTMusic playlist with a "+":
Re-running "copy_playlist" or "load_liked" in the event that it fails should be safe, it
will not duplicate entries on the playlist.
Command Line Usage
Ways to Run
NOTE: There are two possible ways to run these commands, one is via standalone commands
if the application was installed, which takes the form of: s2yt_load_liked
If not fully installed, you can replace the "s2yt_" with "python -m spotify2ytmusic", for
example: s2yt_load_liked becomes python -j spotify2ytmusic load_liked
Login to YTMusic
See "Generate YouTube Music Credentials" above.
Backup Your Spotify Playlists
Run spotify2ytmusic/spotify_backup.py and it will help you authorize access to your spotify account.
This will save your playlists and liked songs into the file "playlists.json".
Import Your Liked Songs
Run: s2yt_load_liked
It will go through your Spotify liked songs, and like them on YTMusic. It will display
the song from spotify and then the song that it found on YTMusic that it is liking. I've
spot-checked my songs and it seems to be doing a good job of matching YTMusic songs with
Spotify. So far I haven't seen a single failure across a couple thousand songs, but more
esoteric titles it may have issues with.
Import Your Liked Albums
Run: s2yt_load_liked_albums
Spotify stores liked albums outside of the "Liked Songs" playlist. This is the command to
load your liked albums into YTMusic liked songs.
List Your Playlists
Run s2yt_list_playlists
This will list the playlists you have on both Spotify and YTMusic. You will need to
individually copy them.
Copy Your Playlists
You can either copy all playlists, or do a more surgical copy of individual playlists.
Copying all playlists will use the name of the Spotify playlist as the destination
playlist name on YTMusic. To copy all playlists, run:
s2yt_copy_all_playlists
NOTE: This does not copy the Liked playlist (see above to do that).
In the list output above, find the "playlist id" (the first column) of the Spotify playlist,
and of the YTMusic playlist, and then run:
Or the copy playlist can take the name of the YTMusic playlist and will create the
playlist if it does not exist, if you start the YTMusic playlist with a "+":
The function first searches for albums by the given artist name on YTMusic.
It then iterates over the first three album results and tries to find a track with
the exact same name as the given track name. If it finds a match, it returns the
track information.
If the function can't find the track in the albums, it then searches for songs by the
given track name and artist name.
Depending on the yt_search_algo parameter, it performs one of the following actions:
If yt_search_algo is 0, it simply returns the first song result.
If yt_search_algo is 1, it iterates over the song results and returns the first song
that matches the track name, artist name, and album name exactly. If it can't find a
match, it raises a ValueError.
If yt_search_algo is 2, it performs a fuzzy match. It removes everything in brackets
in the song title and checks for a match with the track name, artist name, and album
name. If it can't find a match, it then searches for videos with the track name and
artist name. If it still can't find a match, it raises a ValueError.
If the function can't find the track using any of the above methods, it raises a
ValueError.
FAQ
My copy is failing after 20-40 minutes. Is my session timing out?
Try playing music in the browser on Youtube Music while you are loading the playlists,
this has been reported to keep the session from timing out.
Does this run on mobile?
No, this runs on Linux/Windows/MacOS.
How does the lookup algorithm work?
Given the Spotify track information, it does a lookup for the album by the same artist
on YTMusic, then looks at the first 3 hits looking for a track with exactly the same
name. In the event that it can't find that exact track, it then does a search of songs
for the track name by the same artist and simply returns the first hit.
The idea is that finding the album and artist and then looking for the exact track match
will be more likely to be accurate than searching for the song and artist and relying on
the YTMusic algorithm to figure things out, especially for short tracks that might be
have many contradictory hits like "Survival by Yes".
My copy is failing with repeated "ERROR: (Retrying) Server returned HTTP 400: Bad
Request".
Try running with "--track-sleep=3" argument to do a 3 second sleep between tracks. This
will take much longer, but may succeed where faster rates have failed.
License
Creative Commons Zero v1.0 Universal
spotify-backup.py licensed under MIT License.
See https://github.com/caseychu/spotify-backup for more information.
Does linsomniac/spotify_to_ytmusic have a project website?
No homepage URL was recorded for linsomniac/spotify_to_ytmusic in TopGit's last sync. The README tab above frequently contains screenshots and demo links, or check the repository description on GitHub.
Does linsomniac/spotify_to_ytmusic have any tags?
TopGit's last sync did not record any GitHub topics for linsomniac/spotify_to_ytmusic. GitHub topics appear in the right sidebar of a repository page; that's the authoritative place to check.
How active is development on linsomniac/spotify_to_ytmusic?
The most recent commit recorded on linsomniac/spotify_to_ytmusic was 7 months ago, based on the GitHub push timestamp. The repository has 368 forks — one of the better signals of community interest.
How many stars does linsomniac/spotify_to_ytmusic have?
linsomniac/spotify_to_ytmusic has 4.6k GitHub stars — refresh the page for the live number, or check github.com/linsomniac/spotify_to_ytmusic. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What language is linsomniac/spotify_to_ytmusic written in?
linsomniac/spotify_to_ytmusic is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
Where do I read more about linsomniac/spotify_to_ytmusic?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/linsomniac/spotify_to_ytmusic is the definitive source.
Read full README in the tab above.
Is spotify_to_ytmusic worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of spotify_to_ytmusic.