hephyr / ujn-lib-seat-api Goto Github PK
View Code? Open in Web Editor NEW济南大学图书馆座位预约系统API
License: Apache License 2.0
济南大学图书馆座位预约系统API
License: Apache License 2.0
-在腾讯云上运行出现了问题,不知道是不是腾讯云的原因。timeouterror「win error10060」由于连接方在一段时间没有正确答复或连接的主机没有反应,尝试连接失败
大神你好,最近每次预约成功或失败反馈的时间在5.01时间,是因为图书馆服务器在5.00时过于忙碌导致的吗…
各种参数都正常,也登陆上去了,但是没有预约成功。为什么返回以下这个message。
{
"status": "fail",
"code": "20",
"message": "Invalid Request",
"data": null
}
约座成功还是失败应该有输出吧--
大神你好,我在程序中添加了多线程之后,因为经常出现连接中断的情况我加了异常处理,但是自那以后感觉服务器响应的速度就变慢了,在服务器不拥挤的情况下大约要五秒才能预约成功,相同的代码换到其他服务器上响应很快,而且服务器的内存和cpu使用率都非常低,请问这是哪里的问题啊
Sent with GitHawk
昨天 前天 各有一个号预约失败,我认为是被抢了,今天所有的都请求失败。。
如题
又出现了invalid request的问题
新版本的APP使用了Flutter进行开发,目前我找到的信息如下:
cn.com.libseatapp\assets
目录下的isolate_snapshot_data
、isolate_snapshot_instr
、vm_snapshot_data
、vm_snapshot_instr
vm_snapshot_data
可能是Dart虚拟机,我们需要的代码逻辑在isolate_snapshot_data
中leos3cr3t
uuid
包uuid.V1()方法本人时间精力有限,请有能力实现的朋友一起进行逆向,将分析结果添加到该issue下.
你把想约的座位存到某个文件里,比如 seat.json
,JSON 格式如下
[
{
"note": "person1 楼下只能约4个小时 所以可以用多个帐号来满足约一天的需求",
"room": "第三阅览室南区",
"seat_num": "299",
"times": [
{
"begin": "8", "end": "12",
"username": "",
"password": ""
},
{
"begin": "12", "end": "16",
"username": "",
"password": ""
},
{
"begin": "16", "end": "20",
"username": "",
"password": ""
}
]
},
{
"note": "person2 貌似现在楼上可以约15个小时",
"room": "第六阅览室北区",
"seat_num": "1",
"times": [
{
"begin": "8", "end": "20",
"username": "",
"password": ""
}
]
}
]
Python 代码无非就是读取这个 JSON 然后在正确的时间遍历预约
什么是正确的时间,就是图书馆开放预约那一刻,据我观察,图书馆开放第二天的预约一般为第一天五点多一点点,在 API 中的体现就是 p.filters().dates 返回了两个值,所以就可以通过循环不断检测 len(p.dates()) == 2 (大部分情况下适用) 来判断是否可以预约。
import json
import time
from libapi import * # 注意导入路径
def json_file(filename='seat.json'):
with open(filename, 'r') as f:
seats_json = json.load(f)
return seats_json
def reserve(date):
seats = json_file()
for seat in seats:
for user in seat['times']:
p = libapi(user['username'], user['password'])
room_id = p.getRoomIDbyName(seat['room'])
resp = p.book(user['begin'], user['end'], room_id, seat['seat_num'], date)
# handle(resp)
def main():
p = libapi("帐号", "密码") # 用来获取日期
while len(p.dates()) != 2:
time.sleep(1)
reserve(p.dates()[1])
if __name__ == '__main__':
main()
然后通过定时任务(Linux 下 crontab) 每天四点五十九运行一下就可以了,至于多线程,多进程,日志,自己慢慢加吧~
就这么点,用我写好的库占座多简单,求给个 Star
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.