Package: ytmusic-deleter
If this project helped you and you want to thank me, you can get me a beer!ytmusic-deleterAn 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 uploadsDelete library songsDelete playlistsReset "Likes"You can also use it to sort your playlists.InstallationEasy InstallWindows users can download an .exe to install the YTMusic Deleter GUI (Graphical User Interface).Find the .exe file in theReleasesarea. 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.InstallPython. Make sure it is available on your PATH.Open a command prompt and typepip install ytmusic-deleter. Use avirtual environmentif you're familiar with the process.Run ytmusic-deleter by simply enteringytmusic-deleterat the command line.SetupThe 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 theytmusicapi docsunder "Copy authentication headers", orwatch 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 existingheaders_auth.jsonfile.(Advanced) Command-line setup instructionsIf you're running the command line (CLI) version of YTMusic Deleter, pressEnterafter 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 theheaders_auth.jsonfile that it generated. If you're running on macOS, you should create theheaders_auth.jsonfile 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-creationUsage (For the advance Command-line interface only)When you runytmusic-deleterwith 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. Note that each track that gets added to your library this way will have a thumbs up "Like" in your library due to how theytmusicapiworks.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 rundelete-uploads,remove-library,unlike-all, anddelete-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.ExamplesGetting help:ytmusic-deleter --helpThis will print the usage information forytmusic-deleterand exit.You can use the--helpargument to print usage information for subcommands as well, as follows:ytmusic-deleter delete-uploads --helpDelete all your uploads:ytmusic-deleter delete-uploadsDelete all your uploads but add them to your YouTube Music library first:ytmusic-deleter delete-uploads -aRemove all your library tracks (not uploads):ytmusic-deleter remove-libraryReset all Thumbs Up ratings back to neutral:ytmusic-deleter unlike-allDelete all your personally created playlists:ytmusic-deleter delete-playlistsRemove everything (uploads, library tracks, playlists, and unlike all songs):ytmusic-deleter delete-allSort a playlist calledWorkout Jams:ytmusic-deleter sort-playlist "workout jams"Extra optionsThese 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 barTroubleshootingytmusic-deleter: command not foundor'ytmusic-deleter' is not recognized as an internal or external command,

operable program or batch file.Make sure you ranpip install ytmusic-deleterto 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 theytmusicapithe 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.