Giter VIP home page Giter VIP logo

login_jxnu's Introduction

江西师大校园网自动重连工具

🤔为什么搞这个小工具

校园网不稳定,时常自动断网,如果有远程控制的需求,那么断网是一件很麻烦的事情;虽然windows中有自动连接网络的选项,但有时候不起作用。

💡功能

  • 提供便捷的selenium模拟登录方式,不易因校园网升级后请求参数的变化而失效;
  • 自动化的进行网络状态的检测,并在网络中断后自动完成重新连接过程;
  • 除尝试自动连接校园网外,也可以尝试连接wifi列表中的其他可用网络;

🔧使用方式

step1: 环境安装(python3.9.13):

git clone https://github.com/try-agaaain/login_jxnu.git
pip install -r requirements.txt

step2: 安装edgedirver 由于这个工具是使用selenium模拟浏览器进行登录的,所以需要有一个浏览器辅助工具:从设置中找到Edge的版本号(edge://settings/help),再从Microsoft Edge WebDriver - Microsoft Edge Developer找到对应版本的EdgeDriver,并将其路径添加到环境变量中。(添加环境变量后需重启或在cmd中通过set PATH=C使其生效)

step3: 在main.py中设置校园网信息:可重连的WIFI列表、学号、校园网密码、运营商、校园网登录地址

# 之前连接过的可用WIFI,例如:["jxnu_stu_123", "4405", "X4408-AI"],优先尝试列表中靠前的WIFI
wifi_list = ["wifi_name1", "wifi_name2", "wifi_name3"] 
account = "学号"
password = "校园网密码"
domain = "运营商"   # 移动|联通|电信|校园带宽
jxnu_url= "http://172.16.8.8/srun_portal_pc?ac_id=1&theme=pro"  # 校园网登录地址

这个工具并不具备破解WIFI密码的能力,wifi_list中的WIFI需要是之前连接过的,在第一次连接后系统会缓存WIFI相关信息(密码,WIFI名称等),可以通过netsh wlan show profile 查看

step4: 运行

python main.py

⏩快捷方式运行

这个工具没有设计UI界面,每次运行需要输入命令会比较麻烦,有两种便捷方式:

  • 创建快捷方式:在快捷方式的属性中设置运行命令;比如在我的电脑中,通过conda创建的环境中python解释器的路径为D:\development\anaconda\envs\login\python.exe,将这个工具放置在了D:\coding\login_jxnu\main.py中,可以将快捷方式的目标设置为命令:D:\development\anaconda\envs\login\python.exe D:\coding\login_jxnu\main.py,示意图如下:
  • bat文件:将上面的命令放在.bat文件中,在windows中双击可直接运行;

🎬Screenshot

👨‍🔧Notice

  • 目前只支持windows,网络的连接使用的是windows中的netsh命令完成的,然后再用selenium进行校园网登录;不过改一下连接命令也能用于Linux;
  • 目前在selenium模拟登录的过程中使用的是Edge浏览器,暂时没有去管别的浏览器;如需使用其他浏览器可修改auto_connect\login.py中Edge相关的那两行代码;

login_jxnu's People

Contributors

try-agaaain avatar

Stargazers

夏慵懒 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.