Simple-Tracker / qBittorrent-ClientBlocker

一款适用于 qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) 的客户端屏蔽器, 默认屏蔽包括但不限于迅雷等客户端. A client blocker compatible with qBittorrent/Transmission (Beta)/BitComet (Beta, Partial) which is prohibited to include but not limited to clients such as Xunlei.
MIT License
1.04k stars 26 forks source link

3.5b2版本配置文件blockListFile和ipBlockListFile选项问题 #118

Closed White-Clouds closed 2 months ago

White-Clouds commented 2 months ago

3.5b2版本配置文件中的blockListFileipBlockListFile配置文件名会报错:

[SetBlockListFromFile] 加载文件 (blockList.json) 时发生了错误: stat blockList.json: no such file or directory.
[SetIPBlockListFromFile] 加载文件 (ipBlockList.txt) 时发生了错误: stat ipBlockList.txt: no such file or directory.

但将配置转移到对应的blockListipBlockList中时程序正常运行。

{
  "blockList": ["blockList.json"],
  "blockListFile": [],
  "blockListURL": [
    "https://bta.iaalai.cn/qBittorrent-ClientBlocker/blockList.json"
  ],
  "portBlockList": [],
  "ipBlockList": ["ipBlockList.txt"],
  "ipBlockListURL": [
    "https://bta.iaalai.cn/BTN-Collected-Rules/combine/all.txt"
  ],
  "ipBlockListFile": [],
}

但是ipBlockList.txt会报错

[SetIPBlockListFromContent_Compile] :0 IP ipBlockList.txt 有错误.
[LoadConfig_CompileIPBlockList] IP %!s(bool=true) 有错误.

文件内容为:

// Credit: https://docs.qq.com/doc/DQnJBTGJjSFZBR2JW.
58.241.88.0/24
1.180.24.0/23
36.102.218.0/24
101.69.63.0/24
112.45.16.0/24
112.45.20.0/24
115.231.84.120/29
115.231.84.128/28
122.224.33.0/24
123.184.152.0/24
218.7.138.0/24
221.11.96.0/24
221.203.3.0/24
221.203.6.0/24
223.78.79.0/24
223.78.80.0/24
2002:df4e:4f00::/48
2002:df4e:5000::/48
2408:862e:ff:ff0d::/60
2408:8631:2e09:d05::/60
2408:8738:6000:d::/60
2409:873c:f03:6000::/56
240e:90c:2000:301::/60
240e:90e:2000:2006::/60
240e:918:8008::/48

同时示例配置里的ipBlockListURL选项中的https://bta.iaalai.cn/BTN-Collected-Rules/qBittorrent-ClientBlocker/ipBlockList.txt已经不指向该文件,应该去除。

amenomori commented 2 months ago

Same here. IMO it is by #116 which split single config.json into multiple files.

As for ipBlockList.txt, the ipBlockList.txt from the repo root starts with #. A change from the leading // to # may help.

White-Clouds commented 2 months ago

Same here. IMO it is by #116 which split single config.json into multiple files.

As for ipBlockList.txt, the ipBlockList.txt from the repo root starts with #. A change from the leading // to # may help.

//更改为#同样报错。

Changing // to # also reports an error.

ipBlockListURL中配置ipBlockList.txt的链接可以正常识别。

The link to ipBlockList.txt configured in ipBlockListURL can be recognized properly.

Simple-Tracker commented 2 months ago

感谢反馈!

在本机测试 blockListFile/ipBlockListFile 未出现报错问题, 屏蔽器默认会切换工作目录至程序目录, 这也是所有文件的基准路径. 因此, 须确保文件位于程序文件夹下. (绝对路径是未经测试且不被推荐的)

默认 config "blockList": ["blockList.json"] 是一个失误, 现已修正. 在 https://github.com/Simple-Tracker/qBittorrent-ClientBlocker/pull/119 合并后, 将发布新版本解决默认版本出现的问题.

White-Clouds commented 2 months ago

感谢反馈!

在本机测试 blockListFile/ipBlockListFile 未出现报错问题, 屏蔽器默认会切换工作目录至程序目录, 这也是所有文件的基准路径. 因此, 须确保文件位于程序文件夹下. (绝对路径是未经测试且不被推荐的)

默认 config "blockList": ["blockList.json"] 是一个失误, 现已修正. 在 #119 合并后, 将发布新版本解决默认版本出现的问题.

谢谢,我忘了把文件映射到docker里面。 Java敲傻了docker不会用了(