fork: https://github.com/bear-zd/ChaoXingReserveSeat
before running the script , you should install some package
pip install pycryptodome PyExecJS
and edit the config.json to make this script work.
添加签到功能,每次启动默认为当前用户签到,可以在配置文件中 修改sign=0来取消签到
{
"settings": {
"SYS_SLEEP_TIME": 1, // 每个帐号抢的间隔
"SYS_END_TIME": "22:01:00" // 抢座位的截止时间
},
"reserve": [
{
"username": "username",
"password": "password",
"sign": 1, // 是否自动签到
"day": 1, // 0:今天,1:明天,2:后天,以此类推
"roomid": "6993", // 房间编号
"seatid": [
"105" // 座位编号
],
"time": [
["8:30", "12:30"],
["12:30", "16:30"],
["16:30", "20:30"],
["20:30", "22:00"]
],
"wait_time": 1, // 每次抢time中的时间间隔
"flag": 0 // 是否需要反复抢
}
]
}
What you should do is just set a crontab on your server to run this script.
Use python main.py
to run this script, add arguement -u config.json
to point the config file posision
In linux/macos , you can just set a crontab : crontab -e
and add the command :
0 8 * * * cd ~/Desktop/pythonProject/Nuit-Library-Seats && source venv/bin/activate && python3 main.py >> log.txt 2>&1
每早八点定时跑脚本
In windows, you can add a time task: