Merge pull request #793 from Egaliterrier/main

YouTube-X update fixing shorts ad-block
This commit is contained in:
aricloverGitHub 2024-11-17 08:55:14 -06:00 committed by GitHub
commit 883584b4cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -305,6 +305,14 @@ YTMainAppControlsOverlayView *controlsOverlayView;
%hook MDXSession
- (void)adPlaying:(id)ad {}
%end
%hook YTReelInfinitePlaybackDataSource
- (YTReelModel *)makeContentModelForEntry:(id)entry {
YTReelModel *model = %orig;
if ([model respondsToSelector:@selector(videoType)] && model.videoType == 3)
return nil;
return model;
}
%end
NSString *getAdString(NSString *description) {
if ([description containsString:@"brand_promo"])
return @"brand_promo";
@ -312,6 +320,8 @@ NSString *getAdString(NSString *description) {
return @"carousel_footered_layout";
if ([description containsString:@"carousel_headered_layout"])
return @"carousel_headered_layout";
if ([description containsString:@"eml.expandable_metadata"])
return @"eml.expandable_metadata";
if ([description containsString:@"feed_ad_metadata"])
return @"feed_ad_metadata";
if ([description containsString:@"full_width_portrait_image_layout"])