ben-miles / playlist-cleaner

Remove all videos from YouTube playlist by Channel Name
Creative Commons Zero v1.0 Universal
0 stars 0 forks source link

Load All Videos #5

Open ben-miles opened 6 months ago

ben-miles commented 6 months ago

Ideally, my code should remove all videos from the playlist which match the search phrase, but for now it can only remove those videos which have been loaded. By default, YouTube shows only the first hundred videos, adding a hundred more every time the user scrolls to the bottom of the page. So, it might be good to investigate some means of loading all the videos in the playlist first. I've done this manually a handful of times and it gets very memory intensive... I experimented a bit with hiding all the video thumbnails (via CSS, using display: none) to see if that would alleviate the issue at all, but that was inconclusive. Perhaps there's a better way via JS, or some other approach entirely.

Barring any kind of real solution, it'd be wise to more clearly indicate to the user that this script is only working on those videos which have been loaded.

ben-miles commented 6 months ago

Trying out a JS solution (using element.remove() on all thumbnail images) wasn't really any better than the CSS solution. The problem with the browser becoming sluggish or entirely unresponsive when many (1000+) videos are shown likely just comes down to the size of the node list overwhelming the available memory.