完成脚本
This commit is contained in:
parent
9edf4306a2
commit
c535289d7b
2
.github/workflows/AutoSignin.yml
vendored
2
.github/workflows/AutoSignin.yml
vendored
|
@ -9,7 +9,7 @@ on:
|
||||||
# branches:
|
# branches:
|
||||||
# - master
|
# - master
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "0 4,16 * * *"
|
- cron: "0 2 * * *"
|
||||||
watch:
|
watch:
|
||||||
types: [started]
|
types: [started]
|
||||||
|
|
||||||
|
|
9
main.py
9
main.py
|
@ -7,6 +7,8 @@ tele_enable=False
|
||||||
sign='https://n.cg.163.com/api/v2/sign-today'
|
sign='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'
|
||||||
cookie=''
|
cookie=''
|
||||||
|
teleid=0
|
||||||
|
teletoken=''
|
||||||
try:
|
try:
|
||||||
with open('cookie.txt','r') as f:
|
with open('cookie.txt','r') as f:
|
||||||
cookie=f.read()
|
cookie=f.read()
|
||||||
|
@ -40,7 +42,7 @@ getheader={
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'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',
|
'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',
|
'X-Platform': '0',
|
||||||
'Authorization': cookie,
|
'Authorization': str(cookie),
|
||||||
'Origin': 'https://cg.163.com',
|
'Origin': 'https://cg.163.com',
|
||||||
'Sec-Fetch-Site': 'same-site',
|
'Sec-Fetch-Site': 'same-site',
|
||||||
'Sec-Fetch-Mode': 'cors',
|
'Sec-Fetch-Mode': 'cors',
|
||||||
|
@ -54,7 +56,7 @@ signheader={
|
||||||
'Accept': 'application/json, text/plain, */*',
|
'Accept': 'application/json, text/plain, */*',
|
||||||
'Accept-Encoding': 'gzip, deflate, br',
|
'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',
|
'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',
|
'Connection': 'keep-alive',
|
||||||
'Content-Length': '0',
|
'Content-Length': '0',
|
||||||
'Host': 'n.cg.163.com',
|
'Host': 'n.cg.163.com',
|
||||||
|
@ -73,7 +75,6 @@ def signin(url,header):
|
||||||
|
|
||||||
def getme(url,header):
|
def getme(url,header):
|
||||||
result=r.get(url=url,headers=header)
|
result=r.get(url=url,headers=header)
|
||||||
print(result)
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def send(id,message):
|
def send(id,message):
|
||||||
|
@ -97,3 +98,5 @@ if __name__ == "__main__":
|
||||||
print(message)
|
print(message)
|
||||||
else:
|
else:
|
||||||
message='[网易云游戏自动签到]签到失败,回显状态码为{}\n具体错误信息如下:\n{}'.format(sign.status_code,sign.text)
|
message='[网易云游戏自动签到]签到失败,回显状态码为{}\n具体错误信息如下:\n{}'.format(sign.status_code,sign.text)
|
||||||
|
send(teleid,message)
|
||||||
|
print(message)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user