Skip to content

AkagiYui/SrunTool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SrunTool

release pypi support-version license commit

深澜校园网操作类,本软件包内容仅在 NCWU 经过测试。

支持

  • 登录
  • 退出
  • 查询当前用户信息
  • 查询当前用户姓名

安装

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple sruntool

使用

from sruntool import SrunOperator, get_explain

if __name__ == '__main__':
    account = '16612345678'  # 账号
    so = SrunOperator('192.168.0.170')  # 创建operator

    r = so.current_info()  # 获取当前登录账号信息
    if r['error'] == 'ok':  # 已登录
        print(r['user_name'], '已经在线')
        exit(0)

    r = so.login(account, '123456')  # 登录
    if r['ecode'] == 0:
        print('登录成功', so.get_name(account))

        # 不延时容易造成请求频繁
        from time import sleep

        sleep(1)

        r = so.logout(account)
        if r['ecode'] == 0:
            print('下线成功')
    else:
        print('登录失败', get_explain(r['ecode']))

感谢

深澜认证协议分析,python模拟登录

About

深澜校园网工具

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages