Youtube Hide Recomended (English)

Automatically switches YouTube's recommendation column to either "From the series", "from (channel name)", or "Related"

  1. // ==UserScript==
  2. // @name Youtube Hide Recomended (English)
  3. // @name:ja YouTubeのリコメンド自動切換・非表示(英語環境用)
  4. // @version 2025-06-06
  5. // @description Automatically switches YouTube's recommendation column to either "From the series", "from (channel name)", or "Related"
  6. // @description:ja YouTubeのリコメンド欄を自動でFrom the series、from (チャンネル名)、Relatedのどれかに切り替えます
  7. // @author hirhirbyrd
  8. // @match https://www.youtube.com/*
  9. // @license MIT
  10. // @namespace https://gf.qytechs.cn/users/1467931
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16.  
  17. const observer = new MutationObserver(() => {
  18.  
  19. const chname = document.querySelector('.complex-string.ytd-channel-name.style-scope')
  20. const lists = document.querySelector('div#secondary-inner.style-scope.ytd-watch-flexy');
  21.  
  22. const elementC = document.querySelector('div#related iron-selector#chips yt-chip-cloud-chip-renderer:has(#text[title="From the series"])').querySelector('button');
  23. const elementA = document.querySelector('div#related iron-selector#chips yt-chip-cloud-chip-renderer:has(#text[title="From ' + chname.textContent + '"])').querySelector('button');
  24. const elementB = document.querySelector('div#related iron-selector#chips yt-chip-cloud-chip-renderer:has(#text[title="Related"])').querySelector('button');
  25.  
  26.  
  27. if (elementC) {
  28. if (elementC.getAttribute('aria-selected') === 'false') {
  29. lists.hidden = false;
  30. elementC.click();
  31. }
  32. } else if (elementA) {
  33. if (elementA.getAttribute('aria-selected') === 'false') {
  34. lists.hidden = false;
  35. elementA.click();
  36. }
  37. } else if (elementB) {
  38. if (elementB.getAttribute('aria-selected') === 'false') {
  39. lists.hidden = false;
  40. elementB.click();
  41. }
  42. } else {
  43. lists.hidden = true;
  44. return;
  45. }
  46.  
  47.  
  48. });
  49.  
  50. observer.observe(document, { childList: true, subtree: true });
  51. })();

QingJ © 2025

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