Skip to content

[YoutubeBridge] Add option to skip members-only videos - #5019

Open
polybjorn wants to merge 1 commit into
RSS-Bridge:masterfrom
polybjorn:youtube-skip-members-only-pr
Open

[YoutubeBridge] Add option to skip members-only videos#5019
polybjorn wants to merge 1 commit into
RSS-Bridge:masterfrom
polybjorn:youtube-skip-members-only-pr

Conversation

@polybjorn

@polybjorn polybjorn commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Members-only videos appear in a channel's JSON listing but can't be played without a paid membership, so they're noise in a feed reader. This adds an opt-in skip_members_only checkbox, default off, that drops them.

The filter can't live in FilterBridge: membership status isn't in the title or description, only in a BADGE_MEMBERS_ONLY badge in YouTube's raw JSON. Members-only items use the lockupViewModel layout (parsed since #4982), so wrapLockupViewModel returns null for any item carrying that badge.

Only the lockupViewModel shape carries the badge, so this applies to channel/user/custom listings on the JSON path (used when duration_min/duration_max is set). The Atom path already filters members-only server-side and ignores the parameter.

Test plan

Ran on 2026-06-29 against LMG (channel id UCXuqSBlHAE6Xw-yeJA0Tunw) on the JSON path:

  • Without the flag: 30 items.
  • With &skip_members_only=on: 23 items, the 7 members-only videos dropped, nothing else changed.

The 7 dropped ids match the BADGE_MEMBERS_ONLY markers in that channel's ytInitialData exactly. php -l passes.

The "By playlist Id" failure in the artifact table is pre-existing and fails identically on current; YouTube changed the playlist JSON shape. #5026 addresses it.

Adds an opt-in checkbox parameter `skip_members_only`, default off. When
enabled, items in the lockupViewModel JSON shape that carry a
`BADGE_MEMBERS_ONLY` badge are dropped, since they require a paid channel
membership to watch. With the option off the feed is unchanged.

Only affects the JSON path (when duration_min/duration_max is set); the
Atom path relies on YouTube's server-side filtering and ignores it.
@github-actions

Copy link
Copy Markdown

Pull request artifacts

Bridge Context Status
Youtube 1 By username (current) ✔️
Youtube 1 By username (pr) ✔️
Youtube 2 By channel id (current) ✔️
Youtube 2 By channel id (pr) ✔️
Youtube 3 By custom name (current) ✔️
Youtube 3 By custom name (pr) ✔️
Youtube 4 By playlist Id (current) Bridge returned error 0! (20633)
Type: ErrorException
Message: Undefined property: stdClass::$playlistVideoListRenderer
Youtube 4 By playlist Id (pr) Bridge returned error 0! (20633)
Type: ErrorException
Message: Undefined property: stdClass::$playlistVideoListRenderer
Youtube 5 Search result (current) ✔️
Youtube 5 Search result (pr) ✔️

last change: Monday 2026-06-29 18:03:58

@polybjorn
polybjorn marked this pull request as ready for review June 29, 2026 18:08
@polybjorn

Copy link
Copy Markdown
Contributor Author

Re-checked today on PHP 8.5. Channel context, flag off: 28 items. Flag on: 20. The 8 dropped ids match the BADGE_MEMBERS_ONLY markers in that channel's ytInitialData exactly, and nothing else changed.

Also merges cleanly on top of #5026, which touches different functions in the same file. That PR routes playlists through wrapLockupViewModel, so this filter would cover the playlist context too once it lands.

@Niehztog

Copy link
Copy Markdown
Contributor

@dvikan please consider merging in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants