使用 Python 进行网络认证
使用 Python3 编写,依赖于
requests
urllib/urllib.parse
复制 config.example.json
并重命名为 config.json
,修改 config.json
中的内容,执行 UPCNet.py
即可。
{
"username": "your_school_number",
"password": "your_password",
"carrier": "your_carrier"
}
运营商 | carrier 字段的值 |
---|---|
校园网 | default |
联通 | unicom |
移动 | cmcc |
电信 | ctcc |
校园内网 | local |
需自行借助计划任务实现自动轮询
github.com/LucienShui/UPCNet/releases
每 5 分钟尝试连接一次校园网
首先克隆本项目至本地
git clone https://github.com/LucienShui/UPCNet.git /usr/local/upcnet
配置文件的位置为 /usr/local/upcnet/config.json
执行 crontab -e
之后,追加一行
*/5 * * * * (cd /usr/local/upcnet && exec /usr/bin/env python3 /usr/local/upcnet/UPCNet.py)
理论上支持所有锐捷 eportal
认证。
Author: EndangeredFish
Refactor: LucienShui