Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【已解决】你好作者大大,运行AddUser-noinput.py出错,求解答 #32

Open
zzy1286709952 opened this issue Dec 17, 2023 · 7 comments

Comments

@zzy1286709952
Copy link

系统平台(Windows、Linux、云函数):liunx(青龙面板)

config.py内开启了什么功能:无

问题详细描述(怎么发现的问题):在定时任务中运行AddUser-noinput.py出错

终端报错输出(最后几行即可):## 开始执行... 2023-12-12 11:20:58

Traceback (most recent call last):
File "/ql/data/scripts/zycn0910_Sign-ZXJY/AddUser-noinput.py", line 122, in
name = json.loads(get_account_data(device, phone, password))['data']['uname']
File "/ql/data/scripts/zycn0910_Sign-ZXJY/process.py", line 287, in get_account_data
uid = user_data['data']['uid']
KeyError: 'uid'

执行结束... 2023-12-12 11:20:59 耗时 1 秒     

日志(config.py内log改为Tru后,在log文件夹下查看):无

@zzy1286709952
Copy link
Author

2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): sxbaapp.zcj.jyt.henan.gov.cn:80 - connectionpool.py - _new_conn - 244
2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - http://sxbaapp.zcj.jyt.henan.gov.cn:80 "POST /api/getApitoken.ashx HTTP/1.1" 200 279 - connectionpool.py - _make_request - 546
2023-12-12 11:43:41 - root - INFO - YcT3mukklI9uHckTU30XVx4CkmjGsBej0GOrujFQy7U= - process.py - get_Apitoken - 170
2023-12-12 11:43:41 - root - INFO - <hmac.HMAC object at 0x7f9164a8a520> - process.py - calculate_hmac_sha256 - 112
2023-12-12 11:43:41 - root - INFO - abe3f7edec3776420d8cfb39582ecf1f10216dec248f26fb137c3a1818ac3e61 - process.py - calculate_sign - 231
2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): apps.apple.com:443 - connectionpool.py - _new_conn - 1052
2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - https://apps.apple.com:443 "GET /us/app/%E8%81%8C%E6%A0%A1%E5%AE%B6%E5%9B%AD/id1606842290 HTTP/1.1" 200 None - connectionpool.py - _make_request - 546
2023-12-12 11:43:41 - root - INFO - {'Accept': '/', 'timestamp': '1702352621398', 'os': 'ios', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-Hans-CN;q=1', 'Content-Type': 'application/json', 'User-Agent': 'Internship/1.3.8 (iPhone; iOS 16.6; Scale/3.00)', 'Connection': 'keep-alive', 'phone': 'iPhone14 Pro', 'token': 'YcT3mukklI9uHckTU30XVx4CkmjGsBej0GOrujFQy7U=', 'sign': 'abe3f7edec3776420d8cfb39582ecf1f10216dec248f26fb137c3a1818ac3e61', 'appVersion': '1.4.3'} - process.py - generate_headers - 155
2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): sxbaapp.zcj.jyt.henan.gov.cn:80 - connectionpool.py - _new_conn - 244
2023-12-12 11:43:41 - urllib3.connectionpool - DEBUG - http://sxbaapp.zcj.jyt.henan.gov.cn:80 "POST /api/relog.ashx HTTP/1.1" 200 229 - connectionpool.py - _make_request - 546
2023-12-12 11:43:41 - root - INFO - {"code":1002,"deviceId":"","data":{},"msg":"错误代码:20081","currentpage":0,"pagesize":0,"totalcount":0,"pagecount":0} - process.py - login_request - 247
2023-12-12 11:43:41 - root - INFO - {"code":1002,"deviceId":"","data":{},"msg":"错误代码:20081","currentpage":0,"pagesize":0,"totalcount":0,"pagecount":0} - process.py - get_user_uid - 281

这个是log日志

@zycn0910
Copy link
Owner

哥们,你是不是把职校家园的密码输错了

@zycn0910
Copy link
Owner

zycn0910 commented Dec 18, 2023

还有,建议使用python3.9以上的青龙面板,或者删除process.py里29行encoding="utf-8"参数

@zzy1286709952
Copy link
Author

账号密码没有错,删除 process.py里29行encoding="utf-8"参数后 AddUser-noinput.py脚本变为一直运行状态了

@zycn0910
Copy link
Owner

zycn0910 commented Dec 18, 2023

encoding前有个逗号也要删除,另外看看报错信息,还有20081代码就是账号密码错了

@zzy1286709952
Copy link
Author

我再试试,麻烦您了

@zzy1286709952
Copy link
Author

已经成功可以运行了,谢谢作者大大

@zycn0910 zycn0910 changed the title 你好作者大大,运行AddUser-noinput.py出错,求解答 【已解决】你好作者大大,运行AddUser-noinput.py出错,求解答 Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants