From 86c5712b308393703003bb2e53642ffa4ed7a3af Mon Sep 17 00:00:00 2001 From: Pesy Wu Date: Sun, 22 Nov 2020 22:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/main.py b/main.py index eb58e7b..53b2462 100644 --- a/main.py +++ b/main.py @@ -6,23 +6,15 @@ import telepot tele_enable=False sign='https://n.cg.163.com/api/v2/sign-today' current='https://n.cg.163.com/api/v2/client-settings/@current' -cookie='' -teleid=0 -teletoken='' -if len(sys.argv)==1: - print('[网易云游戏自动签到]未设置cookie,正在退出……') -elif len(sys.argv)==2: - cookie=sys.argv[1] - teleid=0 - teletoken='' -elif len(sys.argv)==4: - cookie=sys.argv[1] - teleid=sys.argv[2] - teletoken=sys.argv[3] - if teleid!="" and teletoken!="": - tele_enable=True -if tele_enable: +cookie=sys.argv[1] +teleid=sys.argv[2] +teletoken=sys.argv[3] +if cookie=="": + print('[网易云游戏自动签到]未设置cookie,正在退出……') + sys.exit() +if teleid!="" and teletoken!="": + tele_enable=True bot=telepot.Bot(teletoken) @@ -74,7 +66,7 @@ def send(id,message): if __name__ == "__main__": me=getme(current,getheader) if(me.status_code!=200): - message='[网易云游戏自动签到]签到失败!请检查Cookie是否过期!或者附上报错信息到 https://github.com/GamerNoTitle/wyycg-autosignin/issues 发起issue' + message='[网易云游戏自动签到]验证失败!请检查Cookie是否过期!或者附上报错信息到 https://github.com/GamerNoTitle/wyycg-autosignin/issues 发起issue' send(teleid,message) print(message) sys.exit() @@ -87,3 +79,4 @@ if __name__ == "__main__": message='[网易云游戏自动签到]签到失败,回显状态码为{}\n具体错误信息如下:\n{}'.format(sign.status_code,sign.text) send(teleid,message) print(message) + sys.exit()