Easily delete your YouTube Music library
Reason this release was yanked:
not ready for release
Project description
If this project helped you and you want to thank me, you can get me a beer!
ytmusic-deleter
An installable program for performing batch delete operations on your YouTube Music library. It's faster than browser-based / Javscript-based tools because it uses the YouTube Music API instead of performing the deletion in your browser. You can use this to do any of the following:
- Delete uploads
- Delete library songs
- Delete playlists
- Reset "Likes"
You can also use it to sort your playlists.
Installation
Easy Install
Windows users can download an .exe to install the YTMusic Deleter GUI (Graphical User Interface).
Find the .exe file in the Releases area. Just click the latest release and look at the Assets section.
Please note you may get a browser warning when downloading the file, and a Windows warning for installing files from an unknown publisher. It's not really worth the cost for me to buy a code signing certificate, so you will just have to accept the warning for now.
(Advanced) Command-line interface install using Python / PIP (for non-Windows users)
The CLI version of YTMusic Deleter is still available and is for advanced users who would rather use a command-line or aren't running Windows.
- Install Python. Make sure it is available on your PATH.
- Open a command prompt and type
pip install ytmusic-deleter
. Use a virtual environment if you're familiar with the process. - Run ytmusic-deleter by simply entering
ytmusic-deleter
at the command line.
Setup
The first time you run ytmusic-deleter, you will be asked to paste your request headers from Firefox. This allows ytmusic-deleter to make requests against your music library. To copy your request headers follow the instructions from the ytmusicapi docs under "Copy authentication headers", or watch the YouTube video above. If you're running the Windows graphical (GUI) version of ytmusic-deleter, just click OK after pasting the headers or selecting an existing headers_auth.json
file.
(Advanced) Command-line setup instructions
If you're running the command line (CLI) version of YTMusic Deleter, press Enter
after pasting the headers, then press Ctrl-D to continue (Ctrl-Z then Enter again on Windows). The next time you run ytmusic-deleter, it will reuse your headers from the headers_auth.json
file that it generated. If you're running on macOS, you should create the headers_auth.json
file manually, as the MacOS terminal application can only accept 1024 characters pasted to std input. Follow the instructions on the ytmusicapi here for "Manual file creation": https://ytmusicapi.readthedocs.io/en/stable/setup.html#manual-file-creation
Usage (For the advance Command-line interface only)
When you run ytmusic-deleter
with no parameters, you will see see the usage information. There are several commands available.
delete-uploads
: Delete all tracks that you have uploaded to your YT Music library.
Use the
--add-to-library
or-a
option to add each album or song to your library from YouTube Music's online catalog before deleting it from your uploads. If a match could not be found, the album or song will remain in your uploads. Note that each track that gets added to your library this way will have a thumbs up "Like" in your library due to how the ytmusicapi works.
remove-library
: Remove all tracks that you have added to your library from within YouTube Music.
unlike-all
: Reset all Thumbs Up ratings back to neutral.
delete-playlists
: Delete all manually created YT Music playlists.
delete-all
: Combo command that will run delete-uploads
, remove-library
, unlike-all
, and delete-playlists
.
Non-deletion commands:
sort-playlist
: Sort a playlist alphabetically by artist and then by song title.
Use the
--shuffle
or-s
option to shuffle the playlist instead of sorting it.
Examples
Getting help:
ytmusic-deleter --help
This will print the usage information for ytmusic-deleter
and exit.
You can use the --help
argument to print usage information for subcommands as well, as follows:
ytmusic-deleter delete-uploads --help
Delete all your uploads:
ytmusic-deleter delete-uploads
Delete all your uploads but add them to your YouTube Music library first:
ytmusic-deleter delete-uploads -a
Remove all your library tracks (not uploads):
ytmusic-deleter remove-library
Reset all Thumbs Up ratings back to neutral:
ytmusic-deleter unlike-all
Delete all your personally created playlists:
ytmusic-deleter delete-playlists
Remove everything (uploads, library tracks, playlists, and unlike all songs):
ytmusic-deleter delete-all
Sort a playlist called Workout Jams:
ytmusic-deleter sort-playlist "workout jams"
Extra options
These supplemental options are unlikely to be helpful for most use cases and are mainly to support the GUI version.
Options:
--version Show the version and exit.
-l, --log-dir TEXT Custom directory in which to write log files,
instead of current working directory.
-c, --credential-dir TEXT Custom directory in which to locate/create JSON
credential file, instead of current working
directory
-p, --static-progress Log the progress statically instead of an
animated progress bar
Troubleshooting
ytmusic-deleter: command not found
or
'ytmusic-deleter' is not recognized as an internal or external command,
operable program or batch file.
Make sure you ran pip install ytmusic-deleter
to install ytmusic-deleter. If you're still getting this error, try closing and re-opening your command prompt.
Failed loading provided credentials. Make sure to provide a string or a file path. Reason: Expecting value: line 1 column 1 (char 0)
You will see this printed by the ytmusicapi the first time you run. This means that your existing request headers file (headers_auth.json) could not be found. The next few lines will prompt you to paste your request headers so this file can be generated.
Other various exceptions may occur while running ytmusic-deleter because there is a wide swath of possible metadata on your library, and the YouTube Music backend is changing rapidly. Most errors deleting albums have been accounted for and you may just have to delete a couple albums manually that got left behind. If there are any errors that halt the entire program in the middle of deletion, please create an Issue and post the full error.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file ytmusic_deleter-2.0.4.tar.gz
.
File metadata
- Download URL: ytmusic_deleter-2.0.4.tar.gz
- Upload date:
- Size: 12.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.4 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55a4911b305fa59951721a95c028bde757b2bfffe92a802f72fa7619235cf30b |
|
MD5 | f7446c33f0da84f9b297eefbc7051da3 |
|
BLAKE2b-256 | 787d7fc62398a4fa05818ba0f9afd646445d616f1b758f91940e2c68133572f2 |
File details
Details for the file ytmusic_deleter-2.0.4-py3-none-any.whl
.
File metadata
- Download URL: ytmusic_deleter-2.0.4-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.12.4 CPython/3.11.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1cea1f8d4bcfe58e733d90f97be32abbd4eb24130a816ebe9483458751bbb78 |
|
MD5 | 210d00721107ef15acf6b26f5b68e014 |
|
BLAKE2b-256 | 3b04a52fbf41dd71335d04e4bbdc3754e0525d3f6eeeab3bfe004296d5b2c51e |