From 99328bac6e7ca71e28babb1cd2941139c885d352 Mon Sep 17 00:00:00 2001 From: Misty <43715693+yang7758258@users.noreply.github.com> Date: Sat, 6 Jul 2024 10:40:43 +0800 Subject: [PATCH] =?UTF-8?q?Create=20=E9=95=BF=E8=99=B9=E7=BE=8E=E8=8F=B1.p?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...77\350\231\271\347\276\216\350\217\261.py" | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 "\351\225\277\350\231\271\347\276\216\350\217\261.py" diff --git "a/\351\225\277\350\231\271\347\276\216\350\217\261.py" "b/\351\225\277\350\231\271\347\276\216\350\217\261.py" new file mode 100644 index 0000000..50f0d8b --- /dev/null +++ "b/\351\225\277\350\231\271\347\276\216\350\217\261.py" @@ -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}")