加入Push Plus微信推送平台
This commit is contained in:
parent
76afd4d845
commit
57c7f2a343
4
.github/workflows/AutoSignin.yml
vendored
4
.github/workflows/AutoSignin.yml
vendored
|
@ -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 }}"
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||

|
||||
|
||||
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 @@
|
|||
|
||||

|
||||
|
||||
### PUSHPLUSKEY获取
|
||||
|
||||
**此平台是ServerChan的替代平台,因为ServerChan发了个[通知](https://mp.weixin.qq.com/s/L4rONhZN2OCQ80cHxPAY0Q),所以我就先把这个给更了
|
||||
|
||||
访问[PushPlus官网](http://pushplus.hxtrip.com/),使用微信登录,直接在[一对一推送](http://pushplus.hxtrip.com/message)复制自己的Token填入变量即可!
|
||||
|
||||
## 脚本更新
|
||||
|
||||
### 自动更新
|
||||
|
|
20
main.py
20
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user