From c535289d7bbce9c239ff64fcda15453b64bb248d Mon Sep 17 00:00:00 2001 From: GamerNoTitle Date: Sun, 22 Nov 2020 09:25:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/AutoSignin.yml | 2 +- main.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/AutoSignin.yml b/.github/workflows/AutoSignin.yml index 34d679c..105a2c3 100644 --- a/.github/workflows/AutoSignin.yml +++ b/.github/workflows/AutoSignin.yml @@ -9,7 +9,7 @@ on: # branches: # - master schedule: - - cron: "0 4,16 * * *" + - cron: "0 2 * * *" watch: types: [started] diff --git a/main.py b/main.py index 3f4e98d..9f18c8e 100644 --- a/main.py +++ b/main.py @@ -7,6 +7,8 @@ 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='' try: with open('cookie.txt','r') as f: cookie=f.read() @@ -40,7 +42,7 @@ getheader={ 'Accept': 'application/json, text/plain, */*', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36', 'X-Platform': '0', - 'Authorization': cookie, + 'Authorization': str(cookie), 'Origin': 'https://cg.163.com', 'Sec-Fetch-Site': 'same-site', 'Sec-Fetch-Mode': 'cors', @@ -54,7 +56,7 @@ signheader={ 'Accept': 'application/json, text/plain, */*', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,ja-JP;q=0.6,ja;q=0.5', - 'Authorization': cookie, + 'Authorization': str(cookie), 'Connection': 'keep-alive', 'Content-Length': '0', 'Host': 'n.cg.163.com', @@ -73,7 +75,6 @@ def signin(url,header): def getme(url,header): result=r.get(url=url,headers=header) - print(result) return result def send(id,message): @@ -97,3 +98,5 @@ if __name__ == "__main__": print(message) else: message='[网易云游戏自动签到]签到失败,回显状态码为{}\n具体错误信息如下:\n{}'.format(sign.status_code,sign.text) + send(teleid,message) + print(message)