YT Channel Query Fix

Remove external (channel) videos in queries.

目前为 2019-08-27 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name YT Channel Query Fix
  3. // @namespace youtube.scripts
  4. // @version 1.6
  5. // @description Remove external (channel) videos in queries.
  6. // @include *.youtube.com/user/*search*
  7. // @include *.youtube.com/channel/*search*
  8. // ==/UserScript==
  9.  
  10. (function() {
  11. 'use strict';
  12.  
  13. const INTERVAL = 1000;
  14.  
  15. const this_channel = location.href.match(/(.*)\//)[1];
  16. var last_count = 0;
  17. setInterval(() => {
  18. let nodes = document.querySelectorAll("ytd-item-section-renderer");
  19. if(nodes.length === last_count) { return; }
  20. last_count = nodes.length;
  21. for(let e of nodes) {
  22. let a = e.querySelector("#metadata a");
  23. if(!e.hidden && a.href != this_channel) {
  24. e.hidden = true;
  25. }
  26. }
  27. }, INTERVAL);
  28. })();

QingJ © 2025

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