Code Monkey home page Code Monkey logo

whu-net-autologin's Introduction

WHU-Net-AutoLogin

武大校园网自动认证登录脚本,使用Python语言编写。

windows,linux,mac均可运行,有Python环境就行, 依赖requests库。

功能

  • 连接校园网
  • 发送本机IP到指定邮箱
  • 断线重连 (不停地检测网络是否连接,默认间隔10s)

基础使用

do_login()函数中,设置自己地校园网账号(学号)和密码,以及参数queryString

image-20201007142556004

参数queryString,获取方法为如下:

  • 在浏览器中打开校园网登录页面,复制地址栏中?之后的所有内容。

image-20201007143938932

发送邮件(从QQ邮箱发出) & 断线重连

image-20201007144544383

image-20201007151859557

授权码可以通过如下方式获取,很重要,妥善保管!

image-20191116201357030

断线重连

image-20201007150721506

开机启动

一、Linux

安装python3:sudo apt install python3

开机自动执行

systemd目录提供了whu-net-login.service服务脚本(修改里面的文件路径)。

将该service文件放到/usr/lib/systemd/system或者/etc/systemd/system/目录下。然后执行:

sudo systemctl daemon-reload	# 重新加载 systemd 程序的配置文件
sudo systemctl enable whu-net-login.service		# 加入开机启动项中

sudo reboot 	# 重启系统

二、Windows

1. 开机自动执行

新建一个bat脚本,写入

C:\python.exe "C:\whu_net_login.py"

只是个示例,自行修改相应的路径(绝对路径)。

另存为start.bat,放到以下两个目录的任何一个

  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
  • %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

三、Mac

NULL

whu-net-autologin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.