Merge pull request #20 from Tokisaki-Galaxy/patch-1

加入酷Q推送方式
This commit is contained in:
Pesy Wu 2021-02-02 14:46:43 +08:00 committed by GitHub
commit 4589cce4e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 7 deletions

View File

@ -10,7 +10,7 @@ on:
# branches: # branches:
# - master # - master
schedule: schedule:
- cron: "0 2 * * *" - cron: "0 0 * * *"
watch: watch:
types: [started] types: [started]
@ -30,4 +30,4 @@ jobs:
pip install -r requirements.txt pip install -r requirements.txt
- name: Run script - name: Run script
run: | run: |
python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" python3 main.py "${{ secrets.cookie }}" "${{ secrets.teleid }}" "${{ secrets.teletoken }}" "${{ secrets.SCKEY }}" "${{ secrets.QQKEY }}"

View File

@ -111,6 +111,12 @@
![](https://upimage.alexhchu.com/2020/12/05/dff25704763d8.png) ![](https://upimage.alexhchu.com/2020/12/05/dff25704763d8.png)
### QQKEY获取
访问[CoolPush官网](https://cp.xuthus.cc/),使用任一方式登录,在`调用代码Skey`可以看到你的KEY
![](https://upimage.alexhchu.com/2021/01/25/dbfcd0cee03be.png)
## 脚本更新 ## 脚本更新
### 自动更新 ### 自动更新
@ -194,3 +200,7 @@
## 历史STAR ## 历史STAR
![](https://starchart.cc/GamerNoTitle/wyycg-autocheckin.svg) ![](https://starchart.cc/GamerNoTitle/wyycg-autocheckin.svg)
## 免责声明
使用本脚本造成的封号或任何违反相关法律法规造成的任何责任,由使用者自行承担,开发者不担负任何责任!

30
main.py
View File

@ -5,6 +5,7 @@ import telepot
tele_enable = False tele_enable = False
sc_enable = False sc_enable = False
qq_enable = False
sign_url = 'https://n.cg.163.com/api/v2/sign-today' sign_url = 'https://n.cg.163.com/api/v2/sign-today'
current = 'https://n.cg.163.com/api/v2/client-settings/@current' current = 'https://n.cg.163.com/api/v2/client-settings/@current'
@ -13,6 +14,7 @@ cookies = sys.argv[1].split('#')
teleid = sys.argv[2] teleid = sys.argv[2]
teletoken = sys.argv[3] teletoken = sys.argv[3]
sckey = sys.argv[4] sckey = sys.argv[4]
qqkey = sys.argv[5]
if cookies == "": if cookies == "":
print('[网易云游戏自动签到]未设置cookie正在退出……') print('[网易云游戏自动签到]未设置cookie正在退出……')
@ -22,10 +24,12 @@ if teleid != "" and teletoken != "":
bot = telepot.Bot(teletoken) bot = telepot.Bot(teletoken)
if sckey != "": if sckey != "":
sc_enable = True sc_enable = True
if qqkey != "":
qq_enable = True
class ScriptRunError(Exception):
class Error(Exception): print("[网易云游戏自动签到]脚本运行错误,具体请参见日志!")
pass
def signin(url, cookie): def signin(url, cookie):
@ -80,6 +84,11 @@ def scsend(SCKEY, message):
sc_url = 'http://sc.ftqq.com/{}.send?text=网易云游戏自动签到脚本&desp={}'.format(SCKEY, message) sc_url = 'http://sc.ftqq.com/{}.send?text=网易云游戏自动签到脚本&desp={}'.format(SCKEY, message)
if sc_enable: if sc_enable:
r.get(url=sc_url) 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__": if __name__ == "__main__":
@ -145,9 +154,20 @@ if __name__ == "__main__":
GamerNoTitle: https://bili33.top GamerNoTitle: https://bili33.top
网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin 网易云游戏自动签到脚本: https://github.com/GamerNoTitle/wyycg-autocheckin
'''.format(len(success), len(failure), len(cookies), outputmsg) '''.format(len(success), len(failure), len(cookies), outputmsg)
qqinfomsg = '''
感谢使用来自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)
scsend(sckey, scinfomsg)
send(teleid, teleinfomsg) send(teleid, teleinfomsg)
scsend(sckey, scinfomsg)
qqsend(qqkey, qqinfomsg)
print(teleinfomsg) print(teleinfomsg)
if (len(failure) != 0): if (len(failure) != 0):
raise Error raise ScriptRunError