-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9085f56
commit 99328ba
Showing
1 changed file
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
import os | ||
|
||
import requests | ||
|
||
|
||
|
||
# 环境变量 chmlck 取url请求头中的token, | ||
|
||
#变量格式 token#备注,多账号换行 | ||
|
||
|
||
|
||
accounts = os.getenv("chmlck", "").splitlines() | ||
|
||
print("☞☞☞ 长虹美菱每日签到 ☜☜☜\n") | ||
|
||
|
||
|
||
if not accounts: | ||
|
||
print("未找到任何账号信息。") | ||
|
||
else: | ||
|
||
for account in accounts: | ||
|
||
if not account.strip(): | ||
|
||
continue | ||
|
||
try: | ||
|
||
token, note = account.split("#") | ||
|
||
except ValueError: | ||
|
||
print(f"格式错误: {account}") | ||
|
||
continue | ||
|
||
|
||
|
||
url = "https://hongke.changhong.com/gw/applet/aggr/signin" | ||
|
||
params = {'aggrId': "608"} | ||
|
||
headers = { | ||
|
||
'User-Agent': "Mozilla/5.0 (Linux; Android 10; Mobile Safari/537.36)", | ||
|
||
'Accept-Encoding': "gzip, deflate", | ||
|
||
'Content-Type': "application/json", | ||
|
||
'Token': token.strip() | ||
|
||
} | ||
|
||
|
||
|
||
try: | ||
|
||
response = requests.post(url, params=params, headers=headers) | ||
|
||
if response.status_code == 200: | ||
|
||
print(f"{note.strip()}:签到成功") | ||
|
||
elif response.status_code == 400: | ||
|
||
print(f"{note.strip()}:请勿重复签到") | ||
|
||
else: | ||
|
||
print(f"{note.strip()}:响应状态码 {response.status_code} - {response.text}") | ||
|
||
except requests.RequestException as e: | ||
|
||
print(f"{note.strip()}:请求失败 - {e}") |