Remove Watched From Youtube Related Videos

Removes already watched videos from related videos.

  1. // ==UserScript==
  2. // @name Remove Watched From Youtube Related Videos
  3. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js
  4. // @namespace http://tampermonkey.net/
  5. // @version 0.1
  6. // @description Removes already watched videos from related videos.
  7. // @author Mithaldu
  8. // @match https://www.youtube.com/*
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. var run_count = 0;
  13.  
  14. function findwatched() {
  15. var progress_bar = $("ytd-thumbnail-overlay-resume-playback-renderer");
  16. if(!progress_bar.length) return;
  17. var step;
  18. for (step = 0; step < 5; step++) {
  19. var next = progress_bar.parent();
  20. if(!progress_bar.length) return progress_bar;
  21. progress_bar = next;
  22. }
  23. return progress_bar;
  24. }
  25.  
  26. function remove_watched() {
  27. run_count++;
  28. var watched = findwatched();
  29. while (watched) {
  30. watched.remove();
  31. watched = findwatched();
  32. }
  33. if(run_count == 20) return;
  34. setTimeout(arguments.callee, 1000);
  35. }
  36.  
  37. (function(){remove_watched()})(1000);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址