feat(proxy): 支持品赞分组代理与自动白名单

This commit is contained in:
yml
2026-11-19 23:42:56 +08:00
parent 61ea79c7c9
commit 44a5b6c883
24 changed files with 2253 additions and 315 deletions
+11
View File
@@ -174,6 +174,7 @@ func defaultConfig() types.Config {
RetryStages: defaultRetryStages(),
SeckillMode: types.SeckillModeAggressive,
XiaodianPageSize: 200,
AccountsPerProxy: constants.DefaultAccountsPerProxy,
}
}
@@ -228,11 +229,21 @@ func LoadConfig(path string) types.Config {
if len(cfg.RetryStages) == 0 {
cfg.RetryStages = defaultRetryStages()
}
normalizeProxyConfig(&cfg)
normalizeXiaodianConfig(&cfg)
logger.LogEvent("配置", "success", "配置加载完成: %s", path)
return cfg
}
func normalizeProxyConfig(cfg *types.Config) {
if cfg.AccountsPerProxy <= 0 {
cfg.AccountsPerProxy = constants.DefaultAccountsPerProxy
}
if cfg.AccountsPerProxy > constants.MaxAccountsPerProxy {
cfg.AccountsPerProxy = constants.MaxAccountsPerProxy
}
}
// normalizeXiaodianConfig 约束和平小店分页参数,接口单页最大为 200。
func normalizeXiaodianConfig(cfg *types.Config) {
if cfg.XiaodianPageSize <= 0 || cfg.XiaodianPageSize > 200 {