Rentry (the platform where this guide is hosted) recently added popup ads to the site. They're not very intrusive, but they can mislead you to sketchy websites. Do NOT download anything from popups or ad banners.
Spotify to Youtube Music Guide
Import your Spotify's library into Youtube Music
If you want to patch Youtube Music to remove ads and enable screen-off playback, follow this APK patching guide with Revanced
The aim of this guide is to copy music from Spotify's library to YouTube Music's library, keeping the original order of songs. You can also use some third-party tools that are less technical but much more limited: Soundiiz lets you transfer music, but it is limited to 200 songs per transfer. You can manually select songs across multiple transfers, or use Skiley to split large playlists into smaller ones. To merge the transferred split playlists, open them in YouTube Music and use the Add to playlist
function. To transfer Spotify's Liked Songs for free using Soundiiz, use Skiley to generate a copy and split it into smaller playlists, each with fewer than 200 songs. Additionally, you won't be able to save songs to YouTubeMusic's 'Liked Music' with these third-party tools unless you pay for Soundiiz Premium. If you're not satisfied with the result, you can delete ALL your YouTube likes and dislikes in one click (warning: this will also remove saved playlists you don't own) from the official My Activity page and start over.
Not the first time?
If you already did the setup and are in the project folder, you can skip Steps: 1, 2, 3, 4, 5 and 6.
- Make sure you are in the tool's directory. (It's the one where you see all the files).
- Open the
Command Prompt
: to do so, click the address bar of the tool's directory, typecmd
and hit the Enter Key. - Execute the command below (copy-paste and hit the Enter key).
.venv\Scripts\activate
- Go to Step7.
Setup Guide
You need a PC running Windows to do this. This also works on Mac, but that is not covered in the guide. Mac users can follow these instructions directly: https://github.com/F-l-a/Spotify2YTMusic/tree/main#setup-instructions
Step1: Get the tools
This is the tool that we will use to transfer the music.
- Go to https://github.com/F-l-a/Spotify2YTMusic.
- Click the Green
Code
button and selectDownload ZIP
. - Extract the archive. You can do this by right-clicking it and selecting
Extract
. - Open the extracted directories. You are in the correct directory when you see all the files.
Step2: Get Python
The tool is written in python. We need an interpreter to execute the script.
- Download the Python installer from the official Microsoft Store page.
- Open the installer. It will open the Microsoft Store App automatically.
-
Install Python. The download should start automatically. A terminal-like window might open after installation; just close it.
Alternatively:
- From its official Microsoft Store page, select
View in Store
. - Install Python. A terminal-like window might open after installation; just close it.
- From its official Microsoft Store page, select
If the installation fails, reboot the PC and try this step (Step2) again
Step3: Activate the Virtual Environment
A virtual Environment is an isolated space in which Python projects can be "executed".
- Make sure you are in the tool's directory. (It's the one with all the files extracted in the first step).
- Open the
Command Prompt
: to do so, click the address bar of the tool's directory, typecmd
and hit the Enter Key. - Execute one command at a time (copy-paste and hit the Enter key).
You should now see (.venv)
at the beginning of the Command Prompt line. If you get errors, close the Command Prompt and try this step (Step3) again
Step4: Install ytmusicapi and tk
ytmusicapi
is a Python 3 library used to send requests to the YouTube Music API. tk (tkinter)
is a Python library used to create Graphical User Interfaces in Python.
- In the virtual environment activated in the previous step, execute the command below (copy-paste and hit the Enter key).
The output should be Successfully installed
with a bunch of names, or Requirement already satisfied
. If you get errors, close the Command Prompt and return to Step2
Step5: Get the headers
The tool uses the headers to login to youtube.
Don't share the headers with anyone: they can be used to log in on your behalf
- Go to https://music.youtube.com and login into your account.
- Right click, and select
Inspect
.Ctrl+Shift+J
works too. - Navigate to the
Network
tab and filter the list for "browse
". - Click something on the website, such as the
Discover
button. A network request filtered for "browse" should appear in the Network tab. - Open that network request and select all the text under
Request Headers
. (There's a section for the Response Headers too. We don't need it. Make sure you select the Request) . Copy all the text withCtrl+C
orRight-click -> Copy
. - Open the file named
raw_headers.txt
in the directory of the tool extracted in Step1.3 with Notepad, and Paste the headers withCtrl+V
orRight-click -> Paste
. Make sure the file is empty before pasting the new headers (delete any existing content if necessary). - Save the changes with
Ctrl+S
or selectFile -> Save
from the toolbar. You can then close the file.
Step6: Generate the oauth.json file
OAuth stands for Open Authorization. This file contains the Authorization token used by the tool to login without username and password, and it's generated from the raw_headers.txt
file.
- In the same terminal used in the previous steps, execute the command below (copy-paste and hit the Enter key).
The output should be YTMusic setup completed successfully!
. If you get errors, return to Step5 and change browser. Delete the old headers from raw_headers.txt
and Paste the new ones
Step7: Open the Graphical User Interface (aka: "the tool")
- In the same terminal used in the previous steps, execute the command below (copy-paste and hit the Enter key).
You can minimize the terminal, but do not close it.
A new app should be opened. See How to use the tool for instructions.
How to use the tool
Graphical interface
The tool is divided into several modules/tabs: Login to YT Music
, Spotify backup
, Load Liked Songs
, List Playlists
, Copy all playlists
, Copy a specific playlist
, Settings
.
- Login to YT Music
This tab is not relevant: since we already have the oAuth.json file generated in Step6, the tool should log in automatically.- If the Console shows
No file detected. Manual login required
, close the tool and return to Step6.
- If the Console shows
- Spotify Backup - Mandatory
Click theBackup
button to get all your playlists from Spotify. A browser tab is opened to log into your Spotify Account. If the browser gets stuck loading the page infinitely or doesn't open at all, copy and paste the link you see in the console in a new browser tab. - Load Liked Songs
This transfers your liked songs from Spotify to YouTube. It may take some time, as each song is added by liking it on YouTube one by one.
The console displays the progress, the current Spotify song and the one that it found and that it's liking on Youtube. - List Playlists - Super useful combined with the "Copy a specific playlist" tab
This lets you see all your playlists from Spotify and Youtube, with their names and IDs. An ID is an unique alphanumeric value that doesn't contain spaces. (Spotify's Liked Songs and YoutubeMusic's Liked Music don't have an ID). - Copy all playlists - Not recommended
This copies all your saved contents from Spotify. I strongly don't recommend it, as it also copies the playlists generated periodically by spotify, such as radios/mixes/suggestions (it copies all the playlists you saw in the "List playlists" tab). If you want to copy a specific playlist, use the next tab ("Copy a specific playlist"). - Copy a specific playlist - Your new best friend
All your music can be managed from this screen.
The process is simple: insert the Source playlist from Spotify, and the Destination one from Youtube.- Spotify Field:
ID
from the "List Playlists" tab, or-
to use the Liked Songs. - Youtube Field:
ID
from the "List Playlists" tab,-
to use the Liked Music,+PlaylistName
to add the songs to an existing "PlaylistName" playlist (if there isn't a playlist with that name in your Youtube library, one will be created), ornothing
(leave the field blank) to create a new playlist using Spotify's Source Playlist name.
An ID is an unique alphanumeric value that doesn't contain spaces (For Example:
PL_DhcdsaJ7echjfdsaJFhdsWUd73HJFca
). Use the "List Playlists" tab to list the IDs of your playlists - Spotify Field:
- Settings
Lets you disable the auto scrolling of the console. You can also change the Spotify-Youtube song matching algorithm, but I suggest using the default option (number 3). Algorithm number 1 should also work (though worse than 3). Do yourself a favor and avoid 0 and 2, they're awful.
Additional Information
While the tool runs, it logs useful information in a file created in the project directory: canzoniNO-MATCH.csv
. This file contains information about song mismatches, skipped songs, the number of songs to be transferred, and the number of songs that were actually transferred. It is a .csv file that can be opened as a text file or a table. To open it as a table, you can use Excel or Google Sheets, but you may need to change the separator from ;
to ,
in some cases. This can be done in Excel's settings.
Troubleshooting
- There's no Cancel button. To stop any process the tool may be performing, just close the window. You can re-open the window with the command used in Step7.
- The good old power off - power on is the best method to troubleshoot any issue.