This project contains useful tools for YouTube Music users:
- Exporting user's library to csv
- Listing duplicated songs
- Listing unavailable songs
- Tracking changes in user's library
- Exporting summary of transfer from GPM
- Download Zip file with app.
- Extract zip file.
Before starting, you will also have to provide header file to authenticate api requests to your YouTubeMusic account. Unfortunately, at least for now, it's a bit complicated, so please follow this guide:
- Open your desktop browser
Instructions for Firefox [CLICK]
-
Go to music.youtube.com
-
Login to your youtube account
-
Open developer tools by pressing 'F12' or 'Ctrl-Shift-I' and select the 'Network' tab
-
Click on Home panel in youtube music
-
In developer tools you should see new requests. Type '/browse' to filter.
-
Check if filtered request looks like this: Status 200, Method POST, Domain music.youtube.com
-
Copy the request headers (right click on filtered request > copy > copy request headers)
Instructions for Google Chrome [CLICK]
-
Go to music.youtube.com
-
Login to your youtube account
-
Open developer tools by pressing 'F12' or 'Ctrl-Shift-I' and select the 'Network' tab
-
Click on Home panel in youtube music
-
In developer tools you should see new requests. Type '/browse' to filter.
-
Check if filtered request looks like this: Status 200, Method POST, Domain music.youtube.com
-
Click on the Name of any matching request. In the
Headers
tab, scroll to the sectionRequest headers
and copy everything starting fromaccept: */*
to the end of the section
- Once you have copied request headers, run
YTMusicLibTracker.exe
- If it's your first time running app, you should this screen:
- Paste copied headers into terminal and press
enter
twice - That's all! Export of your library should start.
- Depending on the size of your library it may take up to a few minutes to complete the export.
- When it's done you should see the proper message:
- Press
Enter
to close application. - Go to the main application folder. Your whole library, uploaded songs and playlist has been exported and saved in CSV file.
With default settings you can find export results in
output\export
directory and changelog inoutput\changelog
.
The cookie you used for authentication should not expire, so the next time you run the app, you will be already logged in.
However, If you have any problems with authentication, remove headers_auth.json
file from main application folder and try to run YTMusicLibTracker.exe
again to update your cookie file.
After correct authentication, export of your library will start automatically.
Depending on the size of your library it may take some time to finish.
With default settings you can find the results in output\export
.
CSV file is using |
as column separator. It contains following columns:
Artists,Title,Album,VideoId,SetVideoId,Playlist,PlaylistId,IsAvailable
After successfull export, CSV file with changelog data will be created.
With default settings you can find it in output\changelog
directory.
Changelog will contain:
- Unavailable songs (On the playlists you can see them as greyed out)
- Duplicated songs from your playlists or library
- Songs that you added since last export
- Songs that you removed since last export
- Songs where metadata has been changed by youtube
- All other songs that has not been changed
If you want to change the account from you are importing data:
- Go to application's main folder.
- Remove
headers_auth.json
file if it exists. - Run
YTMusicLibTracker.exe
- You will be asked to paste request headers again, so repeat the procedure described in Authentication section. This time you should be logged in to your second youtube account.
Warning: For some users this feature can be unavailable as Google Play Music is shutting down and in some countries it's no longer accessible. So it won't be possible to export your GPM library. You can try to workaround it by opening GPM with deeper link instead of Home Page. For example this one: Go to GPM
If you want to compare export results from Google Play Music and see what happened after transferring your library to YTM:
- Run
YTMusicLibTracker.exe
and create export file. - Create csv file with exported google play music playlists using gmusis-playlist.js. (Check its documentation for details). Use Google Chrome as it may no longer work in firefox.
- Move that file to directory with export results (by default it's
/output/export
). - Open
config.ini
from app's main folder. - In
[Export]
section:- change
skip_export
option to1
- change
- In
[Changelog]
section:- change
auto_detect
option to0
- set
current_file
option as path to your export file from YTM (The one from first step) - set
previous_file
option as path to your export file from GPM (The one from second step)
- change
- Finally, you can run
YTMusicLibTracker.exe
again. Now created changelog will compare your GPM and YTM libraries. - Revert your
config.ini
file to default options, by replacing its content with this: Config.ini
With default behaviour, your youtube music library will be exported and changelog will be created based on comparison of current and previous exports.
If you want to compare specific files:
- Open
config.ini
file. - In
[EXPORT]
section changeskip_export
option to1
- In
[CHANGELOG]
section changeauto_detect
option to0
- In
[CHANGELOG]
section modifyprevious_file
andcurrent_file
with the paths to file you want to use in comparison - Save
config.ini
file.
If you'd like to contribute to the project or just run scripts directly from python see Documentation for Developers.
The project is using ytmusicapi created by @sigma67
This project is licensed under the MIT License - see the LICENSE file for details