蓝影论坛 Logo
85浏览量
2参与者
活动 32天
✨这是 stylle 首次发帖 - 让我们欢迎他/她加入社区吧!
stylle
楼主
**# 1、简要** 编写这个脚本的初衷就是,我希望一套规则可以应用于所有的站点,也就是我购买了盒子过后我可以直接不管刷什么站都用这一套规则,在一个下载器中可以刷多个站点,类似一些需要保种24h、36h刷法的、三倍分享率刷法的、五倍分享率刷法的各不同站点的规则都可以直接通用,本套规则主要是基于盒子使用,家宽的删种规则不太一样,我的宽带条件不太好所以没办法来编写测试,推荐把VT部署到自己的NAS上来运用这套规则,后续只需要替换下载器的IP就可以直接开刷。 ![image|690x281](https://hdblue.cc/uploads/discourse-public/5e/5ed1edc38f92b750816977cbd9b5f45a5809d691385b1d8321fe1cab95a6076e-1651.png) **# 2、compose-docker部署vt** \`\`\`ts version: "3.9" services: vertex: image: lswl/vertex:stable container_name: vertex hostname: vertex restart: unless-stopped ports: - "23001:3000" environment: TZ: Asia/Shanghai # 刷内站用这个时区,外站需要可能需要更换 volumes: - /vol1/1000/05_Cache/vertex:/vertex # 替换一下你的路径 logging: driver: json-file options: max-size: "20m" max-file: "5" \`\`\` **# 3、规则解析** 这套规则用法和网上常规的有一些区别,我把它拒绝删种和删种规则分开来写,常规的规则依旧可以编写到删种规则中,例如慢车、黑车、空间小速度慢、低收益、分享率等常见删种规则,在这套规则上新增一套拒删规则,当某一些站点不能频繁跳车或者需要保种刷或者不限制倍率的站点可以建立该站点的规则,例如皇后需要保种36h那我们就建立一个规则分类==OPENCD 时间<37\\\*3600的拒删条件,当删种规则触发后会被这个拒绝规则拒绝删除就可以达到保种的目的,当超过这个时间删种规则就可以删除这个种子,这里可能会有一个bug当拒删条件不成立过后删种规则要是没有能触发的就没办法删种了,目前没遇到这个情况,但是可以建立规则12-24-36-72小时当大于这些时间就触发删种规则保种种子不意外停留,这就是我这套规则的大概思路,下面分享几个常见删种规则,最后我会附上我的vt备份,当docker装好后,可以直接点击系统设置-》备份还原-》恢复-》选择我给的文件导入即可使用默认账号密码admin:123; **## 3.1 低收益** \`\`\`ts //当下载任务超过 10 个时,如果某个普通分类(非 KEEP)的种子正在下载,下载进度处于 20%~30%,分享率不超过 0.4,并且上传速度不超过 1 MiB/s,就认为它收益较低,自动删除,为其他下载任务腾出资源。 (maindata, torrent) => { const categoryList = \["keep", "KEEP"\]; const stateList = \["downloading", "stalledDL"\]; const { state, ratio, progress, category, uploadSpeed, downloadSpeed } = torrent; if (categoryList.indexOf(category) !== -1 || maindata.leechingCount <= 10) { return false; } if ( stateList.indexOf(state) !== -1 && progress >= 0.2 && progress <= 0.3 && ratio <= 0.4 && uploadSpeed <= util.calSize(1, "MiB") ) { return true; } return false; }; \`\`\` **## 3.2 删种-空间 { const categoryList = \["keep"\]; const stateList = \["uploading", "stalledUP"\]; const { state, uploadSpeed, category, completedTime } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( stateList.indexOf(state) !== -1 && uploadSpeed <= util.calSize(512, "KiB") && moment().unix() - completedTime >= 5400 ) { return true; } return false; }; \`\`\` **## 3.4 删种-最长下载时间** \`\`\`ts // 针对那些16个小时内没有下完的龟速种子,大部分情况下都是发种人盒子崩了什么的。上传速度如果大于5m的,不删除。 (maindata, torrent) => { const categoryList = \["keep"\]; const stateList = \["downloading", "stalledDL"\]; const { state, addedTime, category, uploadSpeed } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( stateList.indexOf(state) !== -1 && moment().unix() - addedTime >= 57600 && uploadSpeed <= util.calSize(5, "MiB") ) { return true; } return false; }; \`\`\` **## 3.5 删种-慢车夜间有效(大硬盘不选删种厉害)** \`\`\`ts //1.在0点-8点这个时间段,种子数量小于10个时跳过,下载人数大于100时跳过,保证夜间不误删,能有足够的种子。2.进度大于10%,上传速度小于250kb持续40的跳车。 (maindata, torrent) => { const categoryList = \["keep"\]; const stateList = \["downloading", "stalledDL"\]; const { state, uploadSpeed, progress, category, leecher } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( (moment().hour() >= 0 && moment().hour() <= 8) || maindata.leechingCount <= 10 || leecher >= 100 ) { return false; } if ( stateList.indexOf(state) !== -1 && uploadSpeed <= util.calSize(250, "KiB") && progress >= 0.1 ) { return true; } return false; }; \`\`\` **## 3.6 删种-长时间未开始夜间有效** \`\`\`ts //删除0-8点这个时间段,超过五小时并且进度小于5%的种子。删除常规时间段,超过四小时并且进度小于5%的种子 (maindata, torrent) => { const categoryList = \["keep"\]; const { state, category, progress, addedTime } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( moment().hour() >= 0 && moment().hour() <= 8 && state == "stalledDL" && progress <= 0.05 && moment().unix() - addedTime >= 18000 ) { return true; } if ( state == "stalledDL" && progress <= 0.05 && moment().unix() - addedTime >= 14400 ) { return true; } return false; }; \`\`\` **## 3.7 删种-下载人数少** \`\`\`ts // 删除下载人数小于10,上传速度低于500kb,添加超过20分钟的非潜力种。 (maindata, torrent) => { const categoryList = \["keep"\]; const stateList = \["downloading", "stalledDL"\]; const { state, category, leecher, uploadSpeed, addedTime } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( stateList.indexOf(state) !== -1 && leecher <= 10 && uploadSpeed <= util.calSize(500, "KiB") && moment().unix() - addedTime >= 900 ) { return true; } return false; }; \`\`\` **## 3.8 删种-黑车固定数值** \`\`\`ts // 死的key和value然后for循环去取里面的数值,下载10上传2,下载5上传1满足删除 (maindata, torrent) => { const categoryList = \["keep"\]; let ruleData = \[ { down: 10, up: 2 }, { down: 5, up: 1 }, \]; const { state, category, uploadSpeed, downloadSpeed } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } for (const rule of ruleData) { if ( state == "downloading" && downloadSpeed >= util.calSize(rule.down, "MiB") && uploadSpeed <= util.calSize(rule.up, "MiB") ) { return true; } } return false; }; \`\`\` **## 3.9 删种-黑车下载大于上传1.8倍率** \`\`\`ts // 下载速度除上传速度当大于1.8这区间的时候进行删种 (maindata, torrent) => { const categoryList = \["keep"\]; const { state, category, uploadSpeed, downloadSpeed } = torrent; if (categoryList.indexOf(category) !== -1) { return false; } if ( state == "downloading" && downloadSpeed >= util.calSize(10, "MiB") && downloadSpeed / uploadSpeed >= 1.8 ) { return true; } return false; }; \`\`\` **## 3.10 删种-分享率x倍** 分享率三 大于 x 种子进度 等于 1 **# 4 备份下载** Github:https://github.com/Stylle/vertex_rules Gitee:https://gitee.com/stylle/vertex_rules
32天
rmd3h
#1
棒棒哒 加油 棒棒哒 加油 棒棒哒 加油
32天
相关话题回复浏览量活动