Giter Club home page Giter Club logo

fjqndxx-v2's Introduction

2023.03.03 系统最近一次安全性更新对数据进行了加密,并更改了签名算法,目前该脚本已经无法使用

青年大学习/团课自动打卡

有空请参与这份调查

此处展示最近更新日志,完整日志搓这里

2022.10.01: 2.0版本 应用于新系统

🤺妈妈再也不用担心我团课没看被团支书赶着催了,欢迎 Star 🌟

声明

仅供福建共青团团员学习交流使用,项目遵循GPL协议,请勿拿来盈利、诈骗和违法之事!

项目产生的所有结果皆由使用者负责,本项目仅提供Python学习参考价值,本人不进行任何运行和调试。

  • 运行和调试本项目则表示为默认同意以上声明

参与贡献!

🖊️ 如果你有新的或更好消息推送方式 请参考 消息推送贡献文档 做出你的贡献!

运行和调试方法

抓取Openid

  1. 进入 '我的' > 微信登录
  2. 如果已经登陆需要清除缓存 '我的' > 清除缓存

抓取请求 /fjqndxx/v1/app/big_study/user/loginByMp,查看请求体中的内容,记录以下信息到配置文件中

{
    "unionid": "",
    "mp_openid":""
}

IOS 推荐使用APP Stream

Android 推荐使用APP Canary 未ROOT用户需要使用虚拟机

需要信任APP的HTTPS证书

如何在服务器上部署

requirements.txt 包含默认情况下需要的依赖

crontab

克隆项目并更改配置文件名称

git clone https://github.com/838239178/fjqndxx-v2.git && \
cd fjqndxx-v2 && \
mv config.json.bak config.json

按照要求填写配置文件

vi config.json

修改 crontab

crontab -e
# 将下面这行复制到里面,cd的路径按照需要更改
00 08 * * 3 cd /root/fjqndxx-v2 && python3 main.py >> crontab.log 2>&1
# 或者
00 08 * * 3 python3 /root/fjqndxx-v2/main.py >> crontab.log 2>&1

使用 crontab -l 查看是否修改成功

可选消息推送

使用消息推送 如微信推送、QQ推送

配置

普通用户可查看最新的 config.json.bak 浏览新配置项 (sender)

配置项解读

配置项 说明 可选值
send_type 消息推送类型 不填写则不推送 server_chan bark(Beta) push_plus
send_key 消息推送服务的密钥 在推送服务的官网注册获得
send_mode 推送模式 打卡失败时推送(fail) 打卡成功时推送(success) 无论成功与否都推送(both) 默认失败时推送 fail success both

Stargazers over time

Stargazers over time

鸣谢

Pycharm 是一个在各个方面都最大程度地提高开发人员的生产力的 IDE,适用于 Python 语言。

特别感谢 JetBrains 为开源项目提供免费的 PyCharm 等 IDE 的授权

fjqndxx-v2's People

Contributors

838239178 avatar dark-existed avatar fooooooo-code avatar hsukqilee avatar miscdec avatar sqlpxc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

fjqndxx-v2's Issues

[BUG] 卡在登陆

问题描述

在centos7上运行一直卡在正在登陆

使用的版本

python:[e.g. 3.9]
version:[e.g. 1.2.2]

完整的运行日志

[root@localhost tk-auto-study-master]# python main.py
[INFO]:你正在使用本地服务,请确保填写了配置文件
[INFO]:自动学习开始
[INFO]:开始多人打卡,人数53
[INFO]:正在登录尾号9360


[长期问题] 代理IP不稳定 失败情况居多

问题描述

使用的版本

python:[e.g. 3.7]
version:[e.g. 1.2.2]

完整的运行日志

[71](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:71)
[INFO]:消息推送成功
[72](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:72)
Error: :异常信息: 请阅读异常提醒,如果无法解决请截图日志发issue):HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /mobileNologin (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))
[73](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:73)
Traceback (most recent call last):
[74](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:74)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
[75](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:75)
    httplib_response = self._make_request(
[76](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:76)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 449, in _make_request
[77](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:77)
    six.raise_from(e, None)
[78](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:78)
  File "<string>", line 3, in raise_from
[79](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:79)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 444, in _make_request
[80](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:80)
    httplib_response = conn.getresponse()
[81](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:81)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/http/client.py", line 1377, in getresponse
[82](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:82)
    response.begin()
[83](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:83)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/http/client.py", line 320, in begin
[84](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:84)
    version, status, reason = self._read_status()
[85](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:85)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/http/client.py", line 289, in _read_status
[86](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:86)
    raise RemoteDisconnected("Remote end closed connection without"
[87](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:87)
http.client.RemoteDisconnected: Remote end closed connection without response
[88](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:88)

[89](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:89)
During handling of the above exception, another exception occurred:
[90](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:90)

[91](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:91)
Traceback (most recent call last):
[92](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:92)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/requests/adapters.py", line 440, in send
[93](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:93)
    resp = conn.urlopen(
[94](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:94)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 785, in urlopen
[95](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:95)
    retries = retries.increment(
[96](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:96)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
[97](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:97)
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
[98](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:98)
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /mobileNologin (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))
[99](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:99)

[100](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:100)
During handling of the above exception, another exception occurred:
[101](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:101)

[102](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:102)
Traceback (most recent call last):
[103](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:103)
  File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 40, in catch
[104](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:104)
    return func(*args, **kwargs)
[105](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:105)
  File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 275, in run
[106](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:106)
    single_study(username, pwd, pub_key)
[107](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:107)
  File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 250, in single_study
[108](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:108)
    login(username, password, pub_key)
[109](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:109)
  File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 166, in login
[110](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:110)
    post_login(username, pwd, pub_key)
[111](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:111)
  File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 105, in post_login
[112](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:112)
    resp = sess.post(url="https://m.fjcyl.com/mobileNologin",
[113](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:113)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/requests/sessions.py", line 577, in post
[114](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:114)
    return self.request('POST', url, data=data, json=json, **kwargs)
[115](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:115)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
[116](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:116)
    resp = self.send(prep, **send_kwargs)
[117](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:117)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
[118](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:118)
    r = adapter.send(request, **kwargs)
[119](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:119)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/requests/adapters.py", line 513, in send
[120](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:120)
    raise ProxyError(e, request=request)
[121](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:121)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /mobileNologin (Caused by ProxyError('Cannot connect to proxy.', RemoteDisconnected('Remote end closed connection without response')))
[122](https://github.com/TheRainTime/tk-auto-study/runs/5956237186?check_suite_focus=true#step:5:122)
Error: Process completed with exit code 255.

[BUG]用户数量识别错误

问题描述

仅配置Actions Secret中的username和pwd,未配置ext_users时,依然会被识别为两个用户,但是会报错误,提示部分用户信息异常;原有的单用户能够正常打卡。猜想问题可能是识别为两个用户后,第二个用户的信息为空。

使用的版本

python:[e.g. 3.7]
version:[e.g. 1.2.2]

完整的运行日志

[INFO]:你正在使用GitHubAction,请确保secret已经配置
[INFO]:自动学习开始
[INFO]:使用 OCR baidu_image
[INFO]:开始多人打卡,人数2
Warning: :多人打卡配置存在错误,将跳过部分用户,请检查配置的用户名密码格式
[INFO]:正在登录尾号0226
[INFO]:获取验证码成功
[INFO]:0226 login 登录成功!
[INFO]:学习成功!

备注

我对代码进行了改动,以对接Go-CQHTTP的消息推送,但是这部分推送代码已在旧版本测试运行通过,新版本的用户数量识别问题应该不是这个所导致。

[BUG] 官方服务异常

Error: :异常信息: 请阅读异常提醒,如果无法解决请截图日志发issue):-1
Traceback (most recent call last):
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 40, in catch
return func(*args, **kwargs)
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 273, in run
multi_study(accounts, pub_key)
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 237, in multi_study
login(account['username'], account['pwd'], pub_key)
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 166, in login
post_login(username, pwd, pub_key)
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 114, in post_login
error_exit(f'官方服务器发生异常,错误代码:{resp.status_code},信息:{resp.text}')
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 63, in error_exit
exit(-1)
File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/_sitebuiltins.py", line 26, in call
raise SystemExit(code)
SystemExit: -1
Error: Process completed with exit code 255.

EXT_USERS 配置格式

问题描述

使用的版本

python:[e.g. 3.7]
version:[e.g. 1.2.2]
配置了"extUsers",但是只读最后一个账号
"extUsers": [
{
"username":"test1","pwd":"test1","username":"test2","pwd":"test2"
}
]

日志:[INFO]:你正在使用本地服务,请确保填写了配置文件
[INFO]:自动学习开始
[INFO]:使用 OCR baidu_image
[INFO]:开始多人打卡,人数2
[INFO]:正在登录尾号est2

[Feature]Bark消息推送渠道

需求描述

Bark的推送免费又迅速,还可以自己部署推送服务器,安卓苹果都能用,在ios上面直接用苹果的消息服务器推送

你希望达到的效果

[BUG]无法使用宝塔计划任务执行

问题描述

将程序git clone了一份到服务器上,
使用ssh登录root账号,执行

cd /.../
python3 main.py

可以正常登录打卡,
但是使用宝塔计划任务添加Shell脚本任务,无论是手动执行还是自动运行,都会报错误,如下。

使用的版本

**python:**3.6
**version:**1.2.3

完整的运行日志

Traceback (most recent call last):
  File "main.py", line 18, in <module>
    encryptor = importlib.import_module(f"crypt_module.{crypt_name}.{crypt_name}_{crypt_mode}")
  File "/usr/lib64/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/.../crypt_module/sm4/sm4_ecb.py", line 1, in <module>
    from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
ModuleNotFoundError: No module named 'gmssl'

[询问]import的时候报错

Traceback (most recent call last):
File "C:/Users/30387/Desktop/tk-auto-study-1.2.7/main.py", line 15, in
from proxy_module.proxy_fetcher import ProxyFecher
File "C:\Users\30387\Desktop\tk-auto-study-1.2.7\proxy_module\proxy_fetcher.py", line 7, in
class ProxyFecher(object):
File "C:\Users\30387\Desktop\tk-auto-study-1.2.7\proxy_module\proxy_fetcher.py", line 9, in ProxyFecher
cache_hosts: list[str]
TypeError: 'type' object is not subscriptable

不是很理解

[BUG运行报错

15
INFO:自动学习开始
16
INFO:使用 OCR baidu_image
17
Error: :异常信息: 发生未知异常(请截图日志发issue):HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f36f995d850>: Failed to establish a new connection: [Errno 110] Connection timed out'))
18
Traceback (most recent call last):
19
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 159, in _new_conn
20
conn = connection.create_connection(
21
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 84, in create_connection
22
raise err
23
File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 74, in create_connection
24
sock.connect(sa)
25
TimeoutError: [Errno 110] Connection timed out
26

27
During handling of the above exception, another exception occurred:
28

29
Traceback (most recent call last):
30
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 665, in urlopen
31
httplib_response = self._make_request(
32
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 376, in _make_request
33
self._validate_conn(conn)
34
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 996, in _validate_conn
35
conn.connect()
36
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 314, in connect
37
conn = self._new_conn()
38
File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 171, in _new_conn
39
raise NewConnectionError(
40
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7f36f995d850>: Failed to establish a new connection: [Errno 110] Connection timed out
41

42
During handling of the above exception, another exception occurred:
43

44
Traceback (most recent call last):
45
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
46
resp = conn.urlopen(
47
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 719, in urlopen
48
retries = retries.increment(
49
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 436, in increment
50
raise MaxRetryError(_pool, url, error or ResponseError(cause))
51
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f36f995d850>: Failed to establish a new connection: [Errno 110] Connection timed out'))
52

53
During handling of the above exception, another exception occurred:
54

55
Traceback (most recent call last):
56
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 36, in catch
57
return func(*args, **kwargs)
58
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 212, in run
59
login(username, pwd, pub_key)
60
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 139, in login
61
code = get_validate_code()
62
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 57, in get_validate_code
63
resp = sess.get(url="https://m.fjcyl.com/validateCode?0.123123&width=58&height=19&num=4")
64
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 546, in get
65
return self.request('GET', url, **kwargs)
66
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request
67
resp = self.send(prep, **send_kwargs)
68
File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send
69
r = adapter.send(request, **kwargs)
70
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 516, in send
71
raise ConnectionError(e, request=request)
72
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f36f995d850>: Failed to establish a new connection: [Errno 110] Connection timed out'))
73
Error: Process completed with exit code 255.

[BUG]

Pulling image library/python:3.7.4
Loading assets

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 710, in urlopen
chunked=chunked,
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 187, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f19f38dfed0>: Failed to establish a new connection: [Errno 110] Connection timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 450, in send
timeout=timeout
File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 786, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f19f38dfed0>: Failed to establish a new connection: [Errno 110] Connection timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 39, in catch
return func(*args, **kwargs)
File "main.py", line 271, in run
multi_study(accounts, pub_key)
File "main.py", line 235, in multi_study
login(account['username'], account['pwd'], pub_key)
File "main.py", line 163, in login
code = get_validate_code()
File "main.py", line 65, in get_validate_code
resp = sess.get(url="https://m.fjcyl.com/validateCode?0.123123&width=58&height=19&num=4")
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 542, in get
return self.request('GET', url, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f19f38dfed0>: Failed to establish a new connection: [Errno 110] Connection timed out'))
Action failed: see logs above for details
Container exited with status code other than 0

[BUG] GitHub Actions 运行多人打卡,输出存在隐私泄露

问题描述

  1. 在 GitHub Actions 上运行多人打卡,会输出手机号,Error也会输出手机号。个人信息泄露了,建议修改。
  2. 配置了三个账号,但是检测到四个账号,这是特意设计的吗。

使用的版本

python:[e.g. 3.7]
version:[e.g. 1.2.2]

完整的运行日志


微信图片_20211209090134
微信图片_20211209090139

[BUG]本地环境 多用户识别失败

问题描述

使用国内服务器(上海)git clone代码到本地,仅配置config.json中的username和pwd,未配置ext_users时,依然会被识别为两个用户,会报错误,提示部分用户信息异常,消息推送“部分用户打卡失败”;原有的单用户可以正常打卡。

使用的版本

python:[3.9]
version:[1.2.3]

完整的运行日志

Screenshot_20211228_125846_edit_255304142272062
-30fa56e67d5da607

[询问]为什么用crontab就会报错No module named 'gmssl' 但是在终端手动运行就不报错

以下为报错log
Traceback (most recent call last):
File "main.py", line 31, in
f"crypt_module.{CRYPT_NAME}.{CRYPT_NAME}_{CRYPT_MODE}")
File "/usr/lib64/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 665, in _load_unlocked
File "", line 678, in exec_module
File "", line 219, in _call_with_frames_removed
File "/root/tk/crypt_module/sm4/sm4_ecb.py", line 1, in
from gmssl.sm4 import CryptSM4, SM4_ENCRYPT, SM4_DECRYPT
ModuleNotFoundError: No module named 'gmssl'

以下为手动运行log
[root@VM-8-2-centos tk]# python3 main.py
[INFO]:你正在使用本地服务,请确保填写了配置文件
[INFO]:自动学习开始
[INFO]:开始单人打卡
[INFO]:正在登录尾号4912
[INFO]:4912 login 登录成功!
[INFO]:学习成功!
True
[INFO]:消息推送成功

以下为crontab规则
00 15 * * 2,0 cd /root/tk && python3 main.py >> crontab.log 2>&1

执行错误

Traceback (most recent call last):
File "main.py", line 119, in
run(True)
File "main.py", line 97, in run
post_login(username, pwd, code, pub_key)
File "main.py", line 68, in post_login
logging.info('login ' + resp.json().get('errmsg'))
File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.8/json/init.py", line 357, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.8/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

[BUG] send_res['code']报错

问题描述

KeyError: 'code'

使用的版本

1.2.7
python:[e.g. 3.9.7]
version:[e.g. 1.2.7]

完整的运行日志

Traceback (most recent call last):
File "E:\Products\tk-auto-study-1.2.7\main.py", line 330, in
run(True)
File "E:\Products\tk-auto-study-1.2.7\main.py", line 49, in catch
error_exit(f"请阅读异常提醒,如果无法解决请截图日志发issue):{e}")
File "E:\Products\tk-auto-study-1.2.7\main.py", line 60, in error_exit
send_msg(content=msg, success=False)
File "E:\Products\tk-auto-study-1.2.7\main.py", line 237, in send_msg
res = send_util['sender'].send(title="青年大学习打卡",
File "E:\Products\tk-auto-study-1.2.7\send_module\server_chan\sender.py", line 19, in send
success = send_res['code'] == 0
KeyError: 'code'

[BUG]服务器端无法正常运行: TypeError:“类型”对象不可下标

问题描述

服务器端无法正常运行

使用的版本

**Python 3.7.4
**version:1.2.8

完整的运行日志

Traceback (most recent call last):
File "main.py", line 1, in
from proxy_module.proxy_fetcher import ProxyFecher
File "/root/tk-auto-study/proxy_module/proxy_fetcher.py", line 7, in
class ProxyFecher(object):
File "/root/tk-auto-study/proxy_module/proxy_fetcher.py", line 9, in ProxyFecher
cache_hosts: list[str]
TypeError: 'type' object is not subscriptable

[INFO]:消息推送成功 [ERROR]:异常信息: 学习失败[BUG]

问题描述

[ERROR]:异常信息: 学习失败

完整的运行日志

[INFO]:你正在使用本地服务,请确保填写了配置文件
[INFO]:自动学习开始
[INFO]:开始单人打卡
[INFO]:正在登录尾号5951
[INFO]:5951 login 登录成功!
[INFO]:消息推送成功
[ERROR]:异常信息: 学习失败

新增手机推送功能

需求描述

通过Server酱推送打卡状态 下面是个栗子
def wechatPush(success):
content = f"""
青年大学习打卡结果
{success}
"""
data = {
"text": "青年大学习",
"desp": content
}
scurl = 'https://sctapi.ftqq.com/推送秘钥.send'
for _ in range(3):
try:
req = requests.post(scurl, data=data)
if req.json()["data"]["error"] == 'SUCCESS':
print("Server酱推送服务成功")
break
else:
print("Server酱推送服务失败")
time.sleep(3)
except Exception as e:
print("Server酱推送参数错误")
#print(req.json())
print(req.json()["data"]["error"])

你希望达到的效果

可以在手机微信上收到打卡状态的推送

[BUG] 无法运行main.py

问题描述

Traceback (most recent call last):
File "main.py", line 13, in
from proxy_module.proxy_fetcher import ProxyFecher
File "/root/project/temp/tk-auto-study/proxy_module/proxy_fetcher.py", line 7, in
class ProxyFecher(object):
File "/root/project/temp/tk-auto-study/proxy_module/proxy_fetcher.py", line 9, in ProxyFecher
cache_hosts: list[str]
TypeError: 'type' object is not subscriptable

使用的版本

python 3.8.10

Package Version


attrs 19.3.0
Automat 0.8.0
blinker 1.4
certifi 2019.11.28
chardet 3.0.4
Click 7.0
cloud-init 20.1
colorama 0.4.3
command-not-found 0.3
configobj 5.0.6
constantly 15.1.0
cryptography 2.8
dblatex 0.3.11py3
dbus-python 1.2.16
distro 1.4.0
distro-info 0.23ubuntu1
entrypoints 0.3
exception 0.1.0
gmssl 3.2.1
httplib2 0.14.0
hyperlink 19.0.0
idna 2.8
importlib-metadata 1.5.0
incremental 16.10.1
isc 2.0
Jinja2 2.10.1
jsonpatch 1.22
jsonpointer 2.0
jsonschema 3.2.0
keyring 18.0.1
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.3
lxml 4.8.0
MarkupSafe 1.1.0
more-itertools 4.2.0
netifaces 0.10.4
oauthlib 3.1.0
pip 22.0.4
ply 3.11
pyasn1 0.4.2
pyasn1-modules 0.2.1
pycryptodome 3.14.1
pycurl 7.43.0.2
PyGObject 3.36.0
PyHamcrest 1.9.0
PyJWT 1.7.1
pymacaroons 0.13.0
PyNaCl 1.3.0
pyOpenSSL 19.0.0
pyrsistent 0.15.5
pyserial 3.4
python-apt 2.0.0+ubuntu0.20.4.6
python-debian 0.1.36ubuntu1
PyYAML 5.3.1
regex 2022.3.15
requests 2.22.0
requests-unixsocket 0.2.0
SecretStorage 2.3.1
service-identity 18.1.0
setuptools 45.2.0
simplejson 3.16.0
six 1.14.0
ssh-import-id 5.10
systemd-python 234
Twisted 18.9.0
ubuntu-advantage-tools 20.3
ufw 0.36
unattended-upgrades 0.1
urllib3 1.25.8
wadllib 1.3.3
wheel 0.34.2
zipp 1.0.0
zope.interface 4.7.1

完整的运行日志

Traceback (most recent call last):
  File "main.py", line 13, in <module>
    from proxy_module.proxy_fetcher import ProxyFecher
  File "/root/project/temp/tk-auto-study/proxy_module/proxy_fetcher.py", line 7, in <module>
    class ProxyFecher(object):
  File "/root/project/temp/tk-auto-study/proxy_module/proxy_fetcher.py", line 9, in ProxyFecher
    cache_hosts: list[str]
TypeError: 'type' object is not subscriptable

[BUG]青年大学习登录已改

main.py第93行的验证码加密已取消,现在的param为{加密的用户名,加密的密码,验证码(不加密)}

[BUG] GitHubAction上无法打卡

问题描述

rror: :发生未知异常(请截图日志发issue):HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /validateCode?0.123123&width=58&height=19&num=4 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb861134ee0>: Failed to establish a new connection: [Errno 110] Connection timed out'))

使用的版本

GitHub actions

python:[e.g. 3.7]
version:[e.g. 1.2.2]

完整的运行日志


输入百度OCR的API Key和Secret Key 出现问题可以去baidu_image/ocr.py中直接填写

Run python3 workflow.py <<EOF
python3 workflow.py <<EOF






EOF
shell: /usr/bin/bash -e {0}
WARNING:root:config.json:读取config配置文件出错,请确保ocr所需key已经正确输入, 错误信息[Errno 2] No such file or directory: 'config.json'
INFO:root:auto-study is Running
Traceback (most recent call last):
File "workflow.py", line 4, in
main.start_with_workflow()
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 120, in start_with_workflow
run(False)
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 100, in run
code = get_validate_code()
File "/home/runner/work/tk-auto-study/tk-auto-study/main.py", line 33, in get_validate_code
res = ocr.netpic_ocr(base64.b64encode(resp.content))
File "/home/runner/work/tk-auto-study/tk-auto-study/baidu_image/ocr.py", line 64, in netpic_ocr
access_token = tokens.get_token(_API_KEY, _SECRET_KEY)
File "/home/runner/work/tk-auto-study/tk-auto-study/baidu_image/tokens.py", line 12, in get_token
raise Exception(response.json().get('error_description'))
Exception: The request is missing a required parameter
Error: Process completed with exit code 1.

[BUG]打卡超时

[ERROR]:异常信息: 请阅读异常提醒,如果无法解决请截图日志发issue):HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retr ies exceeded with url: /studyRecord (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fc7759645 50>, 'Connection to m.fjcyl.com timed out. (connect timeout=5)'))
Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connection.py", line 358, in connect
self.sock = conn = self._new_conn()
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connection.py", line 179, in _new_conn
raise ConnectTimeoutError(
urllib3.exceptions.ConnectTimeoutError: (<urllib3.connection.HTTPSConnection object at 0x7fc775964550>, 'Connection to m.fjcy l.com timed out. (connect timeout=5)')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/python3/lib/python3.9/site-packages/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/usr/local/python3/lib/python3.9/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /studyRec ord (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fc775964550>, 'Connection to m.fjcyl.com timed out. (connect timeout=5)'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/tk-auto-study/main.py", line 42, in catch
return func(*args, **kwargs)
File "/root/tk-auto-study/main.py", line 250, in run
multi_study(accounts, pub_key)
File "/root/tk-auto-study/main.py", line 215, in multi_study
post_study_record()
File "/root/tk-auto-study/main.py", line 77, in post_study_record
resp = sess.post(url="https://m.fjcyl.com/studyRecord", timeout=5)
File "/usr/local/python3/lib/python3.9/site-packages/requests/sessions.py", line 577, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/usr/local/python3/lib/python3.9/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/python3/lib/python3.9/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/usr/local/python3/lib/python3.9/site-packages/requests/adapters.py", line 507, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='m.fjcyl.com', port=443): Max retries exceeded with url: /studyR ecord (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fc775964550>, 'Connection to m.fjcyl.co m timed out. (connect timeout=5)'))

[Feature] 支持多账号使用

需求描述

可以支持多用户操作,即在配置文件中写入复数的账号密码都可以实现自动学习

你希望达到的效果

[BUG]

运行最新版本出现错误提示:Open api qps request limit reached
百度云刚刚已实名,免费使用额度刚刚领取

少了个,

配置文件config.json.bak第九行少了个“,”

ocr类型不存在

Run python3 workflow.py
[INFO]:自动学习开始
Error: :ocr类型不存在,请更换类型
Error: Process completed with exit code 255.

9H`{KXZW PWFD2TMD NDE$G
上次的还能用,看见更新了,顺手更新了下,然后就不能用了。
emmmm 不会更换类型

GitHub Actions 配置文件变量错误

  • name: auto study
    env:
    username: ${{secrets.USERNAME}}
    password: ${{secrets.PWD}}
    pubKey: ${{secrets.PUB_KEY}}
    ocrSecret: ${{secrets.OCR_API_KEY}}
    ocrKey: ${{secrets.OCR_SECRET_KEY}} ## OCR_SECRET_KEY跟OCR_API_KEY填反了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.