Skip to content

Commit

Permalink
Update PoomSmart’s YouTube-X to v1.7.5
Browse files Browse the repository at this point in the history
  • Loading branch information
aricloverEXALT authored Nov 13, 2024
1 parent e257916 commit b42ec29
Showing 1 changed file with 25 additions and 17 deletions.
42 changes: 25 additions & 17 deletions Sources/uYouPlus.xm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 @{}; }
Expand All @@ -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";
Expand Down

0 comments on commit b42ec29

Please sign in to comment.