Code Monkey home page Code Monkey logo

jdrouterpush's Introduction

JDRouterPush

项目简介

本项目调用京东云无线宝API,可每天定时推送积分收益情况,帮助你更好的观察主要信息,不收集用户任何信息.

项目功能

当前版本: 20231010

  1. 查询今日总收益,设备总收益
  2. 查询绑定账户
  3. 单个设备积分收益情况,积分到期提醒,积分操作记录
  4. 支持多设备查询
  5. 多设备自定义IP段
  6. 支持自定义设置设备名,自动获取设备名,操作记录条数
  7. 支持查看当前网速,ip,路由模式,固件版本,插件状态,插件版本,缓存大小
  8. 支持查看设备开机时间与PCDN
  9. 推送支持servier酱,Telegram,Bark,pushplus,企业微信(支持文本推送/图文推送两种方式)

更新日志

2023-10-10:

  1. 将更新源更换为GitHub官方,如需国内部署可更换国内镜像

2022-07-11:

  1. 修复时间格式化错误

2021-07-11:

  1. 自定义IP段(只在6点前执行,需要更改每日定时,6点前执行一次,建议2-5点内)

2021-04-23:

  1. 企业微信添加图文推送方式

2021-04-13:

  1. 自动获取设备名称,优先自定义
  2. 添加企业微信通知
  3. 添加当前网速,当前ip,路由模式,固件版本,插件状态,插件版本,缓存大小等

2021-03-04:

  1. 支持自定义设置设备名称
  2. 支持自定义设置记录条数

2021-03-02:

  1. 查询绑定的京东账户
  2. 通知排版优化
  3. 脚本检测更新
  4. 支持Server酱Turbo版

2021-02-25:

  1. 实现多设备查询
  2. 查询今日收益,总收益,可用收益
  3. 设备在线天数
  4. 可查看最近七条积分动态

使用说明

Actions 方式

  1. Fork 本项目
  2. 获取京东云无线宝wskey
  • 目前只用Android抓包演示(抓包工具有很多,这里使用HttpCanary作为演示)

  • 打开HttpCanary点击右下角按钮开始抓包

  • 然后再打开京东云无线宝,点击积分管理

  • 回到HttpCanary,右上角找到搜索,搜索wskey

  • 然后随便点击一条进去,找到请求里面的wskey ,复制值

  1. 点击项目 Settings -> Secrets and variables -> Actions -> New repository secret 添加以下 2 个 Secrets,其中server酱微信推送的sckey可参阅微信订阅通知
Name Value 是否必填
WSKEY 从京东云无线宝中获取 必填
SERVERPUSHKEY server酱推送的sckey 非必填
DEVICENAME 格式:mac后6位:设置的名称,多个使用&连接 非必填
RECORDSNUM 需要设置的获取记录条数 不填默认7条 非必填
TG_BOT_TOKEN Telegram推送服务Token 非必填
TG_USER_ID Telegram推送服务UserId 非必填
BARK bark消息推送服务,secrets可填;形如jfjqxDx3xxxxxxxxSaK的字符串 非必填
PUSHPLUS pushplus推送服务Token 非必填
ACCESSTOKEN 企业微信access_token 非必填
CORPID 企业ID(如果已经填写ACCESSTOKEN 则无需填写这个) 非必填
CORPSECRET 应用的凭证密钥secret(如果已经填写ACCESSTOKEN 则无需填写这个) 非必填
TOUSER touser指定接收消息的成员 默认为“@all” 非必填
AGENTID agentid企业应用的id 非必填
THUMB_MEDIA_ID 企业微信素材库图片id 非必填
AUTHOR 企业微信文章作者名字 非必填
NETWORK_SEGMENT 设置IP网段 非必填

DEVICENAME变量填写例子:

例如:完整mac为:ABC12D456EF7(取后6位) 想设置为韭菜1号

单个设备:456EF7:韭菜1号

多个设备:456EF7:韭菜1号&789FE1:韭菜2号&123FR2:韭菜3号 (中间使用&连接即可)

THUMB_MEDIA_ID变量填写说明:

不填写此变量直接推送text文本格式(由于text/card等推送方式存在字数限制,所以大于3台设备的同学尽量使用图文推送)

填写此变量直接推送图文格式文章,类似于公众号文章。图片id请登入网页版进入素材库上传一张图片之后点击下载链接,在下载链接内有media_id=xxx(&结尾)

AUTHOR变量填写说明:

图文文章作者名字,设置了THUMB_MEDIA_ID就必须填写。

NETWORK_SEGMENT变量填写说明:

设置IP网段,例如当前IP为100.84.102.15,你的100.107开头的网段上传速度较快,就可以将NETWORK_SEGMENT变量参数设置为 456EF7:100.107.星号.星号 (将星号两个中文字符换成一个字符星号(*)) (456EF7表示mac后6位,参考DEVICENAME变量,星号代表1-225内所有数字,可以设置大于或者小于,例如你想将IP段设置为100.107.大于100.小于80===>100.107.星号>100.星号<80,格式星号+大于或小于+数字(1-255)) 注意:不要将IP设置为不可获取到的数值,否则设备一直重启,此变量需为4段已.(点)分割

  1. 开启 Actions 并触发每日自动执行

Github Actions 默认处于关闭状态,需要手动开启 Actions ,执行一次工作流,验证是否可以正常工作。

图示

如果需要修改每日任务执行的时间,请修改 .github/workflows/JDPush.yml,在第 7行左右位置找到下如下配置。

  schedule:
    - cron: '30 22 * * *'
    # cron表达式,Actions时区是UTC时间,需要往前推8个小时  此时为6点30推送
    # 示例: 每天晚上22点30执行 '30 14 * * *'

如果收到了 GitHub Action 的错误邮件,请检查 WSKEY是不是失效了,如果退出或重登都会导致京东云无线宝 WSKEY 失效

订阅通知

订阅执行结果

目前Turbo版本的消息通道支持以下渠道

  • 企业微信应用消息
  • Android
  • Bark iOS
  • 企业微信群机器人
  • 钉钉群机器人
  • 飞书群机器人
  • 自定义微信测试号
  • 方糖服务
  1. 前往 sct.ftqq.com点击登入,创建账号。
  2. 点击点SendKey ,生成一个 Key。将其增加到 Github Secrets 中,变量名为 SERVERPUSHKEY
  3. 配置消息通道 ,选择方糖服务号,保存即可。
  4. 推送效果展示

jdrouterpush's People

Contributors

fqxufo avatar jointemp avatar leifengwl avatar obanat avatar sxx1314 avatar wszf 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  avatar  avatar  avatar  avatar  avatar

jdrouterpush's Issues

运行python JDRouterPush.py返回报错

大佬你好,

刚在黑群晖上面Docker部署了大佬您的项目,前面都还算顺利,但到了运行python JDRouterPush.py 这一步,返回错误如下:
root@python:~ $ python JDRouterPush.py
Traceback (most recent call last):
File "/root/JDRouterPush.py", line 5, in
import GlobalVariable
File "/root/GlobalVariable.py", line 71
DEVICENAME = os.environ.get(XX55BB:JDC02_XX55BB) # 设备名称 mac后6位:设置的名称,多个使用&连接
^
SyntaxError: invalid syntax

GlobalVariable.py 上面关于“”DEVICENAME“” 我是这样填写:
DEVICENAME = os.environ.get(xx55BB:JDC02_xx55BB) # 设备名称

请问是否格式不对呢?烦请大佬可以在百忙中指点一下,非常感激,另外祝你和家人国庆快乐

2代设备适配问题

第188行,

satisfiedTimes = pointInfo["satisfiedTimes"]

建议改成:
satisfiedTimes = pointInfo.get("satisfiedTimes", '不适用坐享其成计划')

主要是我2代的AX1800似乎没有这个字段,如果没有,可以用get默认值来防止报错。

docker下推送配置

1.https://hub.docker.com/r/nevinee/python 按照说明配置好docker;把https://github.com/leifengwl/JDRouterPush.git打包的文件拷贝在映射目录python下
2.先执行docker exec -it python bash
然后 pip install requests markdown pytz
3.GlobalVariable.py里把环境变量填好
4.在映射目录python下加入crontab.list文件,内容如下:36 6 * * * python JDRouterPush.py
5、docker-compose配置示例:
version: "2.0"
services:
python:
image: nevinee/python
container_name: python
restart: always
tty: true
network_mode: bridge
hostname: python
volumes:
- /opt/docker/python/:/root

这个地方的代码好像有问题

for info in pointInfos:
mac = info["mac"]
MACS.append(mac)
routerActivityInfo(mac)
routerAccountInfo(mac)
pointOperateRecordsShow(mac)
JDServiceAPI.getListAllUserDevices()
for mac in MACS:
JDServiceAPI.getControlDevice(mac, 2)
JDServiceAPI.getControlDevice(mac, 3)

想推送通知的时候加上插件的容量,看了代码发现这个地方有问题。

脑子短路了,看多了 js 混淆了。逻辑没问题。

貌似只是因为在最后生成 notifyContentJson 的时候没有加入这些信息。

刚才看到更新重新fork了一次,有错误提示,什么问题

Run python JDRouterPush.py
Traceback (most recent call last):
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 295, in
欢迎使用JDRouterPush!
Request routerActivityInfo failed!
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 288, in main
todayPointDetail()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 125, in todayPointDetail
JDServiceAPI.getControlDevice(mac,3)
File "/home/runner/work/JDRouterPush/JDRouterPush/JDServiceAPI.py", line 110, in getControlDevice
pcdn_list = data["pcdn_list"]
TypeError: string indices must be integers
Error: Process completed with exit code 1.

更新之后 部分账号会出问题

  • 只有3台一代jdc的账号正常。
  • 还有一个朋友的账号带360v6的合作款,会报错。
欢迎使用JDRouterPush!
获取routerActivityInfo失败
获取routerActivityInfo失败
Traceback (most recent call last):
  File "JDRouterPush.py", line 267, in <module>
    main(WSKEY,SERVERPUSHKEY)
  File "JDRouterPush.py", line 260, in main
    resultDisplay(SERVERPUSHKEY)
  File "JDRouterPush.py", line 188, in resultDisplay
    satisfiedTimes = pointInfo["satisfiedTimes"]
KeyError: 'satisfiedTimes'
  • 看了下就是新增的版本更新检测等的代码,临时解决办法可以直接屏蔽这些功能。
  • 建议加一个mac判断,对于非官方的硬件的mac不使用除查询积分外的各种查询功能。
  • 京东云 官方硬件mac范围 DC:D8:7C

Screenshot_20210303-131427

有大哥教一下怎么让设备定时重启么

账户下绑定了两个设备,因为光猫设定好了每隔3天定时重启一次,想让无线宝跟着光猫一起重启,但是APP上只能选择周几重启,功能对不上。刚好看到IP切换这块好像有重启的代码,能教一下怎么移植出来么?

上传数据量

请问有抓到 “查询每天上传数据量” 的接口吗?我看“赚钱宝助手云监工”这个网站好像能查询机器的上传量。但是找不到这个接口,不知道他们是从哪来的,app上也没有这个接口。

关于getAuthorization认证模块问题

大佬你好,感谢你的代码,很受启发!
有个问题关于认证模块,hmacKey这个值是哪里来的呢?
把service_pram改成自己的设备后,认证就会失败。可能是这个hmacKey没有设置对,抓包并没有发现这个值。
希望能指点一下,感谢。

突然不能正常推送了

Run python JDRouterPush.py
2
python JDRouterPush.py
3
shell: /usr/bin/bash -e {0}
4
env:
5
pythonLocation: /opt/hostedtoolcache/Python/3.9.5/x64
6
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.5/x64/lib
7
WSKEY: ***
8
DEVICENAME:
9
RECORDSNUM:
10
SERVERPUSHKEY:
11
TG_BOT_TOKEN:
12
TG_USER_ID:
13
BARK:
14
PUSHPLUS:
15
ACCESSTOKEN:
16
CORPID: ***
17
CORPSECRET: ***
18
TOUSER: ***
19
AGENTID: ***
20
THUMB_MEDIA_ID: ***
21
AUTHOR: ***
22
欢迎使用JDRouterPush!
23
Traceback (most recent call last):
24
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
25
httplib_response = self._make_request(
26
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
27
self._validate_conn(conn)
28
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in validate_conn
29
conn.connect()
30
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
31
self.sock = ssl_wrap_socket(
32
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/ssl
.py", line 449, in ssl_wrap_socket
33
ssl_sock = ssl_wrap_socket_impl(
34
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
35
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
36
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 500, in wrap_socket
37
return self.sslsocket_class._create(
38
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 1040, in _create
39
self.do_handshake()
40
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 1309, in do_handshake
41
self._sslobj.do_handshake()
42
ConnectionResetError: [Errno 104] Connection reset by peer
43

44
During handling of the above exception, another exception occurred:
45

46
Traceback (most recent call last):
47
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
48
resp = conn.urlopen(
49
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
50
retries = retries.increment(
51
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
52
raise six.reraise(type(error), error, _stacktrace)
53
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/packages/six.py", line 769, in reraise
54
raise value.with_traceback(tb)
55
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
56
httplib_response = self._make_request(
57
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 382, in _make_request
58
self._validate_conn(conn)
59
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 1010, in validate_conn
60
conn.connect()
61
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connection.py", line 411, in connect
62
self.sock = ssl_wrap_socket(
63
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/ssl
.py", line 449, in ssl_wrap_socket
64
ssl_sock = ssl_wrap_socket_impl(
65
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/ssl
.py", line 493, in _ssl_wrap_socket_impl
66
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
67
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 500, in wrap_socket
68
return self.sslsocket_class._create(
69
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 1040, in _create
70
self.do_handshake()
71
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/ssl.py", line 1309, in do_handshake
72
self._sslobj.do_handshake()
73
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
74

75
During handling of the above exception, another exception occurred:
76

77
Traceback (most recent call last):
78
File "/home/runner/work/push/push/JDRouterPush.py", line 294, in
79
main()
80
File "/home/runner/work/push/push/JDRouterPush.py", line 286, in main
81
todayPointIncome()
82
File "/home/runner/work/push/push/JDRouterPush.py", line 16, in todayPointIncome
83
res = requests.get(GlobalVariable.jd_base_url + "todayPointIncome", headers=GlobalVariable.headers)
84
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/api.py", line 76, in get
85
return request('get', url, params=params, **kwargs)
86
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/api.py", line 61, in request
87
return session.request(method=method, url=url, **kwargs)
88
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
89
resp = self.send(prep, **send_kwargs)
90
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
91
r = adapter.send(request, **kwargs)
92
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
93
raise ConnectionError(err, request=request)
94
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
95
Error: Process completed with exit code 1.

还更新吗,今天开始又不能推送了

Run python JDRouterPush.py
Traceback (most recent call last):
欢迎使用JDRouterPush!
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 294, in
Request routerActivityInfo failed!
Request routerActivityInfo failed!
Request routerActivityInfo failed!
无法获取插件信息!
信息如下:
无法获取插件信息!
信息如下:
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 289, in main
resultDisplay()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 230, in resultDisplay
point_infos += "\n - 当前网速:" + pointInfo["speed"]
KeyError: 'speed'
Request getControlDevice failed!
Request getControlDevice failed!
Error: Process completed with exit code 1.

出现这个提示

推送失败,不懂怎么回事,是wsky不行了吗,有没有大佬帮忙解答一下,咱也不是这个专业的

Run python JDRouterPush.py
python JDRouterPush.py
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.9.2/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.2/x64/lib
WSKEY: ***
DEVICENAME:
RECORDSNUM:
SERVERPUSHKEY: ***
TG_BOT_TOKEN:
TG_USER_ID:
BARK:
PUSHPLUS: ***
Traceback (most recent call last):
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 403, in
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 391, in main
records_num = int(RECORDSNUM)
ValueError: invalid literal for int() with base 10: ''
Error: Process completed with exit code 1.

今早没有推送发现有错误,重新fork了一遍还是错误,代码如下

Run python JDRouterPush.py
Traceback (most recent call last):
欢迎使用JDRouterPush!
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 296, in
Request routerActivityInfo failed!
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 289, in main
todayPointDetail()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 119, in todayPointDetail
pointOperateRecordsShow(mac)
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 135, in pointOperateRecordsShow
"pageSize": records_num,
NameError: name 'records_num' is not defined
Error: Process completed with exit code 1.

"查询积分接口失败"

是否现在已经失效了?我用的stream抓包,点击无线宝app的“积分管理”,会提示"查询积分接口失败"。

看了iss,重新同步了还是不行,显示代码行数有两个不一样

Run python JDRouterPush.py
Traceback (most recent call last):
欢迎使用JDRouterPush!
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 295, in
Request routerActivityInfo failed!
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 288, in main
无法获取插件信息!
todayPointDetail()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 124, in todayPointDetail
JDServiceAPI.getControlDevice(mac,2)
File "/home/runner/work/JDRouterPush/JDRouterPush/JDServiceAPI.py", line 71, in getControlDevice
result = json.loads(res["result"])
File "/opt/hostedtoolcache/Python/3.9.4/x64/lib/python3.9/json/init.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
Error: Process completed with exit code 1.
一个一代64坐享,一个2代64G

获取设备失败

Traceback (most recent call last):
  File "JDRouterPush.py", line 295, in <module>
    main()
  File "JDRouterPush.py", line 288, in main
    todayPointDetail()
  File "JDRouterPush.py", line 121, in todayPointDetail
    JDServiceAPI.getListAllUserDevices()
  File "/mnt/mmc0/work/JDRouterPush/JDServiceAPI.py", line 57, in getListAllUserDevices
    resultLists = res["result"][0]["list"]
KeyError: 0

点了运行毫无反应

大佬你好!我配置好了,点了手动运行毫无反应,也没收到邮件,是不是需要明天6点半才会推送?

这几天没推送,看了下报错好多,啥都没改,不知道啥原因

Run python JDRouterPush.py
python JDRouterPush.py
shell: /usr/bin/bash -e {0}
env:
pythonLocation: /opt/hostedtoolcache/Python/3.9.5/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.5/x64/lib
WSKEY: ***
DEVICENAME:
RECORDSNUM:
SERVERPUSHKEY: ***
TG_BOT_TOKEN:
TG_USER_ID:
BARK:
PUSHPLUS: ***
ACCESSTOKEN:
CORPID:
CORPSECRET:
TOUSER:
AGENTID:
THUMB_MEDIA_ID:
AUTHOR:
Traceback (most recent call last):
欢迎使用JDRouterPush!
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
Request routerActivityInfo failed!
httplib_response = self._make_request(
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 1345, in getresponse
无法获取插件信息!
信息如下:
response.begin()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 276, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 1345, in getresponse
response.begin()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 307, in begin
version, status, reason = self._read_status()
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/http/client.py", line 276, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 294, in
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 289, in main
resultDisplay()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 259, in resultDisplay
NoticePush.server_push(title, markdownContent.replace("- ***", "```"))
File "/home/runner/work/JDRouterPush/JDRouterPush/NoticePush.py", line 19, in server_push
res = requests.post(url=server_push_url, data=params)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 677, in send
history = [resp for resp in gen]
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 677, in
history = [resp for resp in gen]
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 237, in resolve_redirects
resp = self.send(
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
Error: Process completed with exit code 1.

出现错误:'Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')

出现错误: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
准备重新执行...
出现错误: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
准备重新执行...
出现错误: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
准备重新执行...
出现错误: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
准备重新执行...
出现错误: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
请问如何处理?

getListAllUserDevices的API失效问题

如果是白天运行具体时间段不确定,大概是0点到8点。
GlobalVariable.jd_service_url + "listAllUserDevices" 这个接口就会报错。

Traceback (most recent call last):
  File "JDRouterPush.py", line 295, in <module>
    main()
  File "JDRouterPush.py", line 288, in main
    todayPointDetail()
  File "JDRouterPush.py", line 121, in todayPointDetail
    JDServiceAPI.getListAllUserDevices()
  File "/mnt/mmc0/work/JDRouterPush/JDServiceAPI.py", line 57, in getListAllUserDevices
    resultLists = res["result"][0]["list"]
KeyError: 0

直接输出返回的json发现

{'result': {}, 'error': {'errorInfo': 'token invalid', 'errorCode': '401'}, 'status': 100}

但是如果中午12点之后运行又没有问题。

最后抓包发现是时间不对。
默认time使用utc时间,改成系统时间解决问题(系统时间东八区)

time = datetime.datetime.unow().strftime("%Y-%m-%dT%H:%M:%S.%f")[:-3] + "Z"

因为我是本地运行,actions应该本身本地时间就是utc时间吧可能不会报错。

sever酱推送有问题

源码:
params = {
"text": text,
"desp": desp
}
res = requests.post(url=server_push_url, params=params)
应更改为:
params = {
"title": text,
"desp": desp
}
res = requests.post(url=server_push_url, data=params)

今天推送出现错误

Run python JDRouterPush.py
Traceback (most recent call last):
欢迎使用JDRouterPush!
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 294, in
Request routerActivityInfo failed!
main()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 289, in main
resultDisplay()
File "/home/runner/work/JDRouterPush/JDRouterPush/JDRouterPush.py", line 230, in resultDisplay
point_infos += "\n - 当前网速:" + pointInfo["speed"]
KeyError: 'speed'
Request routerActivityInfo failed!
Request routerActivityInfo failed!
无法获取插件信息!
信息如下:
无法获取插件信息!
信息如下:
无法获取插件信息!
信息如下:
Request getControlDevice failed!
Request getControlDevice failed!
Error: Process completed with exit code 1.

当前网速信息中的变量有误

文件JDServiceAPI.py的113行,下载速度引用了错误的变量
download_str = str(round(int(upload)/10/1024,2)) + "MB/s"
download_str = str(round(int(download)/10/1024,2)) + "MB/s"

设备26台 一直报错

设备26台 一直报错
另外 能否加个功能 坐享今天打绿色勾了出现一个提示 今日已坐享完成

这几天不能显示具体插件类型A、B、C、D了

欢迎使用JDRouterPush!
Request routerActivityInfo failed!
插件请求数据: [{'status': '正常', 'nickname': '插件X', 'name': '插件X', 'cache_size': '82041152'}]
插件请求数据: [{'status': '正常', 'nickname': '插件X', 'name': '插件X', 'cache_size': '56461356'}]

只能和APP上一样显示插件X

企业微信消息没有推送

没有报错,查看Actions提示:企业微信应用消息推送的变量未设置或未设置完全!!

我设置过ACCESSTOKEN了

pushplus推送有问题

同时配置了Bark和pushplus,Bark推送成功了,但是pushplus没有收到推送,看了下日志,也不知道是什么情况

欢迎使用JDRouterPush!
Request routerActivityInfo failed!
Request routerActivityInfo failed!
Request routerActivityInfo failed!
pushplus推送成功!

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.