mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
New Option uYou AdBlocking Workaround LITE
This commit is contained in:
parent
76e5a4a150
commit
be7f98d054
1 changed files with 27 additions and 0 deletions
|
|
@ -86,6 +86,33 @@ static int contrastMode() {
|
|||
}
|
||||
%end
|
||||
|
||||
// uYou AdBlocking Workaround LITE (This Version only removes ads from Videos/Shorts) - @PoomSmart
|
||||
%group uYouAdBlockingWorkaroundLite
|
||||
%hook YTReelInfinitePlaybackDataSource
|
||||
- (void)setReels:(NSMutableOrderedSet <YTReelModel *> *)reels {
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) {
|
||||
[reels removeObjectsAtIndexes:[reels indexesOfObjectsPassingTest:^BOOL(YTReelModel *obj, NSUInteger idx, BOOL *stop) {
|
||||
return [obj respondsToSelector:@selector(videoType)] ? obj.videoType == 3 : NO;
|
||||
}]];
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAdsInnerTubeContextDecorator
|
||||
- (void)decorateContext:(id)context {
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) {}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAccountScopedAdsInnerTubeContextDecorator
|
||||
- (void)decorateContext:(id)context {
|
||||
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) {}
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// uYou AdBlocking Workaround - @PoomSmart
|
||||
%group uYouAdBlockingWorkaround
|
||||
// Workaround: uYou 3.0.3 Adblock fix - @PoomSmart
|
||||
%hook YTReelInfinitePlaybackDataSource
|
||||
|
|
|
|||
Loading…
Reference in a new issue