From 79cec13090c01982a013791c8f6890674bc89cbc Mon Sep 17 00:00:00 2001 From: Tokisaki-Galaxy Date: Mon, 25 Jan 2021 12:11:00 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E9=85=B7Q=E6=8E=A8?= =?UTF-8?q?=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/main.py b/main.py index 7c696e6..1a58e76 100644 --- a/main.py +++ b/main.py @@ -5,24 +5,28 @@ import telepot tele_enable = False sc_enable = False +qq_enable = False sign_url = 'https://n.cg.163.com/api/v2/sign-today' current = 'https://n.cg.163.com/api/v2/client-settings/@current' cookies = sys.argv[1].split('#') -teleid = sys.argv[2] -teletoken = sys.argv[3] -sckey = sys.argv[4] +switchpush = sys.argv[2] +pushkey = sys.argv[3] +teleid = sys.argv[3] +teletoken = sys.argv[4] if cookies == "": print('[网易云游戏自动签到]未设置cookie,正在退出……') sys.exit() -if teleid != "" and teletoken != "": +if switchpush == "1": #微信推送 + sc_enable = True +elif switchpush == "2": #qq推送 + qq_enable = True +elif switchpush == "3": #telegram推送 tele_enable = True bot = telepot.Bot(teletoken) -if sckey != "": - sc_enable = True - + class Error(Exception): pass @@ -80,6 +84,11 @@ def scsend(SCKEY, message): sc_url = 'http://sc.ftqq.com/{}.send?text=网易云游戏自动签到脚本&desp={}'.format(SCKEY, message) if sc_enable: r.get(url=sc_url) + +def qqsend(QQKEY, message): + qq_url = 'https://push.xuthus.cc/send/{}?c=网易云游戏自动签到脚本\n{}'.format(QQKEY, message) + if qq_enable: + r.get(url=qq_url) if __name__ == "__main__": @@ -145,9 +154,18 @@ if __name__ == "__main__": GamerNoTitle: https://bili33.top 网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin '''.format(len(success), len(failure), len(cookies), outputmsg) + qqinfomsg = ''' + 感谢使用来自bili33.top GamerNoTitle的网易云游戏自动签到脚本 + 今日签到结果如下: + 成功数量:{0}-{2} + 失败数量:{1}-{2} + 具体情况如下: + {3} + '''.format(len(success), len(failure), len(cookies), outputmsg) - scsend(sckey, scinfomsg) send(teleid, teleinfomsg) + scsend(pushkey, scinfomsg) + qqsend(pushkey, qqinfomsg) print(teleinfomsg) if (len(failure) != 0): raise Error From f18a53e0852ed496018cd766f18b929ac5cba0ac Mon Sep 17 00:00:00 2001 From: Tokisaki-Galaxy Date: Mon, 25 Jan 2021 12:12:04 +0800 Subject: [PATCH 2/8] Update AutoSignin.yml --- .github/workflows/AutoSignin.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/AutoSignin.yml b/.github/workflows/AutoSignin.yml index 978fbff..46ce435 100644 --- a/.github/workflows/AutoSignin.yml +++ b/.github/workflows/AutoSignin.yml @@ -10,7 +10,7 @@ on: # branches: # - master schedule: - - cron: "0 2 * * *" + - cron: "7 0 * * *" watch: types: [started] @@ -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 }}" + python3 main.py "${{ secrets.cookie }}" "${{ secrets.switchpush }}" "${{ secrets.pushkey }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" From 2b950a7f1f1d08d500cebfef7a09fad6348311ea Mon Sep 17 00:00:00 2001 From: Tokisaki-Galaxy Date: Mon, 25 Jan 2021 12:13:10 +0800 Subject: [PATCH 3/8] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index de5635a..0f62413 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,14 @@ ![](https://upimage.alexhchu.com/2020/11/22/bfb0e2dbd347a.png) +### switchpush 选择推送方式 + +> * 不推送 0 +> * 微信推送 1 +> * QQ推送 2 +> * Telegram 3 + + ### teleid获取 用你的Telegram找到@userinfobot,点个Start,会直接给你回复你的ID,复制下id后面的数字就是teleid了 @@ -105,12 +113,17 @@ ![](https://upimage.alexhchu.com/2020/11/22/0428751a3925e.png) -### SCKEY获取 +### pushkey获取 +#### 填SCKEY或者QQKEY +**SCKEY** 访问[ServerChan官网](http://sc.ftqq.com/?c=code),用你的Github账户登录,在`发送信息`可以看到你的SCKEY ![](https://upimage.alexhchu.com/2020/12/05/dff25704763d8.png) +**[QQKEY](https://cp.xuthus.cc/)** + + ## 脚本更新 ### 自动更新 From b786f42f40a4a916f54debb88592031be65b544e Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Mon, 25 Jan 2021 19:14:48 +0800 Subject: [PATCH 4/8] Update AutoSignin.yml --- .github/workflows/AutoSignin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoSignin.yml b/.github/workflows/AutoSignin.yml index 46ce435..0f1581b 100644 --- a/.github/workflows/AutoSignin.yml +++ b/.github/workflows/AutoSignin.yml @@ -10,7 +10,7 @@ on: # branches: # - master schedule: - - cron: "7 0 * * *" + - cron: "0 0 * * *" watch: types: [started] From cb9b66ef58cab7756542d73a21b1832c4e2bcf27 Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Mon, 25 Jan 2021 19:17:47 +0800 Subject: [PATCH 5/8] Update AutoSignin.yml --- .github/workflows/AutoSignin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/AutoSignin.yml b/.github/workflows/AutoSignin.yml index 0f1581b..c16ff04 100644 --- a/.github/workflows/AutoSignin.yml +++ b/.github/workflows/AutoSignin.yml @@ -30,4 +30,4 @@ jobs: pip install -r requirements.txt - name: Run script run: | - python3 main.py "${{ secrets.cookie }}" "${{ secrets.switchpush }}" "${{ secrets.pushkey }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" + python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" "${{ secrets.QQKEY }}" From 28cc5a00e42abc419c3c144fb49ee37450aa35b5 Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Mon, 25 Jan 2021 19:22:31 +0800 Subject: [PATCH 6/8] Update main.py --- main.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/main.py b/main.py index 1a58e76..f05c2ec 100644 --- a/main.py +++ b/main.py @@ -11,25 +11,25 @@ current = 'https://n.cg.163.com/api/v2/client-settings/@current' cookies = sys.argv[1].split('#') -switchpush = sys.argv[2] -pushkey = sys.argv[3] -teleid = sys.argv[3] -teletoken = sys.argv[4] +teleid = sys.argv[2] +teletoken = sys.argv[3] +sckey = sys.argv[4] +qqkey = sys.argv[5] if cookies == "": print('[网易云游戏自动签到]未设置cookie,正在退出……') sys.exit() -if switchpush == "1": #微信推送 - sc_enable = True -elif switchpush == "2": #qq推送 - qq_enable = True -elif switchpush == "3": #telegram推送 +if teleid != "" and teletoken != "": tele_enable = True bot = telepot.Bot(teletoken) +if sckey != "": + sc_enable = True +if qqkey != "": + qq_enable = True -class Error(Exception): - pass +class ScriptRunError(Exception): + print("[网易云游戏自动签到]脚本运行错误,具体请参见日志!") def signin(url, cookie): @@ -157,15 +157,17 @@ if __name__ == "__main__": qqinfomsg = ''' 感谢使用来自bili33.top GamerNoTitle的网易云游戏自动签到脚本 今日签到结果如下: - 成功数量:{0}-{2} - 失败数量:{1}-{2} + 成功数量:{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(pushkey, scinfomsg) - qqsend(pushkey, qqinfomsg) + scsend(sckey, scinfomsg) + qqsend(qqkey, qqinfomsg) print(teleinfomsg) if (len(failure) != 0): - raise Error + raise ScriptRunError From 55322334eed20fd65c809573d3dea51fdefc6b30 Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Mon, 25 Jan 2021 19:52:45 +0800 Subject: [PATCH 7/8] Update README.md --- README.md | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 0f62413..cf8cefd 100644 --- a/README.md +++ b/README.md @@ -93,14 +93,6 @@ ![](https://upimage.alexhchu.com/2020/11/22/bfb0e2dbd347a.png) -### switchpush 选择推送方式 - -> * 不推送 0 -> * 微信推送 1 -> * QQ推送 2 -> * Telegram 3 - - ### teleid获取 用你的Telegram找到@userinfobot,点个Start,会直接给你回复你的ID,复制下id后面的数字就是teleid了 @@ -113,16 +105,17 @@ ![](https://upimage.alexhchu.com/2020/11/22/0428751a3925e.png) -### pushkey获取 +#### SCKEY获取 -#### 填SCKEY或者QQKEY -**SCKEY** 访问[ServerChan官网](http://sc.ftqq.com/?c=code),用你的Github账户登录,在`发送信息`可以看到你的SCKEY ![](https://upimage.alexhchu.com/2020/12/05/dff25704763d8.png) -**[QQKEY](https://cp.xuthus.cc/)** +#### QQKEY获取 +访问[CoolPush官网](https://cp.xuthus.cc/),使用任一方式登录,在`调用代码Skey`可以看到你的KEY + +![](https://upimage.alexhchu.com/2021/01/25/dbfcd0cee03be.png) ## 脚本更新 @@ -207,3 +200,7 @@ ## 历史STAR ![](https://starchart.cc/GamerNoTitle/wyycg-autocheckin.svg) + +## 免责声明 + +使用本脚本造成的封号或任何违反相关法律法规造成的任何责任,由使用者自行承担,开发者不担负任何责任! From 7a288e2dbe56439fe2d38b361f49ee3140d46a5a Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Mon, 25 Jan 2021 19:53:12 +0800 Subject: [PATCH 8/8] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf8cefd..16b91d3 100644 --- a/README.md +++ b/README.md @@ -105,13 +105,13 @@ ![](https://upimage.alexhchu.com/2020/11/22/0428751a3925e.png) -#### SCKEY获取 +### SCKEY获取 访问[ServerChan官网](http://sc.ftqq.com/?c=code),用你的Github账户登录,在`发送信息`可以看到你的SCKEY ![](https://upimage.alexhchu.com/2020/12/05/dff25704763d8.png) -#### QQKEY获取 +### QQKEY获取 访问[CoolPush官网](https://cp.xuthus.cc/),使用任一方式登录,在`调用代码Skey`可以看到你的KEY