YouTube View Filter

Remove YouTube videos below view threshold (1000 views)

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
trungung
日安装量
1
总安装量
11
评分
0 0 0
版本
1.0.0
创建于
2025-10-31
更新于
2025-10-31
大小
8.0 KB
许可证
MIT
适用于

YouTube View Filter 🎯

Hides YouTube videos below a configurable view count threshold.

YouTube recently started showing lots of low-quality, AI-generated videos with very few views on the homepage. This script filters them out.

Version: 1.0.0
Last Tested: October 31, 2025
Status: ✅ Working
Language Support: 🇺🇸 English only (other languages coming soon)

✨ Features

  • Configurable view threshold - Set your minimum view count (default: 1000)
  • Channel whitelist - Never filter videos from your favorite creators
  • Works across YouTube - Filters on home page, search results, and recommendations
  • Real-time filtering - Automatically processes new videos as they load
  • Debug logging - Optional console logging to see what's being filtered
  • Performance optimized - Efficient DOM monitoring and processing

⚙️ Configuration

Edit the script in your userscript manager to customize these settings:

const CONFIG = {
  viewThreshold: 1000, // Minimum view count (videos below this are hidden)
  enableLogging: true, // Show debug info in console (true/false)
  whitelistedChannels: [
    // Channels that should never be filtered
    // Add channel names here
    // Example: "PewDiePie", "MrBeast", "Kurzgesagt"
  ],
};

Configuration Examples

Only show videos with 10K+ views:

viewThreshold: 10000,

Whitelist your favorite channels:

whitelistedChannels: [
  "Veritasium",
  "3Blue1Brown",
  "Kurzgesagt",
],

Disable logging:

enableLogging: false,

🎬 How It Works

Technical Overview:

  1. Monitors the DOM - Uses MutationObserver to watch for new video elements added to the page
  2. Targets video containers - Looks for specific YouTube elements: ytd-rich-item-renderer, ytd-video-renderer, etc.
  3. Extracts view count - Searches aria-label attributes for view count data (e.g., "Video Title - 70K views - Channel")
  4. Parses with regex - Uses pattern matching to extract numbers like "70K", "1.2M", "169 watching" from aria-labels
  5. Compares to threshold - If view count < your configured threshold, marks video for removal
  6. Checks whitelist - Skips filtering if channel is in your whitelist
  7. Hides filtered videos - Sets display: none on video elements that don't meet criteria
  8. Runs on navigation - Re-processes videos when you navigate to new YouTube pages (it's a Single Page App)

Result: Low-view videos disappear from your feed in real-time as the page loads.

📝 Console Logging

When enableLogging is enabled, you'll see:

  • ✅ Loaded - Script initialized successfully
  • 🔍 Processing - Each video being checked
  • 🗑️ Removed - Videos that were filtered (title, channel, view count)
  • ℹ️ Info - General status messages
  • ⚠️ Warnings - Potential issues

📄 License

MIT License - See LICENSE for details

🤝 Contributing

Found a bug or have a suggestion? Please open an issue!


Note: This script modifies your YouTube browsing experience. Videos are hidden from view but not permanently deleted.