ShenHongFei / utorrent-block-xunlei

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

建议在程式开启时自动清空ipfilter.dat内容 #4

Closed jsyzdej closed 3 years ago

jsyzdej commented 5 years ago

这个小工具时间开长了之后屏蔽了一堆ip,但是现在都是动态ip,肯定会有误伤,而且我也经常忘记去自己清空文件,对其他正常用户造成了很多不必要的损失

s-a-young commented 5 years ago

我是这样解决每天清空的:先建一个空的ipfilter.dat,每次启动都先启动复制替换。 @echo off xcopy /y /c /r C:\Users\Administrator\AppData\Roaming\uTorrent\uTorrentBlockXunlei\ipfilter.dat C:\Users\Administrator\AppData\Roaming\uTorrent\ nodejs\node.exe utorrent.js pause

tonyhsie commented 5 years ago

本來我也是想用批次檔來每天自動恢復乾淨 ipfilter.dat 的 不過批次檔好像沒辦法把原本的 node.exe 強制關閉? (沒仔細研究...)

後來乾脆用 C# 寫了一個小程式,搭配 Windows 的工作排程,就能每天定時自動還原 ipfilter.dat,完全不需要再手動執行了

使用說明:http://bbs.vcb-s.com/forum.php?mod=viewthread&tid=3872&page=2#pid45913

原始碼:https://pastebin.com/ft6tZP24

uTBlockXunlei.zip

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()
    }
})()
tzwken commented 3 months ago

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