Skip to content

Commit

Permalink
fix: add missing blocking logic for specific video sections in ASText…
Browse files Browse the repository at this point in the history
…Node
  • Loading branch information
castdrian committed Dec 24, 2024
1 parent f3bbf36 commit 5afb907
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions Util.m
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ + (void)extractVideoInfoFromNode:(id)node
+ (BOOL)nodeContainsBlockedVideo:(id)node {
__block BOOL isBlocked = NO;

if ([node isKindOfClass:NSClassFromString(@"ASTextNode")]) {
NSAttributedString *attributedText = [(ASTextNode *)node attributedText];
NSString *text = [attributedText string];

if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GonerinoPeopleWatched"] &&
[text isEqualToString:@"People also watched this video"]) {
NSLog(@"[Gonerino] Blocking 'People also watched' section");
return YES;
}

if ([[NSUserDefaults standardUserDefaults] boolForKey:@"GonerinoMightLike"] &&
[text isEqualToString:@"You might also like this"]) {
NSLog(@"[Gonerino] Blocking 'You might also like' section");
return YES;
}
}

if ([node isKindOfClass:NSClassFromString(@"YTInlinePlaybackPlayerNode")]) {
[self
extractVideoInfoFromNode:node
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: dev.adrian.gonerino
Name: Gonerino
Version: 1.0.0
Version: 1.0.1
Architecture: iphoneos-arm
Description: Remove videos uploaded by specific channels
Maintainer: Adrian Castro
Expand Down

0 comments on commit 5afb907

Please sign in to comment.