Skip to content

YouTube 頻道過濾器 | YouTube Channel Filter

Choose a tag to compare

@hubig21 hubig21 released this 13 May 04:09
· 7 commits to main since this release
7c35aaf

YouTube 頻道過濾器 v1.2.0 更新日誌

發布日期:2026-05-13
類型:🎨 UX 改善與架構準備

此版本為 Phase A 階段性釋出,包含 6 項使用者體驗改善以及為 v1.3.0 鋪路的架構準備。完全向後相容。


🎨 UX 改善

👁 觀看數標籤統一語義

過去使用「最少 / 最多」字眼,與「影片時長」、「上傳日期」兩個 section 的「低於 / 高於」語義不一致。本版統一為三者都用相同句式:

☑ 👁 觀看數
   低於設定值的影片不顯示             [ 1000  ]
   高於設定值的影片不顯示(0=不限)   [ 50000 ]

✅ 邏輯完全不變,只改顯示文字。

🔍 搜尋欄 Sticky + 清空鈕

過去列表往下捲動時,頂部的搜尋欄會跟著消失——超過 50 個條目時要回頭搜尋很麻煩。

本版改善:

  • 搜尋欄 sticky:永遠保持在面板頂部
  • 內嵌 ✕ 清空鈕:輸入框右側自動顯示,點擊一鍵清空並 focus 回輸入框
  • 影響範圍:🚫 隱藏名單、⭐ 白名單、🔤 關鍵字三個 Tab 的搜尋欄

🆕 新功能

👑 Members only / Members first 拆兩個獨立 toggle

過去 v1.1.2 把兩種會員影片合併處理(只有一個總開關)。現在可以分別控制:

☑ 👑 會員影片
   ☑ 隱藏會員專屬影片(Members only)
   ☑ 隱藏會員搶先看影片(Members first)

使用情境:

  • 兩個都關 → 完全不擋會員影片
  • 只擋 Members only → 接受 Members first,因為終究會公開可以等
  • 只擋 Members first → 完全拒絕「會員搶先看」的逼迫感,但會員專屬內容可以接受
  • 兩個都開 → 完全不想看任何會員內容

資料結構變更(自動 migrate 不需手動操作):

// 舊
member: { enabled: true }

// 新
member: { enabled: true, hideOnly: true, hideFirst: true }

升級後沒設定過的使用者:兩個子開關預設都開(與 v1.1.2 行為相同)。

📁 CSV 匯出/匯入支援 Regex 狀態

過去 CSV 匯出不記錄 isRegex 欄位 → 匯入後 Regex 模式全部變回 false,使用者要手動恢復。

本版:

  • 匯出新增 Regex 欄:1 代表啟用、0 代表停用
  • 匯入時自動還原:偵測 CSV 是否有 Regex 欄,有則套用
  • 向後相容:舊 CSV(沒有此欄)匯入時視為 false,不影響既有資料

影響範圍:隱藏名單 CSV、白名單 CSV。
(關鍵字 CSV 在 v1.0 起就已有此欄)


🛠 架構準備(為 v1.3.0 鋪路)

⭐ 頻道頁短路完整版

v1.1.2 的 F-6 只比對白名單的 name 欄與 @handle。本版擴充:

  1. 支援兩種 URL:
    • /@channelHandle ← v1.1.2 已支援
    • /channel/UCxxxxxxxxxxxxxxxxxxxxxxxx ← 新增
  2. 比對三欄任一命中:
    • id 欄
    • name 欄
    • handle 欄(為 v1.3.0 F-27 真正的 Channel ID 支援預留)
  3. 同時記錄當前頁面是否為:
    • 白名單頻道頁(既有)
    • 隱藏名單頻道頁(為 v1.3.0 F-20 強制阻擋網址訪問鋪路)

對使用者的可見影響:白名單頻道頁的短路偵測更準確——之前必須完全相符的頻道顯示名稱才能命中,現在 ID / handle 任一命中即可。

🎞 移除 Shorts 支援

YouTube Shorts 過濾已有專門腳本處理(如 Hide YouTube Shorts、UnHook 等),本腳本不重複造輪子。

改動:

  • 從 SEL_ARR 移除 4 個 Shorts 相關 selector(從 13 → 9 個)
  • Shorts 卡片完全不會被腳本偵測
  • 不影響任何其他功能

建議:搭配專門的 Shorts 過濾腳本使用。


🔄 i18n 變更

新增 keys(中英對稱)

Key 中文 English
filter.member.hideOnly 隱藏會員專屬影片(Members only) Hide Members-only videos
filter.member.hideFirst 隱藏會員搶先看影片(Members first) Hide Members-first (early-access) videos

文字修改

  • filter.member:「👑 會員專屬」→「👑 會員影片」(標題改泛用)
  • filter.views.min:「最少觀看」→「低於設定值的影片不顯示」
  • filter.views.max:「最多觀看(0=不限)」→「高於設定值的影片不顯示(0=不限)」
  • 英文同步更新

對稱性:ZH/EN 各 288 keys 完全對稱、0 循環、0 缺失、0 未使用


📋 v1.3.0 規劃中的功能

本版未處理但已排定 v1.3.0:

Issue 描述
F-15 快捷操作樣式二選一切換(快捷按鈕 ⇆ 三點選單注入)
F-20 隱藏名單強制阻擋網址訪問(即使透過直接網址也擋)
F-26 🆕 Block by Video ID(單支影片黑名單,可從 BlockTube 匯入)
F-27 🆕 真正的 Channel ID (UC...) 支援(頻道改 @handle / 改名後過濾仍生效)

v1.4.0 規劃中:

  • 大量名單效能(Set/Map 索引重構,預計 15× 提升)
  • CSS-only 隱藏路徑(整體執行速度優化)
  • 逐頁過濾範圍配置矩陣

升級注意

建議手動刪除 v1.1.2 舊版本後重新安裝 v1.2.0,確保 Tampermonkey 載入新版。

資料相容性:

  • 隱藏名單 / 白名單 / 關鍵字:完全保留
  • 會員過濾:若你曾啟用此功能,升級後 hideOnly 與 hideFirst 預設都開(同 v1.1.2 行為)
  • 觀看數設定:邏輯不變,只是 label 文字改寫
  • 舊 CSV 匯入:完全相容(不影響)

致謝

  • JourneyOver:建議 Members only / first 應分開控制、CSV 匯入應保留 Regex 狀態
  • Azazello:建議白名單頻道頁應有更完整的短路邏輯

連結

README 補充:不支援 Shorts 說明

此檔案內容用於插入 README-zh.md 與 README-en.md 中


中文版(README-zh.md 適合插入位置:FAQ 之前或之後)

❓ 不支援的功能

YouTube Shorts 過濾

YouTube Shorts(短影片)的過濾不在本腳本處理範圍內。Shorts 與一般影片有完全不同的 DOM 結構與沉浸式播放介面,已有專門腳本可處理:

推薦腳本 功能
Hide YouTube Shorts 完全隱藏所有 Shorts 卡片與 shelf
UnHook 移除 Shorts、推薦、留言等多種 YouTube 元素

搭配使用:可同時安裝本腳本與 Shorts 過濾腳本,互不衝突。本腳本專注於:

  • 一般影片(首頁、訂閱、搜尋、推薦、播放清單、片尾推薦)
  • 頻道過濾(隱藏名單 / 白名單)
  • 關鍵字過濾
  • 多維度過濾條件(時長、觀看數、上傳日期、語言、會員等)

合作影片頻道偵測

YouTube 的合作影片(Collab,標示「合作拍片參與頻道」)卡片 DOM 內完全沒有任何頻道資訊 —— 沒有 @handle、沒有 ytd-channel-name、沒有 channel/UC...。這是 YouTube 設計上故意如此(合作影片不掛單一頻道身份)。

影響:

  • ✅ 合作影片仍會被偵測為已處理,不會重複掃描
  • ❌ 但**無法注入「🚫 隱藏此頻道」「⭐ 加入白名單」**快捷按鈕
  • ❌ 無法用頻道名稱比對隱藏名單(因為沒有頻道資料)

workaround:

  • 透過關鍵字過濾擋下不想看的合作影片標題
  • 或進入合作影片後,從原作者頻道頁的 ⋮ 選單加入清單

YouTube Channel Filter v1.2.0 Changelog

Release date: 2026-05-13
Type: 🎨 UX Improvements & Architecture Preparation

Phase A release with 6 user-experience improvements and architectural preparation for v1.3.0. Fully backward-compatible.


🎨 UX Improvements

👁 View Count Labels Unified

Previously, the View Count section used "Minimum / Maximum" labels — inconsistent with "Video duration" and "Upload date" sections which use "below / above" semantics. This release unifies all three:

☑ 👁 View count
   Hide videos with views below this              [ 1000  ]
   Hide videos with views above this (0 = unlimited)  [ 50000 ]

✅ Logic unchanged, labels only.

🔍 Sticky Search Bar + Clear Button

Previously, when scrolling down a long list, the search bar would scroll out of view — extremely inconvenient when searching among 50+ entries.

This release:

  • Search bar is now sticky: always pinned to the panel top
  • Inline ✕ clear button: auto-appears when there's text, click to clear and refocus
  • Affected tabs: 🚫 Blocklist, ⭐ Whitelist, 🔤 Keywords

🆕 New Features

👑 Members only / Members first: Two Independent Toggles

v1.1.2 merged both types into a single master toggle. Now you can control them independently:

☑ 👑 Members videos
   ☑ Hide Members-only videos
   ☑ Hide Members-first (early-access) videos

Use cases:

  • Both off → don't filter any members content
  • Hide only only → accept first since they'll eventually go public
  • Hide only first → reject "members early access" pressure but accept members-only content
  • Both on → completely hide all members content

Data structure migration (automatic, no manual action needed):

// Old
member: { enabled: true }

// New
member: { enabled: true, hideOnly: true, hideFirst: true }

Users upgrading from v1.1.2: both sub-toggles default to on (matches v1.1.2 behavior).

📁 CSV Export/Import Supports Regex State

Previously, CSV exports did not record the isRegex field → after re-importing, all Regex modes were reset to false and users had to manually restore them.

This release:

  • Export adds a Regex column: 1 = enabled, 0 = disabled
  • Import auto-restores: detects whether the CSV has a Regex column and applies it
  • Backward compatible: old CSVs (without the column) treat all entries as isRegex=false

Affected: Blocklist CSV, Whitelist CSV.
(Keywords CSV has had this column since v1.0.)


🛠 Architectural Preparation (for v1.3.0)

⭐ Channel Page Short-Circuit — Complete Version

v1.1.2 F-6 only compared the whitelist's name field with @handle. This release extends:

  1. Supports both URL formats:
    • /@channelHandle ← supported since v1.1.2
    • /channel/UCxxxxxxxxxxxxxxxxxxxxxxxx ← new
  2. Matches against three fields (any match wins):
    • id
    • name
    • handle (reserved for v1.3.0 F-27 real Channel ID support)
  3. Also records whether current page is:
    • A whitelisted channel page (existing)
    • A blocked channel page (new — paves the way for v1.3.0 F-20 URL-based blocking)

User-visible impact: more accurate channel-page short-circuit detection. Previously the exact channel display name had to match; now any of ID / handle / name matching works.

🎞 Removed Shorts Support

YouTube Shorts filtering is already covered by specialized scripts (e.g., Hide YouTube Shorts, UnHook). This script no longer competes with them.

Changes:

  • Removed 4 Shorts-related selectors from SEL_ARR (13 → 9)
  • Shorts cards are no longer detected by this script
  • No impact on any other functionality

Recommendation: pair with a dedicated Shorts-filtering script.


🔄 i18n Changes

New keys (symmetric ZH/EN)

Key English 中文
filter.member.hideOnly Hide Members-only videos 隱藏會員專屬影片(Members only)
filter.member.hideFirst Hide Members-first (early-access) videos 隱藏會員搶先看影片(Members first)

Text changes

  • filter.member: "👑 Members-only" → "👑 Members videos" (more generic title)
  • filter.views.min: "Minimum views" → "Hide videos with views below this"
  • filter.views.max: "Maximum views (0 = unlimited)" → "Hide videos with views above this (0 = unlimited)"
  • Traditional Chinese synchronized

Symmetry: ZH/EN both have 288 keys, 0 circular references, 0 missing, 0 unused.


📋 Planned for v1.3.0

Not in this release but scheduled for v1.3.0:

Issue Description
F-15 Quick-action style toggle (Quick Buttons ⇆ Three-Dot Menu injection)
F-20 Blocklist URL-based blocking (block even when entering via direct URL)
F-26 🆕 Block by Video ID (single-video blocklist, importable from BlockTube)
F-27 🆕 Real Channel ID (UC...) support (filtering still works after channel renames its @handle/name)

Planned for v1.4.0:

  • Large-list performance (Set/Map index refactor, projected 15× speedup)
  • CSS-only hide path (overall execution speed optimization)
  • Per-page filter configuration matrix

Upgrade Notes

We recommend manually uninstalling v1.1.2 before installing v1.2.0 to ensure Tampermonkey loads the new version correctly.

Data compatibility:

  • Blocklist / Whitelist / Keywords: fully preserved
  • Members filter: if you previously had this enabled, both hideOnly and hideFirst default to on (matches v1.1.2 behavior)
  • View count settings: logic unchanged, only labels updated
  • Old CSV imports: fully compatible (no impact)

Acknowledgments

  • JourneyOver: suggested separating Members only / first toggles, and preserving Regex state in CSV
  • Azazello: suggested a more complete short-circuit logic for whitelisted channel pages

Links

English version (README-en.md, insert before/after FAQ)

❓ Unsupported Features

YouTube Shorts Filtering

YouTube Shorts filtering is out of scope for this script. Shorts have a completely different DOM structure and immersive playback interface; specialized scripts handle them well:

Recommended Script Function
Hide YouTube Shorts Completely hides all Shorts cards and shelves
UnHook Removes Shorts, recommendations, comments, and more

Use together: Both this script and a Shorts-filtering script can be installed simultaneously without conflict. This script focuses on:

  • Regular videos (Home, Subscriptions, Search, Recommendations, Playlists, Endscreen)
  • Channel filtering (Blocklist / Whitelist)
  • Keyword filtering
  • Multi-dimensional filters (duration, view count, upload date, language, members, etc.)

Collaboration Video Channel Detection

YouTube's collaboration videos (marked "Collab participating channels") have zero channel information in the DOM — no @handle, no ytd-channel-name, no channel/UC.... This is by YouTube's design (collab videos don't tie to a single channel identity).

Impact:

  • ✅ Collab cards are still marked as processed, no repeated scanning
  • ❌ But no "🚫 Block channel" / "⭐ Whitelist" quick-action buttons can be injected
  • ❌ Cannot match collab cards against the blocklist by channel name (no channel data)

Workarounds:

  • Use keyword filtering to block unwanted collab video titles
  • After clicking into a collab video, use the original creator's channel page ⋮ menu to add them to lists