Skip to content

uNople/YoutubePlaylistManager

Repository files navigation

YouTube cleanup tool

What is it

A tool to manage playlists locally - then sync those changes to the YouTube api

I made this initially to clean google play music / YouTube music likes out of the liked YouTube playlist

I'm actively developing this on my stream - come check it out

Why

It's super slow to do anything with playlists, especially when they're massive like mine - so a local tool is way quicker

I also wanted a good way of finding out if a 'video' was actually music, so I could separate my youtube likes with the youtube music likes. Unfortunately there's no good way of telling - see the General notes section

There's a third reason - I would like to be able to see what things were before they were deleted / made private by people, so this can act like a local cache and preserve video titles, thumbnails, description etc for a video after it's been deleted

What's currently implemented

A WPF UI to handle adding/removing videos to/from playlists

  • Has thumbnails etc to show data of what you're editing
  • Has dark mode + pink mode

How to run

First, you need a api key, and a oauth key.

  1. In the YouTubeCleanupWpf folder, run dotnet user-secrets set "AppSettings.ApiKey" "myapikeyhere"
  2. Download the JSON for your oauth, and put it in the place that's specified in the app's settings - eg, c:\temp\client_secret.json

Dev notes

If you're adding logging for anything that inherits from IData - use ExtensionMethods.DisplayInfo() to display in Title - (Id asdasf) format

How to add migrations

  1. Make your change in YouTubeCleanupTool.Domain
  2. Go to package manager console in visual studio
  3. Change project to YouTubeCleanupTool.DataAccess
  4. Add-Migration MigrationName

General notes

  • The "playlists" returned from YouTube are a mix of YouTube and YouTube music / imported google play music
  • YouTube somehow knows how to hide "music" ones
  • The Like playlists aren't returned at all (which is why in code I get the LL and LM playlists by name)
    • Liked playlist for YouTube is LL. Liked for YouTube music is LM
    • Watch later is another hard coded playlist. Code for that is WL
      • Unfortunately, The YouTube data api depreciated this in v3, sometime in 2016 ref
  • We can get thumbnails for the playlists. Some playlists don't have thumbnails (eg, one or more videos got deleted)
  • There seems to to be no way of differentiating between music and video
  • Uploaded music migrated from google play is all private - and not accesible on YouTube - even though the playlist is on YouTube
  • There's an option in https://music.youtube.com - click your profile icon -> settings -> unselect "Show your liked music from YouTube". You can then use the LM playlist to act as the "delete from LL playlist" list
  • Deleting a YouTube music like deletes it from your YouTube likes and vice-versa. DISAPPOINTED!
  • When getting a video, the following seems to indicate if it's music
    • contentDetails.licensedContent == true -> the ones with "Provided to YouTube by...Auto-generated by YouTube." in the description"
    • topicDetails.topicCategories -> contains https://en.wikipedia.org/wiki/Music is a potential indicator
  • But... none of the above really matters. YouTube data api doesn't indicate if something's really music or not. Even if something's not in the cateory, etc it could be playable on YouTube music probably due to ContentId or flagging.
  • When editing a playlist on YouTube, it reuses IDs when you remove + add another video to the playlist

Notes on differentiating music and video

The 'best' way is to match the description, and check it matches the pattern "Provided to YouTube by.*Auto-generated by YouTube."

Category comes next - having the music category is a good indicator that the video should be playable on YouTube music

But, there's no guarantee that it's 'only' music - there seems to be no way of telling if something is music-only, and not playable on YouTube proper

Also, when you remove a video from the YouTube likes playlist, and it's designated music, it gets removed from the LL (YouTube Music liked playlist)

Potentially... you could like a video, and check to see if it appears in the LL playlist. If it does, then it's MUSIC.

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages