Skip to content

Mixcro/v2_sprov_spider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v2_sprov_spider

盖子上的盖子,给sprov_ui又套了一层。

TODO

  1. add comments for the code;

First run

wget https://raw.githubusercontent.com/Mixcro/v2_sprov_spider/master/spider.py
wget https://raw.githubusercontent.com/Mixcro/v2_sprov_spider/master/config.json  # change this file for your config
chmod +x spider.py

Use as script

USAGE: ./spider.py [cmd] [target]
    [cmd]: reset, check
    [target]: all, [user port]
EXAMPLE:
    ./spider.py reset all      # reset all user traffic
    ./spider.py check all      # check all user traffic and auto ban overload user
    ./spider.py reset 59603    # reset user's traffic whois port is 59603

Demonstration

img

Add to crontab

0 */6 * * * *  root  /root/spider.py check all  # check user traffic every 6 hours
0 0 1 * * *    root  /root/spider.py reset all  # reset all user traffic at every month's first day

Config file

{
	"server": {
		"server_url": "server_url",
		"user": "user",
		"password": "passwd"
	},
	"traffic_limit": {
		"default_limit": 68719476736,  # 默认单用户月总流量限制,单位是byte
		"accounts": {
			"59603": 0,  # 此处可以单独设置使用某端口的用户流量限制
			"10086": 1024  # 0代表不限速
		}
	},
	"log": {
		"level": "info",  # 日志级别:info
		"file": "/var/log/vss.log"  # 日志保存路径
	}
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages