feat(feed): max video age filter, Members-only filter, membership badge fixes #49
Loading…
Reference in a new issue
No description provided.
Delete branch "refs/pull/49/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Adds two feed-filtering settings and repairs membership badge detection, which had silently stopped working against YouTube's current markup.
Started as "is the filter catching this members-only shelf?" — the answer was no, for three independent reasons, one of which turned out to be a live bug affecting an existing feature.
Fixes
Badge detection was dead. Labels now render in
.ytBadgeShapeText. The code still looked for.yt-badge-shape__text,.badge-shape-wiz__textand[class*="badge-style-type"]— none of which match anything on the page any more — so Hide Members first videos was matching nothing at all.CHANGELOG.md:88shows this happened once before: a.badge-shape-wiz__textguess logged as "best-effort; pending live confirmation" that was never confirmed. Current selectors added alongside the legacy ones.Badge labels were English-only, unlike
SIDEBAR_RULES,RELATED_RESULT_LABELSandparseViewCount, so the membership filters did nothing on a NL/DE/FR YouTube while neighbouring filters worked. Now cover all four. The two token lists are mutually exclusive so the settings cannot trigger on each other; the French tokens avoid the apostrophe in "Membres d'abord" because YouTube may render it as a typographic’.Added
>, so a 5-year limit keeps "5 years ago" and drops "6 years ago"./channel_memberships, so the existing/premiumbrand-shelf rule never covered it, and its items areytd-rich-grid-mediarather than feed items, so the per-item filters could not reach them either.Also
.DS_Store. It was committed before.gitignorelisted it, so the ignore rule never applied and it showed dirty on every checkout.All three filters honour the Trusted channels allowlist.
Notes for review
"1.2M views • 3 years ago"would otherwise read2m, fail to recognise the unit, and give up before reaching the date.setManagedHiddenrecordsfyOriginalDisplayfrom the live style, so a second key claiming an already-hidden element would storedisplay: noneas its "original" and the item would never come back. Collapsed to onemembership-feed-itemkey.Test plan
npm test— 24/24FEED_ITEM_SELECTORreachability,:has()rule matches the shelf and not ordinary rows, regression guard confirming the old selectors match zero elements1.2M views,1,234 views,1,2 Mio. Aufrufe,21:31,LIVE) correctly return null, combined metadata lines, cut-off boundariesThe harness is not committed — it lives in a scratchpad and needs jsdom, which would be the project's first devDependency. Promoting it to
test/*.test.jsis worth doing separately;test/currently covers only SponsorBlock, so the entire DOM-facing surface — the largest and most fragile part — has no coverage.