mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-01-11 22:40:19 +00:00
More YTNoTracking Improvements
Planning on trying to focus on YTNoTracking to take care of the other issues related to stripping Tracking Params & URLs.
This commit is contained in:
parent
4cb8c9b5da
commit
efe8503241
1 changed files with 50 additions and 3 deletions
53
uYouPlus.xm
53
uYouPlus.xm
|
|
@ -508,15 +508,62 @@ static void repositionCreateTab(YTIGuideResponse *response) {
|
|||
- (BOOL)enablePlayerBarForVerticalVideoWhenControlsHiddenInFullscreen { return YES; }
|
||||
%end
|
||||
|
||||
// YTNoTracking - https://github.com/arichorn/YTNoTracking/
|
||||
// YTNoTracking - @arichorn - https://github.com/arichorn/YTNoTracking/
|
||||
%hook YTICompactLinkRenderer
|
||||
+ (BOOL)hasTrackingParams { return NO; }
|
||||
+ (BOOL)hasTrackingParams {
|
||||
return NO;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTIReelPlayerOverlayRenderer
|
||||
+ (BOOL)hasTrackingParams { return NO; }
|
||||
+ (BOOL)hasTrackingParams {
|
||||
return NO;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTIShareTargetServiceUpdateRenderer
|
||||
+ (BOOL)hasTrackingParams {
|
||||
return NO;
|
||||
}
|
||||
%new
|
||||
- (id)removeParameterFromURL:(id)arg1 {
|
||||
NSURLComponents *components = [NSURLComponents componentsWithURL:arg1 resolvingAgainstBaseURL:NO];
|
||||
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (name == %@)", @"si"];
|
||||
NSArray<NSURLQueryItem *> *filteredQueryItems = [components.queryItems filteredArrayUsingPredicate:predicate];
|
||||
components.queryItems = filteredQueryItems;
|
||||
|
||||
NSURL *modifiedURL = components.URL;
|
||||
if (!modifiedURL) {
|
||||
modifiedURL = arg1;
|
||||
}
|
||||
return modifiedURL;
|
||||
}
|
||||
%end
|
||||
|
||||
int main(int argc, char * argv[]) {
|
||||
@autoreleasepool {
|
||||
NSURL *originalURL = [NSURL URLWithString:@"https://www.youtube.com/watch?v=your_video_id&si=abcd1234"];
|
||||
NSURLComponents *components = [NSURLComponents componentsWithURL:originalURL resolvingAgainstBaseURL:NO];
|
||||
NSMutableArray<NSURLQueryItem *> *queryItems = [NSMutableArray arrayWithArray:components.queryItems];
|
||||
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"NOT (name == 'si' OR name BEGINSWITH 'si=')"];
|
||||
[queryItems filterUsingPredicate:predicate];
|
||||
components.queryItems = queryItems;
|
||||
NSURL *cleanedURL = components.URL;
|
||||
|
||||
if (cleanedURL) {
|
||||
[[UIApplication sharedApplication] openURL:cleanedURL options:@{} completionHandler:^(BOOL success) {
|
||||
if (success) {
|
||||
NSLog(@"URL opened successfully!");
|
||||
} else {
|
||||
NSLog(@"Failed to open URL");
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// YTNoPaidPromo: https://github.com/PoomSmart/YTNoPaidPromo
|
||||
%hook YTMainAppVideoPlayerOverlayViewController
|
||||
- (void)setPaidContentWithPlayerData:(id)data {
|
||||
|
|
|
|||
Loading…
Reference in a new issue