Greasy Fork镜像 还支持 简体中文。

Youtube Search Filter

Remove garbage videos from Youtube search result page.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

/* cspell:disable pixelmon */

// ==UserScript==
// @version      1.2.2
// @name         Youtube Search Filter
// @name:zh-CN   Youtube 搜索过滤
// @namespace    https://tools.unoiou.com
// @author       Mingshi
// @description  Remove garbage videos from Youtube search result page.
// @description:zh-CN 从 Youtube 搜索页面移除特定用户上传的视频结果
// @copyright    2020, Mingshi
// @license      MIT

// @require      https://openuserjs.org/src/libs/sizzle/GM_config.min.js
// @require      https://gf.qytechs.cn/scripts/374849-library-onelementready-es6/code/Library%20%7C%20onElementReady%20ES6.js?version=649483

// @match        https://www.youtube.com/results?*
// @match        https://www.youtube.com
// ==/UserScript==
// jshint esversion:6
/* global onElementReady */

// read blocklist keywords
const configName = 'ytd-search-block-list';
GM_config.init({
  'id': configName,
  'title': 'Youtube Search Filtr Setting',
  'fields': {
    'blocklist': {
      'label': 'Block List',
      'type': 'textarea',
      'default': '',
      'title': 'Each line represents a keyword of block list.'
    }
  },
  'css': [
      '#ytd-search-block-list_field_blocklist {min-height: 400px;}'
  ]
})
// add config btn
var button = document.createElement('button');
button.innerHTML = "Search Filter";
button.style = "bottom:1em;right:1em;position:fixed;z-index: 9999;background:red;";
button.setAttribute('type', 'button');
button.addEventListener('click', function () {
  GM_config.open();
}, false);
document.body.appendChild(button);

const keywords = GM_config.get('blocklist').split('\n').filter(e => e.length > 0);

// for easy debug
unsafeWindow.onElementReady = onElementReady;

// runs on each time `ytd-video-renderer` loaded.
onElementReady('ytd-video-renderer', false, (el) => {
  keywords.forEach((keyword) => {
    if (el.querySelector('ytd-channel-name').textContent.toLowerCase().includes(keyword)) {
      el.remove();
      console.log('removed', keyword);
    }
  });
});

QingJ © 2025

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