Update PoomSmart’s YouTube-X to v1.7.5

This commit is contained in:
aricloverGitHub 2024-11-12 19:18:43 -06:00 committed by GitHub
parent e2579163ef
commit b42ec297ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -222,6 +222,19 @@ YTMainAppControlsOverlayView *controlsOverlayView;
%hook YTIPlayerResponse
- (BOOL)isMonetized { return NO; }
%new(@@:)
- (NSMutableArray *)playerAdsArray {
return [NSMutableArray array];
}
%new(@@:)
- (NSMutableArray *)adSlotsArray {
return [NSMutableArray array];
}
%end
%hook YTIClientMdxGlobalConfig
%new(B@:)
- (BOOL)enableSkippableAd { return YES; }
%end
%hook YTAdShieldUtils
@ -249,15 +262,6 @@ YTMainAppControlsOverlayView *controlsOverlayView;
%hook MDXSession
- (void)adPlaying:(id)ad {}
%end
%hook YTReelInfinitePlaybackDataSource
- (void)setReels:(NSMutableOrderedSet <YTReelModel *> *)reels {
[reels removeObjectsAtIndexes:[reels indexesOfObjectsPassingTest:^BOOL(YTReelModel *obj, NSUInteger idx, BOOL *stop) {
return [obj respondsToSelector:@selector(videoType)] ? obj.videoType == 3 : NO;
}]];
%orig;
}
%end
%end
// uYou AdBlock Workaround (Note: disables uYou's "Remove YouTube Ads" Option) - @PoomSmart, @arichornlover & @Dodieboy
@ -268,6 +272,18 @@ YTMainAppControlsOverlayView *controlsOverlayView;
%end
%hook YTIPlayerResponse
- (BOOL)isMonetized { return NO; }
%new(@@:)
- (NSMutableArray *)playerAdsArray {
return [NSMutableArray array];
}
%new(@@:)
- (NSMutableArray *)adSlotsArray {
return [NSMutableArray array];
}
%end
%hook YTIClientMdxGlobalConfig
%new(B@:)
- (BOOL)enableSkippableAd { return YES; }
%end
%hook YTAdShieldUtils
+ (id)spamSignalsDictionary { return @{}; }
@ -289,14 +305,6 @@ YTMainAppControlsOverlayView *controlsOverlayView;
%hook MDXSession
- (void)adPlaying:(id)ad {}
%end
%hook YTReelInfinitePlaybackDataSource
- (void)setReels:(NSMutableOrderedSet <YTReelModel *> *)reels {
[reels removeObjectsAtIndexes:[reels indexesOfObjectsPassingTest:^BOOL(YTReelModel *obj, NSUInteger idx, BOOL *stop) {
return [obj respondsToSelector:@selector(videoType)] ? obj.videoType == 3 : NO;
}]];
%orig;
}
%end
NSString *getAdString(NSString *description) {
if ([description containsString:@"brand_promo"])
return @"brand_promo";