ytmusic-deleter: Delete your YouTube Music library
This is the command-line interface for ytmusic-deleter. For the graphical user interface edition, visit the main page
Command-line interface install using Python / PIP
The CLI version of ytmusic-deleter is for advanced users who would rather use a command-line.
For the graphical user interface edition, visit the main page
Installation instructions of this command-line interface:
- 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-deleterat the command line.
Authentication (Browser)
The first time you run ytmusic-deleter, you will be asked to paste your request headers from your browser. This allows ytmusic-deleter to make requests against your music library. Follow the instructions in the ytmusicapi documentation or my sign-in video tutorial to copy your request headers to your clipboard, then paste them into the terminal window and press the shown key sequence.
$ ytmusic-deleter whoami
[2024-11-16 12:51:05] Attempting authentication with: C:\Users\<username>\AppData\Roaming\YTMusic_Deleter\browser.json
[2024-11-16 12:51:05] Creating file: browser.json
Please paste the request headers from Firefox and press 'Enter, Ctrl-Z, Enter' to continue:
If you are running macOS, please see the special pasting instructions in the "macOS special pasting instructions" section of the ytmusicapi docs.
Usage
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-libraryor-aoption 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. When using the-aoption, you can also use the--score-cutoffor-soption to raise or lower the default matching score cutoff of 85. A value closer to 100 will be more strict, and a value closer to 0 will be less strict.
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
--shuffleor-soption to shuffle the playlist instead of sorting it.
Use--custom-sortor-cto define custom sort parameters Available parameters are:artist,album_title,track_title, andduration. See below for examples.
Use--reverseto reverse the sort order.
remove-duplicates: Remove duplicate tracks from a particular playlist.
Use the
--exactor-eoption to only remove exact duplicates. This will skip the portion that checks for duplicates that are similar matches but not the same exact track.
add-all-to-playlist: Add all library songs or uploads to a particular playlist.
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 using the default settings (sorts by artist then album title):
ytmusic-deleter sort-playlist "workout jams"
Sort a playlist using custom sorting attributes (attributes are applied in order):
ytmusic-deleter sort-playlist "workout jams" --custom-sort artist --custom-sort album_title --custom-sort track_title
Remove duplicate tracks from a playlist called "Focus"
ytmusic-deleter remove-duplicates focus
Add all uploads to a playlist called "All my uploads"
ytmusic-deleter add-all-to-playlist "All my uploads" --uploads
Add all songs from a playlist to your library
ytmusic-deleter add-all-to-library "Sample Playlist"
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.
Metadata
Release files for ytmusic-deleter 4.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ytmusic_deleter-4.3.2.tar.gz | 43.2 kB | With provenance | Details for ytmusic_deleter-4.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ytmusic_deleter-4.3.2-py3-none-any.whl | Python 3 | none | any | Details for ytmusic_deleter-4.3.2-py3-none-any.whl |
Total release size: 78.3 kB
Release files / ytmusic_deleter-4.3.2.tar.gz
| Download URL | ytmusic_deleter-4.3.2.tar.gz |
|---|---|
| Size | 43.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
369550bf8fe48e2cb778b11926643c1db9ee198d678de3610c894bf5ae02d22e
|
|
BLAKE2b-256 checksum How to use checksums |
533eecf41f8fb31ff9847cae2a93b05bfdc41ab33e8f1864e76ec7df8cbf61e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logRelease files / ytmusic_deleter-4.3.2-py3-none-any.whl
| Download URL | ytmusic_deleter-4.3.2-py3-none-any.whl |
|---|---|
| Size | 35.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41da74bc5a7ec3c199d1cd9ec9ed995b1baf5b800fe3ab432bd6ec413fc9068c
|
|
BLAKE2b-256 checksum How to use checksums |
aa34c911b3fa576c950148a0bd0f6a2faab4fa8692d7387603b94ad9283e16e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logSecurity for ytmusic-deleter 4.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ytmusic_deleter-4.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 8, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.