ShenHongFei / utorrent-block-xunlei

A small script for uTorrent that blocks Xunlei(Thunder) clients automatically. uTorrent 自动屏蔽迅雷脚本
170 stars 20 forks source link

建议把定时清理ipfilter.dat写入脚本 #20

Closed lucktu closed 3 years ago

lucktu commented 3 years ago

时间上自己可以调整,例如一天、一小时、一分钟什么的,用秒来计算吧。

另外,为了减少读取ipfilter.dat对硬盘的影响,不知把这个文件挂在到内存怎么样?例如(ubuntu下): mount -o bind /run/user/0/ipfilter.dat /run/utorrent/ipfilter.dat

ShenHongFei commented 3 years ago

下个 release 版本支持 REPL, 可实时操控 utorrent 状态 或者执行 npx utorrent-block-xunlei 然后在窗口里粘贴以下代码

async function delay (milliseconds) {
    return new Promise( resolve => {
        setTimeout(resolve, milliseconds)
    })
}

;(async () => {
    while (true) {
        await delay(1000 * 间隔秒数)
        await utorrent.reset_ipfilter()
    }
})()
ShenHongFei commented 3 years ago

v2.2 增加了参数,可以指定间隔时间自动清除 ipfilter.dat

tzwken commented 3 months ago

使用golang开发,程序体积小,可满足你的需求。 https://github.com/tzwken/utorrent-block