From 57c7f2a3431b96b4c9d1bfdf6e0230fd3a9dae76 Mon Sep 17 00:00:00 2001 From: GamerNoTitle Date: Mon, 8 Feb 2021 18:09:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E5=85=A5Push=20Plus=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=B9=B3=E5=8F=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AutoSignin.yml | 4 ++-- README.md | 8 +++++++- main.py | 20 +++++++++++++++++++- 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/AutoSignin.yml b/.github/workflows/AutoSignin.yml index 171615d..5fa0342 100644 --- a/.github/workflows/AutoSignin.yml +++ b/.github/workflows/AutoSignin.yml @@ -1,4 +1,4 @@ -name: AutoSignin +name: AutoCheckin on: workflow_dispatch: @@ -30,4 +30,4 @@ jobs: pip install -r requirements.txt - name: Run script run: | - python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" "${{ secrets.QQKEY }}" + python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" "${{ secrets.QQKEY }}" "${{ secrets.PPKEY }}" diff --git a/README.md b/README.md index 6fa3533..3677455 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ ![](https://upimage.alexhchu.com/2020/11/22/e9b4bcf8e6a1d.png) -2、进入设置,设置变量`cookie`和`teleid` `teletoken` `SCKEY`(这三个可选) +2、进入设置,设置变量`cookie`和`teleid` `teletoken` `SCKEY` `QQKEY` `PUSHPLUSKEY`(这五个可选,但是`teleid`和`teletoken`要用的话就得两个都要配置!) **请注意:你无需在仓库的secrets内设置名为`GITHUB_TOKEN`的变量,该名称本身就是指定为自己账户下名为`GITHUB_TOKEN`的密钥,如果你在仓库的secrets内设置将会被Github提示无效** @@ -119,6 +119,12 @@ ![](https://upimage.alexhchu.com/2021/01/25/dbfcd0cee03be.png) +### PUSHPLUSKEY获取 + +**此平台是ServerChan的替代平台,因为ServerChan发了个[通知](https://mp.weixin.qq.com/s/L4rONhZN2OCQ80cHxPAY0Q),所以我就先把这个给更了 + +访问[PushPlus官网](http://pushplus.hxtrip.com/),使用微信登录,直接在[一对一推送](http://pushplus.hxtrip.com/message)复制自己的Token填入变量即可! + ## 脚本更新 ### 自动更新 diff --git a/main.py b/main.py index f05c2ec..b729a8d 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ import telepot tele_enable = False sc_enable = False qq_enable = False +pp_enable = False sign_url = 'https://n.cg.163.com/api/v2/sign-today' current = 'https://n.cg.163.com/api/v2/client-settings/@current' @@ -15,6 +16,7 @@ teleid = sys.argv[2] teletoken = sys.argv[3] sckey = sys.argv[4] qqkey = sys.argv[5] +ppkey = sys.argv[6] if cookies == "": print('[网易云游戏自动签到]未设置cookie,正在退出……') @@ -26,7 +28,8 @@ if sckey != "": sc_enable = True if qqkey != "": qq_enable = True - +if ppkey != '': + pp_enable = True class ScriptRunError(Exception): print("[网易云游戏自动签到]脚本运行错误,具体请参见日志!") @@ -90,6 +93,10 @@ def qqsend(QQKEY, message): if qq_enable: r.get(url=qq_url) +def ppsend(PPKEY, message): + pp_url = 'http://pushplus.hxtrip.com/send?token={}&title=XXX&content={}&template=html'.format(PPKEY, message) + if pp_enable: + r.get(url=pp_url) if __name__ == "__main__": print('检测到{}个账号,即将开始签到!'.format(len(cookies))) @@ -164,10 +171,21 @@ if __name__ == "__main__": GamerNoTitle: https://bili33.top 网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin '''.format(len(success), len(failure), len(cookies), outputmsg) + ppinfomsg = ''' + 感谢使用来自bili33.top GamerNoTitle的网易云游戏自动签到脚本 + 今日签到结果如下: + 成功数量:{0}/{2} + 失败数量:{1}/{2} + 具体情况如下: + {3} + GamerNoTitle: https://bili33.top + 网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin + '''.format(len(success), len(failure), len(cookies), outputmsg) send(teleid, teleinfomsg) scsend(sckey, scinfomsg) qqsend(qqkey, qqinfomsg) + ppsend(ppkey, ppinfomsg) print(teleinfomsg) if (len(failure) != 0): raise ScriptRunError