Fix uYou’s Option not working

This commit is contained in:
arichornlover 2024-03-22 16:45:31 -05:00 committed by GitHub
parent 7121401d23
commit a075482b88
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,7 +104,7 @@ static NSString *accessGroupID() {
// Workaround: uYou 3.0.3 Adblock fix.
%hook YTSectionListViewController
- (void)loadWithModel:(YTISectionListRenderer *)model {
if ([@"removeYouTubeAds" boolValue]) {
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) {
NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = model.contentsArray;
NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer;
@ -119,7 +119,7 @@ static NSString *accessGroupID() {
%hook YTWatchNextResultsViewController
- (void)loadWithModel:(YTISectionListRenderer *)watchNextResults {
if ([@"removeYouTubeAds" boolValue]) {
if ([NSUserDefaults.standardUserDefaults boolForKey:@"removeYouTubeAds"]) {
NSMutableArray <YTISectionListSupportedRenderers *> *contentsArray = watchNextResults.contentsArray;
NSIndexSet *removeIndexes = [contentsArray indexesOfObjectsPassingTest:^BOOL(YTISectionListSupportedRenderers *renderers, NSUInteger idx, BOOL *stop) {
YTIItemSectionRenderer *sectionRenderer = renderers.itemSectionRenderer;