Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 32 additions & 13 deletions DYYY.xm
Original file line number Diff line number Diff line change
Expand Up @@ -4816,7 +4816,6 @@ static NSHashTable *processedParentViews = nil;
}
%end

// 推荐页数组级过滤(直播 / 时间 / 低赞)
%hook AWEHotListDataController

%new
Expand Down Expand Up @@ -4860,16 +4859,16 @@ static NSHashTable *processedParentViews = nil;
static NSArray<NSString *> *diggKeyPaths = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
diggKeyPaths = @[
@"statistics.diggCount",
@"statistics.digg_count",
@"diggCount",
@"digg_count",
@"feedSequenceExtendFeature.digg_count",
@"feedSequenceExtendFeature.diggCount",
@"recommendFeedExtendFeature.digg_count",
@"recommendFeedExtendFeature.diggCount"
];
diggKeyPaths = @[
@"statistics.diggCount",
@"statistics.digg_count",
@"diggCount",
@"digg_count",
@"feedSequenceExtendFeature.digg_count",
@"feedSequenceExtendFeature.diggCount",
@"recommendFeedExtendFeature.digg_count",
@"recommendFeedExtendFeature.diggCount"
];
});

for (NSString *keyPath in diggKeyPaths) {
Expand Down Expand Up @@ -4899,11 +4898,13 @@ static NSHashTable *processedParentViews = nil;
NSInteger daysThreshold = DYYYGetInteger(@"DYYYFilterTimeLimit");
BOOL skipLive = DYYYGetBool(@"DYYYSkipLive"); // 读取直播过滤开关
NSInteger minLikesThreshold = DYYYGetInteger(@"DYYYFilterLowLikes"); // 读取低赞过滤阈值 (例如: 1000)
BOOL skipPhotoText = DYYYGetBool(@"DYYYSkipPhotoText"); // 图文过滤
BOOL skipPhoto = DYYYGetBool(@"DYYYSkipPhoto"); // 图集过滤

NSTimeInterval now = [[NSDate date] timeIntervalSince1970];
NSTimeInterval thresholdInSeconds = MAX(daysThreshold, 0) * 86400.0;

// 第一阶段:先做稳定字段过滤(直播/时间)
// 第一阶段:先做稳定字段过滤(直播/时间/类型
NSMutableArray *baseFiltered = [NSMutableArray arrayWithCapacity:orig.count];

for (id obj in orig) {
Expand All @@ -4925,6 +4926,24 @@ static NSHashTable *processedParentViews = nil;
continue; // 命中直播过滤,跳过
}

// 2.1 图文模式过滤逻辑(推荐页)
if (skipPhotoText &&
[m respondsToSelector:@selector(isNewTextMode)] &&
m.isNewTextMode &&
[m respondsToSelector:@selector(referString)] &&
[m.referString isEqualToString:@"homepage_hot"]) {
continue; // 图文模式且来自推荐页,跳过
}

// 2.2 图集过滤逻辑(推荐页)
if (skipPhoto &&
[m respondsToSelector:@selector(awemeType)] &&
m.awemeType == 68 &&
[m respondsToSelector:@selector(referString)] &&
[m.referString isEqualToString:@"homepage_hot"]) {
continue; // 图集且来自推荐页,跳过
}

// 3. 时间限制过滤
if (daysThreshold > 0 && [m respondsToSelector:@selector(createTime)]) {
NSTimeInterval vTs = [m.createTime doubleValue];
Expand Down Expand Up @@ -5117,7 +5136,7 @@ static NSHashTable *processedParentViews = nil;
}
}
}
return shouldFilterAds || shouldFilterAllLive || shouldFilterHotSpot || shouldskipPhoto || shouldskipPhotoText || shouldFilterMusic || shouldFilterAIInteraction || shouldFilterHDR || shouldFilterKeywords || shouldFilterProp ||
return shouldFilterAds || shouldFilterAllLive || shouldFilterHotSpot || shouldFilterHDR || shouldFilterKeywords || shouldFilterProp ||
shouldFilterTime || shouldFilterUser;
}

Expand Down
Loading