3 New Options

This is subject to change. Nothing has been tested.
This commit is contained in:
arichornlover 2023-10-15 03:58:49 -05:00 committed by GitHub
parent 19e771714b
commit 2c063e85a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -750,15 +750,6 @@ static void replaceTab(YTIGuideResponse *response) {
[self removeFromSuperview];
}
// Hide the Download Button under the Video Player - @arichorn
if ((IsEnabled(@"hideAddToOfflineButton_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.add_to_offline.button"])) {
self.hidden = YES;
self.userInteractionEnabled = NO;
[self sizeToFit];
[self setNeedsLayout];
[self removeFromSuperview];
}
// Hide the Comment Section under the Video Player - @arichorn
if ((IsEnabled(@"hideCommentSection_enabled")) && ([self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_teaser"] || [self.accessibilityIdentifier isEqualToString:@"id.ui.comments_entry_point_simplebox"] || [self.accessibilityIdentifier isEqualToString:@"id.ui.video_metadata_carousel"] || [self.accessibilityIdentifier isEqualToString:@"id.ui.carousel_header"])) {
self.hidden = YES;
@ -784,6 +775,37 @@ static void replaceTab(YTIGuideResponse *response) {
}
%end
%hook YTAsyncCollectionView
- (id)cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UICollectionViewCell *cell = %orig;
if ([cell isKindOfClass:NSClassFromString(@"_ASCollectionViewCell")]) {
_ASCollectionViewCell *asCell = (_ASCollectionViewCell *)cell;
NSString *result = [[[[asCell node] accessibilityElements] valueForKey:@"description"] componentsJoinedByString:@""];
// Hide Community Posts - @arichorn
if (IsEnabled(@"hideCommunityPosts_enabled") && [result rangeOfString:@"id.ui.backstage.post"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
}
if (IsEnabled(@"hideCommunityPosts_enabled") && [result rangeOfString:@"id.ui.backstage.original_post"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
}
// Hide all Shorts Videos in Channels - @arichorn
if (IsEnabled(@"hideShortsFromChannel_enabled") && [result rangeOfString:@"eml.shorts-video-item"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
}
// Hide the Download Button under the Video Player - @arichorn
if (IsEnabled(@"hideAddToOfflineButton_enabled") && [result rangeOfString:@"id.ui.add_to_offline.button"].location != NSNotFound) {
[self deleteItemsAtIndexPaths:@[indexPath]];
}
}
return cell;
}
%end
// App Settings Overlay Options
%group gDisableAccountSection
%hook YTSettingsSectionItemManager