clash for windows 剩余流量如何显示?怎么查看已用流量、总流量和剩余日期!?甚至订阅防覆盖
一句话概括: 向本地配置文件添加订阅信息
如何实现?
1. 机场的Clash订阅链接,本身可看“套餐流量余量和到期时间”
2.
- windows 客户端的文件路径为:C:UsersAdministrator.configclashprofilesmyprofile.yml
- Mac 客户端的文件路径为:Users/james/.config/clash/profilesmyprofile.yml
3. 返回 CFW客户端,修改客户端中的配置文件选项:
在URL中填写副本文件的本地映射地址“file:///Users/james/.config/clash/profilesmyprofile.yml”。保存后执行订阅更新并确保没有报错。
Mac:file:///Users/james/.config/clash/profilesmyprofile.yml Windows: file:///C:UsersAdministrator.configclashprofilesmyprofile.yml
4.添加对应的预处理脚本,并确保正常匹配到配置文件
配置文件范本
parsers: - reg: "myprofile.yml"
code: |
module.exports.parse = async (raw, { axios, yaml, notify, console }) => {
raw = raw.replace(/# upload=d*; download=d*; total=d*; expire=d*;*n/gm,'')
const url = 'https://example.com/subscription_url(机场订阅链接)'
let { headers:{"subscription-userinfo": si = ""}={}, status } = await axios.head(url)
si = si.replace(/;*$/g,'')
if (status === 200 && si) {
return `# ${si};n${raw}`
}
return raw
}
5.
crontab定时任务实例
时间频次示例
下面列举常用的时间频次示例。00 05 * * * : 每天凌晨5点执行
20 12 1,10,20 * * : 每个月的1号,10号,20号的12:30执行
10 1 * * 6,0 : 表示每周六、周日的1:10分执行
0,30 18-23 * * * : 每天18:00至23:00之间每隔30分钟执行
0 23-7/1 * * * : 晚上11点到早上7点之间,每隔一小时执行
0 6-12/3 * 10 * : 每年10月的每天早上6点到12点每隔3个小时执行一次
30 17 * * 1-5 : 周一到周五下午5点30分执行一次
0 */2 * * * :每两个小时执行一次
缺点
2.