Skip to main content

Auto elect script for SJTUer.

Project description

sjtu-automata

Version Language License

注意!此版本为BETA版,未经过严格测试,可能存在BUG,如有问题请提交issue

上海交通大学抢课脚本
V2协议分析:https://github.com/MXWXZ/sjtu-automata/blob/master/Protocol%20analysis%20v2.md

使用脚本你可以做到

:heavy_check_mark: 无人值守自动抢课
:heavy_check_mark: 并发抢课提升成功率
:heavy_check_mark: 卡时间准时抢课

使用脚本你不能做到

:x: 违反选课规则选课
:x: 提高您的网速
:x: 保证一定可以抢到课

系统环境测试程度

最佳支持:Ubuntu 18.04 LTS with Python 3.6.7

Linux > Windows >> macOS=0(没钱无测试)

安装

pip3 install sjtu-automata

升级

pip3 install sjtu-automata --upgrade

[可选]验证码自动识别

Windows可以不装,Linux如无图形界面且无法通过其他方式打开captcha.jpeg文件需要安装。

Ubuntu 18.04:

sudo apt install tesseract-ocr libtesseract-dev

其他版本/发行版/Windows等自行看文档:https://github.com/tesseract-ocr/tesseract/wiki

简单使用说明

  1. 查看课号:想选的课“教学班”一栏最后6位数字即为唯一课号

  2. 查看课程类型:主修课为0,通识课为1,通选课为2(更多需要请提交issue)

  3. 使用命令选课,例如选择主修课,课号123456,通识课,课号234567,不使用ocr:

     autoelect 0 123456 1 234567
    

    注:程序运行过程中输入s可以查看选课状态

抢课说明

  • 本程序所有操作均保证当前课程不会减少,即无论你是否已经选上课、无论是否人满等各种情况都不会影响已选课程。换言之,无论何时均保证课程只多不少,重复提交不会影响当前课表。
  • 程序运行后选课将会自动进行,如果失败自动重试,如果课程已满将自动等待并且定时刷新,直到抢成功或者用户退出为止
  • 可以提前开上程序,如果没有开放选课将会自动等待并定时刷新,可以节省登陆的时间
  • 所有指定的课程会同时进行选课,每个课程可占一个或多个线程进行选课增加成功率(多线程一般在网卡的时候才有必要)

参数说明

CLI

使用:autoelect [OPTIONS] [CLASSTYPE-CLASSID]

参数 长参数形式 说明
-v --version 显示版本
--no-update 关闭更新检查
-o --ocr 使用OCR识别验证码
--print-cookie 打印登陆cookie
-d --delay 两次尝试选课间隔(默认1s)
-n --number 每个课程的线程数(默认为1)
-h --help 显示帮助
  • CLASSTYPECLASSID成对出现,可以出现多对同步进行,但至少有一对
  • CLASSTYPE:主修课为0,通识课为1,通选课为2(更多需要请提交issue)
  • CLASSID:“教学班”一栏最后6位数字

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sjtu_automata-0.2.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

sjtu_automata-0.2.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file sjtu_automata-0.2.0.tar.gz.

File metadata

  • Download URL: sjtu_automata-0.2.0.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for sjtu_automata-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fe2364b1e4e79366ae3d16687cbddc376525287a119b200bbd1d09366582ad42
MD5 c9a4f551bde0789ffc9f53dbb498619d
BLAKE2b-256 f5d857fb174c4b9aa305d1be9b3412f4381ad673d9eccc37668737e749d8840f

See more details on using hashes here.

File details

Details for the file sjtu_automata-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sjtu_automata-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for sjtu_automata-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 91f72c4d2c5452f94d5041e4762ee24fef0b8e40eae1d3a567dea884709cfec6
MD5 9e4f7269f1e0e535a5784dff71d65f68
BLAKE2b-256 a0bc4f2f6183999f3df0fde1ed5d3abb6aa187d7c23553805ab1c73099fc1177

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page