Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ! Title: uBO Filter for YouTube Premium Members
- ! Description: This filter set resolves playback issues for Premium users while allowing procedural cosmetic filtering.
- ! ------------------------------------------------------------
- ! ============================================================
- ! 1. Disable forced variable assignment
- ! Stops the process of overwriting variables to "no ads" at the moment YouTube loads.
- ! For Premium members, this injection can cause player logic conflicts and playback bugs.
- ! ============================================================
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(set, ytInitialPlayerResponse.playerAds, undefined)
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(set, ytInitialPlayerResponse.adPlacements, undefined)
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(set, ytInitialPlayerResponse.adSlots, undefined)
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(set, playerResponse.adPlacements, undefined)
- ! ============================================================
- ! 2. Disable JSON data pruning
- ! Prevents the script from stripping ad-related sections out of the communication data.
- ! Ensures data integrity for Shorts and Premium environments.
- ! ============================================================
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(json-prune-fetch-response, reelWatchSequenceResponse.entries.[-].command.reelWatchEndpoint.adClientParams.isAd entries.[-].command.reelWatchEndpoint.adClientParams.isAd, , propsToMatch, url:/reel_watch_sequence?)
- m.youtube.com,music.youtube.com,tv.youtube.com,www.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(json-prune, entries.[-].command.reelWatchEndpoint.adClientParams.isAd)
- m.youtube.com,music.youtube.com,youtubekids.com,youtube-nocookie.com#@#+js(json-prune, playerResponse.adPlacements playerResponse.playerAds playerResponse.adSlots adPlacements playerAds adSlots important)
- ! ============================================================
- ! 3. Disable string replacement (trusted-replace)
- ! Stops the forced replacement of "adPlacements" with "no_ads" in network responses.
- ! This allows the browser to receive the original, unmodified data from YouTube.
- ! ============================================================
- tv.youtube.com#@#+js(trusted-replace-xhr-response, '"adPlacements"', '"no_ads"', /playlist\?list=|\/player(?:\?.+)?$|watch\?[tv]=/)
- www.youtube.com#@#+js(trusted-replace-fetch-response, '"adPlacements"', '"no_ads"', player?)
- www.youtube.com#@#+js(trusted-replace-fetch-response, '"adSlots"', '"no_ads"', player?)
- www.youtube.com#@#+js(trusted-replace-xhr-response, /"adPlacements.*?([A-Z]"\}|"\}{2\,4})\}\]\,/, , /playlist\?list=|\/player(?:\?.+)?$|watch\?[tv]=/)
- www.youtube.com#@#+js(trusted-replace-xhr-response, /"adPlacements.*?("adSlots"|"adBreakHeartbeatParams")/gms, $1, /\/player(?:\?.+)?$/)
- ! ============================================================
- ! 4. Whitelist network requests (@@)
- ! Excludes specific API communications from uBO's blocking/filtering.
- ! Interference with these APIs is a major cause of "infinite loading" or playback failure
- ! in Premium environments.
- ! ============================================================
- @@||www.youtube.com/playlist?list=$xhr,1p
- @@||www.youtube.com/watch?$xhr,1p
- @@||www.youtube.com/youtubei/v1/player?$xhr,1p
- @@||youtube.com/youtubei/v1/get_watch?$xhr,1p
- @@||googlevideo.com/initplayback?source=youtube&*c=TVHTML5&*oad=$xhr,domain=youtube.com
- ! 5. Normalize ad system status checks
- ! Prevents the player from crashing/stopping by redirecting failed ad scripts to a "dummy" success script.
- @@||doubleclick.net/instream/ad_status.js^$script,redirect-rule=doubleclick_instream_ad_status.js:5
- @@||doubleclick.net^$xhr,redirect-rule=noop.txt
- ! 6. Target-specific replacement filter bypass
- @@||youtube.com/youtubei/v1/get_watch?$xhr,1p,replace=/"adSlots"/"no_ads"/
- ! 7. Allow other ad-related scripts and domains
- ! Crucial for maintaining normal site behavior when not logged in or in certain regions.
- @@||m.youtube.com/*/ad.js$script
- @@||youtube.com/pagead/
- @@||google.com/pagead/1p-user-list/
Advertisement
Add Comment
Please, Sign In to add comment