Skip to main content

PeerID Filter

The PeerID filter detects using the PeerID actively reported by the Peer. For clients with a built-in PeerID filter (e.g., qBittorrent Enhanced Edition), it is recommended to use their built-in PeerID filtering feature first.

warning

The PeerID is reported by the Peer itself (and can be modified at will), so it cannot be used as the sole basis for determining the client.

peer-id

Configuration File

The rules use the JSON rule engine syntax.

Configuration File

  # PeerId 封禁
# 此模块对 Transmission 不起效
# PeerID blacklist
# The module may not work well with Transmission
peer-id-blacklist:
enabled: true
# 封禁时间,单位:毫秒,使用 default 则跟随全局设置
# BanDuration, Timeunit: ms, use `default` to fallback to global settings
ban-duration: 259200000
# method = 匹配方式 - Match Method
# + STARTS_WITH = 匹配开头 - Match the starts
# + ENDS_WITH = 匹配结尾 - Match the ends
# + LENGTH = 匹配字符串长度 - Match the string length
# + 支持的额外字段 - Other supported fields
# * min = 最小长度 - Min length
# * max = 最大长度 - Max length
# + CONTAINS = 匹配包含 - Match the contains
# + EQUALS = 匹配相同 - Match the equals
# + REGEX = 匹配正则表达式(大小写敏感) - Match the regex (case-sensitive)
# content = 匹配的内容(除正则外忽略大小写) - The content will be matched
# if = 表达式控制器,当 if 的表达式为 true 时,则检查此规则;否则此规则被忽略。 # if controller, `0` or `false` will skip this rule
# + if 表达式可以为 true/false, 1/0 或者一个嵌套的规则 # the return result can be `true` or `false` and `0` or `1`
# hit = 匹配成功返回的行为代码 # the behavior if matched
# + TRUE = 在 if 中代表 true,在规则中代表 BAN(封禁) # true in if controller, BAN in rule
# + FALSE = 在 if 中代表 false,在规则中代表 SKIP(排除) # false in if controller, SKIP in rule
# + DEFAULT = 在 if 中代表 true,在规则中代表 NO_ACTION(默认行为) # true in if controller, NO_ACTION in rule
# miss = 匹配失败返回的行为代码(与上相同) # the behavior if match failed, same as above
# 规则从上到下执行
banned-peer-id:
- '{"method":"STARTS_WITH","content":"-xl"}'
- '{"method":"STARTS_WITH","content":"-hp"}'
- '{"method":"STARTS_WITH","content":"-xm"}'
- '{"method":"STARTS_WITH","content":"-dt"}'
- '{"method":"CONTAINS","content":"-rn0.0.0"}'
- '{"method":"STARTS_WITH","content":"-sd"}'
- '{"method":"STARTS_WITH","content":"-xf"}'
- '{"method":"STARTS_WITH","content":"-qd"}'
- '{"method":"STARTS_WITH","content":"-bn"}'
- '{"method":"STARTS_WITH","content":"-dl"}'
- '{"method":"STARTS_WITH","content":"-ts"}'
- '{"method":"STARTS_WITH","content":"-fg"}'
- '{"method":"STARTS_WITH","content":"-tt"}'
- '{"method":"STARTS_WITH","content":"-nx"}'
- '{"method":"CONTAINS","content":"cacao"}'