diff --git a/cmd/brush/strategy/strategy.go b/cmd/brush/strategy/strategy.go index 3ecd380..548c988 100644 --- a/cmd/brush/strategy/strategy.go +++ b/cmd/brush/strategy/strategy.go @@ -42,6 +42,7 @@ type BrushSiteOptionStruct struct { Excludes []string ExcludeTags []string AllowAddTorrents int64 + AcceptAnyFree bool } type BrushClientOptionStruct struct { @@ -521,7 +522,7 @@ func RateSiteTorrent(siteTorrent *site.Torrent, siteOption *BrushSiteOptionStruc siteTorrent.Size > siteOption.TorrentMaxSizeLimit || (siteTorrent.DiscountEndTime > 0 && siteTorrent.DiscountEndTime-siteOption.Now < 3600) || (!siteOption.AllowZeroSeeders && siteTorrent.Seeders == 0) || - siteTorrent.Leechers <= siteTorrent.Seeders { + ((!siteOption.AcceptAnyFree || siteTorrent.DownloadMultiplier != 0) && siteTorrent.Leechers <= siteTorrent.Seeders) { score = 0 return } @@ -536,7 +537,7 @@ func RateSiteTorrent(siteTorrent *site.Torrent, siteOption *BrushSiteOptionStruc return } // 部分站点定期将旧种重新置顶免费。这类种子仍然可以获得很好的上传速度。 - if siteOption.Now-siteTorrent.Time <= 86400*30 { + if !siteOption.AcceptAnyFree && siteOption.Now-siteTorrent.Time <= 86400*30 { if siteOption.Now-siteTorrent.Time >= 86400 { score = 0 return @@ -598,6 +599,7 @@ func GetBrushSiteOptions(siteInstance site.Site, ts int64) *BrushSiteOptionStruc TorrentMaxSizeLimit: siteInstance.GetSiteConfig().BrushTorrentMaxSizeLimitValue, TorrentUploadSpeedLimit: siteInstance.GetSiteConfig().TorrentUploadSpeedLimitValue, AllowNoneFree: siteInstance.GetSiteConfig().BrushAllowNoneFree, + AcceptAnyFree: siteInstance.GetSiteConfig().BrushAcceptAnyFree, AllowPaid: siteInstance.GetSiteConfig().BrushAllowPaid, AllowHr: siteInstance.GetSiteConfig().BrushAllowHr, AllowZeroSeeders: siteInstance.GetSiteConfig().BrushAllowZeroSeeders, diff --git a/config/config.go b/config/config.go index 732c442..82f7ec8 100644 --- a/config/config.go +++ b/config/config.go @@ -170,6 +170,7 @@ type SiteConfigStruct struct { BrushAllowZeroSeeders bool `yaml:"brushAllowZeroSeeders"` BrushExcludes []string `yaml:"brushExcludes"` BrushExcludeTags []string `yaml:"brushExcludeTags"` + BrushAcceptAnyFree bool `yaml:"brushAcceptAnyFree"` SelectorTorrentsListHeader string `yaml:"selectorTorrentsListHeader"` SelectorTorrentsList string `yaml:"selectorTorrentsList"` SelectorTorrentBlock string `yaml:"selectorTorrentBlock"` // dom block of a torrent in list diff --git a/config/ptool.example.toml b/config/ptool.example.toml index bc3d332..6a6417a 100644 --- a/config/ptool.example.toml +++ b/config/ptool.example.toml @@ -68,6 +68,7 @@ cookie = 'cookie_here' #brushAllowHr = false # 是否允许使用HR种子刷流。程序不会特意保证HR种子的做种时长,所以仅当你的账户无视HR(如VIP)时开启此选项 #brushAllowZeroSeeders = false # 是否允许刷流任务添加当前0做种的种子到客户端 #brushExcludes = [] # 排除种子关键字列表。标题或副标题包含列表中任意项的种子不会被刷流任务选择 +#brushAcceptAnyFree = false # 如果种子是免费的,则上传人数下载人数比和发布种子时间rtime的规则不限制 #timezone = 'Asia/Shanghai' # 网站页面显示时间的时区 # 新版 m-team (馒头) 不支持 Cookie。必须使用 token 鉴权。两种方法选择其一: