Move scripts and refactor bjxd.py with AI support

Rename/move scripts (baitianGame.js -> backup/, chinaUnicom.py & bjxd.py -> daily/) and tidy README formatting. Major refactor of bjxd.py: add generic AI support (AI_API_KEY, AI_REQUEST_URL, AI_MODEL, AI_REQUEST_PARAMS) while keeping backward compatibility for HUNYUAN/GLM keys, load .env when available, improve HTTP requests (timeout, headers), use defensive .get() access for JSON fields, enhanced logging and error handling, add article browse exception handling and task flow/delay improvements, and minor behavior tweaks (device header, push notification on no users). Also add new Env declarations for scripts.
This commit is contained in:
smallfawn committed 2026-04-02 10:22:19 +08:00
1 parent c9641a7f9f
commit 8b2a3b37d2
4 files changed
+211 -112

No files matched your search

-3
View File
@@ -9,15 +9,12 @@
| 阿里云盘签到 | 2026-04-02 08:56:23 | ✅ |
| 爱玛会员俱乐部 | 2026-04-02 09:08:43 | ✅ |
| 快手极速版 | 2026-04-02 09:08:43 | ✅ |
# 青龙面板拉库命令
`ql repo https://github.com/smallfawn/QLScriptPublic.git backup main`
## 免责声明
这里的脚本只是自己学习 js 的一个实践 仅用于测试和学习研究,禁止用于商业用途...
这里的脚本只是自己学习 js 的一个实践 仅用于测试和学习研究,禁止用于商业用途,不能保证其合法性,准确性,完整性和有效性,请根据情况自行判断.
仓库内所有资源文件,禁止任何公众号、自媒体进行任何形式的转载、发布。
File renamed without changes.
+210 -108
View File
@@ -1,21 +1,25 @@
"""
北京现代 APP 自动任务脚本
功能:自动完成签到、浏览文章、每日答题等任务
new Env("北京现代")
cron: 25 6 * * *
new Env("北京现代");
环境变量:
BJXD_DEVICE 安卓写android 苹果IOS写iOS
BJXD: str - 北京现代 APP api token (多个账号用英文逗号分隔,建议每个账号一个变量)
BJXD1/BJXD2/BJXD3: str - 北京现代 APP api token (每个账号一个变量)
BJXD_ANSWER: str - 预设答案 (可选, ABCD 中的一个)
HUNYUAN_API_KEY: str - 腾讯混元AI APIKey (可选)
AI_API_KEY: str - 通用 AI APIKey (可选)
AI_REQUEST_URL: str - 通用 AI 请求 URL (可选)
AI_MODEL: str - 通用 AI 模型名称 (可选)
AI_REQUEST_PARAMS: str - 通用 AI 请求参数 (可选, JSON 格式字符串)
HUNYUAN_API_KEY: str - 腾讯混元AI APIKey (已废弃,不建议使用)
GLM_API_KEY: str - 智谱 GLM AI APIKey (已废弃,不建议使用)
cron: 25 6 * * *
"""
import os
import random
import time
import json
from datetime import datetime
from typing import List, Dict, Any
import requests
@@ -60,7 +64,12 @@ class BeiJingHyundai:
self.users: List[Dict[str, Any]] = [] # 所有用户信息列表
self.correct_answer: str = "" # 正确答案
self.preset_answer: str = "" # 预设答案
self.ai_api_key: str = "" # 腾讯混元AI APIKey
self.ai_hunyuan_api_key: str = "" # 腾讯混元AI APIKey(兼容旧环境变量)
self.ai_glm_api_key: str = "" # 智谱 GLM AI APIKey(兼容旧环境变量)
self.ai_api_key: str = "" # 通用 AI APIKey
self.ai_request_url: str = "" # AI 请求地址
self.ai_model: str = "" # AI 模型
self.ai_request_params: str = "" # AI 请求参数(JSON字符串格式)
self.wrong_answers: set = set() # 错误答案集合
self.log_content: str = "" # 日志内容
@@ -88,16 +97,17 @@ class BeiJingHyundai:
Dict[str, Any]: API响应数据
"""
url = f"{self.BASE_URL}{endpoint}"
headers = {"token": self.token, "device": os.getenv("BJXD_DEVICE", "android")}
headers = {"token": self.token, "device": "iOS", "app-version": "8.31.2"}
if "headers" not in kwargs:
kwargs["headers"] = headers
else:
kwargs["headers"].update(headers)
try:
response = requests.request(method, url, **kwargs)
response = requests.request(method, url, timeout=30, **kwargs)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
self.log(f"❌ API request failed: {str(e)}")
return {"code": -1, "msg": str(e)}
@@ -110,16 +120,16 @@ class BeiJingHyundai:
response = self.make_request("GET", self.API_USER_INFO)
print(f"get_user_info API response ——> {response}")
if response["code"] == 0:
data = response["data"]
if response.get("code") == 0:
data = response.get("data", {})
# 直接生成掩码后的手机号
masked_phone = f"{data['phone'][:3]}******{data['phone'][-2:]}"
masked_phone = f"{data.get('phone', '')[:3]}******{data.get('phone', '')[-2:]}"
return {
"token": self.token,
"hid": data["hid"],
"nickname": data["nickname"],
"hid": data.get("hid", ""),
"nickname": data.get("nickname", ""),
"phone": masked_phone, # 直接存储掩码后的手机号
"score_value": data["score_value"],
"score_value": data.get("score_value", 0),
"share_user_hid": "",
"task": {"sign": False, "view": False, "question": False},
}
@@ -133,29 +143,30 @@ class BeiJingHyundai:
response = self.make_request("GET", self.API_MY_SCORE, params=params)
print(f"get_score_details API response ——> {response}")
if response["code"] == 0:
data = response["data"]
if response.get("code") == 0:
data = response.get("data", {})
# 先获取今日记录
today = datetime.now().strftime("%Y-%m-%d")
points_record = data.get("points_record", {})
today_records = [
record
for record in data["points_record"]["list"]
if record["created_at"].startswith(today)
for record in points_record.get("list", [])
if record.get("created_at", "").startswith(today)
]
# 计算今日积分变化
today_score = sum(
int(record["score_str"].strip("+")) for record in today_records
int(record.get("score_str", "0").strip("+")) for record in today_records
)
today_score_str = f"+{today_score}" if today_score > 0 else str(today_score)
self.log(f"🎉 总积分: {data['score']} | 今日积分变动: {today_score_str}")
self.log(f"🎉 总积分: {data.get('score', 0)} | 今日积分变动: {today_score_str}")
# 输出今日积分记录
if today_records:
self.log("今日积分记录:")
for record in today_records:
self.log(
f"{record['created_at']} {record['desc']} {record['score_str']}"
f"{record.get('created_at', '')} {record.get('desc', '')} {record.get('score_str', '')}"
)
else:
self.log("今日暂无积分变动")
@@ -166,8 +177,8 @@ class BeiJingHyundai:
response = self.make_request("GET", self.API_TASK_LIST)
print(f"get_task_status API response ——> {response}")
if response["code"] != 0:
self.log(f'❌ 获取任务列表失败: {response["msg"]}')
if response.get("code") != 0:
self.log(f'❌ 获取任务列表失败: {response.get("msg", "未知错误")}')
return
actions = response.get("data", {})
@@ -201,17 +212,17 @@ class BeiJingHyundai:
response = self.make_request("GET", self.API_SIGN_LIST)
print(f"get_sign_info (attempt {attempt + 1}) API response ——> {response}")
if response["code"] != 0:
self.log(f'❌ 获取签到列表失败: {response["msg"]}')
if response.get("code") != 0:
self.log(f'❌ 获取签到列表失败: {response.get("msg", "未知错误")}')
break
data = response["data"]
hid = data["hid"]
reward_hash = data["rewardHash"]
data = response.get("data", {})
hid = data.get("hid", "")
reward_hash = data.get("rewardHash", "")
for item in data["list"]:
if item["hid"] == hid:
current_score = item["score"]
for item in data.get("list", []):
if item.get("hid") == hid:
current_score = item.get("score", 0)
print(
f"第{attempt + 1}次获取签到列表: score={current_score} hid={hid} rewardHash={reward_hash}"
)
@@ -245,10 +256,10 @@ class BeiJingHyundai:
response = self.make_request("POST", self.API_SIGN_SUBMIT, json=json_data)
print(f"submit_sign API response ——> {response}")
if response["code"] == 0:
if response.get("code") == 0:
self.log(f"✅ 签到成功 | 积分 +{score}")
else:
self.log(f'❌ 签到失败: {response["msg"]}')
self.log(f'❌ 签到失败: {response.get("msg", "未知错误")}')
# 文章浏览相关
def get_article_list(self) -> List[str]:
@@ -261,19 +272,30 @@ class BeiJingHyundai:
response = self.make_request("GET", self.API_ARTICLE_LIST, params=params)
print(f"get_article_list API response ——> {response}")
if response["code"] == 0:
if response.get("code") == 0:
# 从文章列表中随机选择3个ID
article_list = [item["data_id"] for item in response["data"]["list"]]
data = response.get("data", {})
article_list = [item.get("data_id", "") for item in data.get("list", []) if item.get("data_id")]
return random.sample(article_list, min(3, len(article_list)))
self.log(f'❌ 获取文章列表失败: {response["msg"]}')
self.log(f'❌ 获取文章列表失败: {response.get("msg", "未知错误")}')
return []
def get_article_detail(self, article_id: str) -> None:
"""浏览文章"""
self.log(f"浏览文章 article_id: {article_id}")
endpoint = self.API_ARTICLE_DETAIL.format(article_id)
self.make_request("GET", endpoint)
try:
# 调用make_request访问文章详情
response = self.make_request("GET", endpoint)
# 记录响应状态,便于调试
if response.get("code") == -1:
self.log(f"⚠️ 文章浏览异常: {response.get('msg', '未知错误')}")
else:
self.log(f"✅ 文章浏览成功")
except Exception as e:
# 捕获所有可能的异常,确保脚本不会在此处中断
self.log(f"❌ 文章浏览过程中发生异常: {str(e)}")
def submit_article_score(self) -> None:
"""提交文章积分"""
@@ -286,11 +308,12 @@ class BeiJingHyundai:
)
print(f"submit_article_score API response ——> {response}")
if response["code"] == 0:
score = response["data"]["score"]
if response.get("code") == 0:
data = response.get("data", {})
score = data.get("score", 0)
self.log(f"✅ 浏览文章成功 | 积分 +{score}")
else:
self.log(f'❌ 浏览文章失败: {response["msg"]}')
self.log(f'❌ 浏览文章失败: {response.get("msg", "未知错误")}')
# 答题相关
def get_question_info(self, share_user_hid: str) -> None:
@@ -298,16 +321,18 @@ class BeiJingHyundai:
params = {"date": datetime.now().strftime("%Y%m%d")}
response = self.make_request("GET", self.API_QUESTION_INFO, params=params)
print(f"get_question_info API response ——> {response}")
if response["code"] != 0:
self.log(f'❌ 获取问题失败: {response["msg"]}')
if response.get("code") != 0:
self.log(f'❌ 获取问题失败: {response.get("msg", "未知错误")}')
return
# response['data']['state'] 1=表示未答题 2=已答题且正确 3=答错且未有人帮忙答题 4=答错但有人帮忙答题
if response["data"].get("state") == 3:
data = response.get("data", {})
# data['state'] 1=表示未答题 2=已答题且正确 3=答错且未有人帮忙答题 4=答错但有人帮忙答题
if data.get("state") == 3:
self.log("今日已答题但回答错误,当前无人帮助答题,跳过")
return
if response["data"].get("state") != 1:
if response["data"].get("answer"):
answer = response["data"]["answer"][0]
if data.get("state") != 1:
if data.get("answer"):
answer = data.get("answer", [""])[0]
if answer in ["A", "B", "C", "D"]:
self.correct_answer = answer
self.log(f"今日已答题,跳过,答案:{answer}")
@@ -315,18 +340,18 @@ class BeiJingHyundai:
self.log("今日已答题,但未获取到答案,跳过")
return
question_info = response["data"]["question_info"]
questions_hid = question_info["questions_hid"]
question_info = data.get("question_info", {})
questions_hid = question_info.get("questions_hid", "")
# 构建问题字符串,只包含未被标记为错误的选项
question_str = f"{question_info['content']}\n"
question_str = f"{question_info.get('content', '')}\n"
valid_options = []
for option in question_info["option"]:
if option["option"] not in self.wrong_answers:
for option in question_info.get("option", []):
if option.get("option") not in self.wrong_answers:
valid_options.append(option)
question_str += f'{option["option"]}. {option["option_content"]}\n'
question_str += f'{option.get("option", "")}. {option.get("option_content", "")}\n'
else:
print(f"跳过错误选项 {option['option']}. {option['option_content']}")
print(f"跳过错误选项 {option.get('option', '')}. {option.get('option_content', '')}")
print(f"\n问题详情:\n{question_str}")
@@ -345,32 +370,54 @@ class BeiJingHyundai:
self.submit_question_answer(questions_hid, answer, share_user_hid)
def get_ai_answer(self, question: str) -> str:
"""获取AI答案"""
"""获取通用AI答案"""
if not self.ai_api_key or not self.ai_request_url or not self.ai_model:
return ""
headers = {
"Authorization": f"Bearer {self.ai_api_key}",
"Content-Type": "application/json",
}
prompt = f"你是一个专业的北京现代汽车专家,请直接给出这个单选题的答案,并且不要带'答案'等其他内容。\n{question}"
# 构建默认的消息内容
system_prompt = "你是一位北京现代汽车品牌的专家,对车型配置非常熟悉。\n以下是一道单选题,请只从题目实际列出的选项里选择正确答案。\n注意:题目可能只给出 2 个或 3 个选项,并非永远 4 个。\n请仅输出对应选项的那个英文字母,不要输出任何其他字符。"
# 构建默认的 json_data
json_data = {
"model": "hunyuan-turbo",
"messages": [{"role": "user", "content": prompt}],
"enable_enhancement": True,
"force_search_enhancement": True,
"enable_instruction_search": True,
"model": self.ai_model,
"messages": [
{"role": "system", "content": system_prompt},
{"role": "user", "content": question}
]
}
# 如果提供了额外的请求参数,合并到 json_data 中
if self.ai_request_params:
try:
extra_params = json.loads(self.ai_request_params)
json_data.update(extra_params)
except json.JSONDecodeError as e:
print(f"❌ AI 请求参数解析失败: {str(e)}")
try:
print(f"通用 AI API request ——> {json_data}")
response = requests.post(
"https://api.hunyuan.cloud.tencent.com/v1/chat/completions",
self.ai_request_url,
headers=headers,
json=json_data,
)
print(f"通用 AI API response status ——> {response.status_code}")
print(f"通用 AI API response text ——> {response.text}")
response.raise_for_status()
response_json = response.json()
print(f"腾讯混元AI API response ——> {response_json}")
# 获取AI回答内容并转大写
ai_response = response_json["choices"][0]["message"]["content"].upper()
choices = response_json.get("choices", [])
if choices and len(choices) > 0:
message = choices[0].get("message", {})
ai_response = message.get("content", "").upper()
else:
ai_response = ""
# 使用集合操作找出有效答案
valid_answers = set("ABCD") - self.wrong_answers
@@ -380,11 +427,11 @@ class BeiJingHyundai:
if found_answers:
return found_answers.pop()
else:
print(f"❌ 没有找到符合的 AI 答案")
self.log(f"❌ 没有找到符合的 AI 答案")
return ""
except Exception as e:
print(f"腾讯混元AI API 请求失败: {str(e)}")
self.log(f"通用 AI API 请求失败: {str(e)}")
return ""
@@ -400,8 +447,8 @@ class BeiJingHyundai:
self.log(f"使用预设答案: {self.preset_answer}")
return self.preset_answer
# 3. 存在AI APIKey时,使用AI答案
if self.ai_api_key:
# 3. 存在AI配置时,使用通用AI方法获取答案
if self.ai_api_key and self.ai_request_url and self.ai_model:
ai_answer = self.get_ai_answer(question)
if ai_answer:
self.log(f"使用 AI 答案: {ai_answer}")
@@ -425,12 +472,14 @@ class BeiJingHyundai:
params = {"date": datetime.now().strftime("%Y%m%d")}
response = self.make_request("GET", self.API_QUESTION_INFO, params=params)
print(f"get_answered_question API response ——> {response}")
if response["code"] != 0:
self.log(f'❌ 从已答题账号获取问题失败: {response["msg"]}')
if response.get("code") != 0:
self.log(f'❌ 从已答题账号获取问题失败: {response.get("msg", "未知错误")}')
return
# response['data']['state'] 1=表示未答题 2=已答题且正确 4=已答题但错误
if response["code"] == 0 and response["data"].get("answer"):
answer = response["data"]["answer"][0]
data = response.get("data", {})
# data['state'] 1=表示未答题 2=已答题且正确 4=已答题但错误
if response.get("code") == 0 and data.get("answer"):
answer = data.get("answer", [""])[0]
if answer in ["A", "B", "C", "D"]:
self.correct_answer = answer
self.log(f"从已答题账号获取到答案:{answer}")
@@ -453,9 +502,9 @@ class BeiJingHyundai:
response = self.make_request("POST", self.API_QUESTION_SUBMIT, json=json_data)
print(f"submit_question_answer API response ——> {response}")
if response["code"] == 0:
data = response["data"]
if data["state"] == 3: # 答错
if response.get("code") == 0:
data = response.get("data", {})
if data.get("state") == 3: # 答错
# 记录错误答案
self.wrong_answers.add(answer)
# 如果是正确答案,清除它
@@ -465,13 +514,13 @@ class BeiJingHyundai:
if self.preset_answer == answer:
self.preset_answer = ""
self.log("❌ 答题错误")
elif data["state"] == 2: # 答对了
elif data.get("state") == 2: # 答对了
if self.correct_answer != answer:
self.correct_answer = answer
score = data["answer_score"]
score = data.get("answer_score", 0)
self.log(f"✅ 答题正确 | 积分 +{score}")
else:
self.log(f'❌ 答题失败: {response["msg"]}')
self.log(f'❌ 答题失败: {response.get("msg", "未知错误")}')
def get_backup_share_hid(self, user_hid: str) -> str:
"""从备用 hid 列表中获取一个不同于用户自身的 hid"""
@@ -480,6 +529,14 @@ class BeiJingHyundai:
def run(self) -> None:
"""运行主程序"""
try:
from dotenv import load_dotenv
load_dotenv()
print("✅ dotenv 成功加载 .env 文件")
except ImportError:
print("⚠️ 缺少 dotenv 库, 青龙环境请忽略, 本地运行请安装此库")
# 使用列表保持顺序,使用集合实现去重
tokens = []
tokens_set = set()
@@ -518,12 +575,41 @@ class BeiJingHyundai:
self.log(f"👻 共获取到用户 token {len(tokens)} 个")
self.ai_api_key = os.getenv("HUNYUAN_API_KEY", "")
self.log(
"💯 已获取到腾讯混元 AI APIKey, 使用腾讯混元 AI 答题"
if self.ai_api_key
else "😭 未设置腾讯混元 AI HUNYUAN_API_KEY 环境变量,使用随机答题"
)
# 获取新的 AI 配置参数
self.ai_api_key = os.getenv("AI_API_KEY", "")
self.ai_request_url = os.getenv("AI_REQUEST_URL", "")
self.ai_model = os.getenv("AI_MODEL", "")
self.ai_request_params = os.getenv("AI_REQUEST_PARAMS", "")
# 兼容旧的环境变量
if not self.ai_api_key and not self.ai_request_url and not self.ai_model:
# 检查旧的腾讯混元 AI 配置
self.ai_hunyuan_api_key = os.getenv("HUNYUAN_API_KEY", "")
if self.ai_hunyuan_api_key:
self.ai_api_key = self.ai_hunyuan_api_key
self.ai_request_url = "https://api.hunyuan.cloud.tencent.com/v1/chat/completions"
self.ai_model = "hunyuan-turbo"
self.ai_request_params = json.dumps({"enable_enhancement": True, "force_search_enhancement": True, "enable_instruction_search": True})
self.log("💯 已获取到腾讯混元 AI 配置, 使用腾讯混元 AI 答题")
else:
self.log("😭 未设置腾讯混元 AI HUNYUAN_API_KEY 环境变量")
# 检查旧的智谱 GLM AI 配置
self.ai_glm_api_key = os.getenv("GLM_API_KEY", "")
if self.ai_glm_api_key:
self.ai_api_key = self.ai_glm_api_key
self.ai_request_url = "https://open.bigmodel.cn/api/paas/v4/chat/completions"
self.ai_model = "glm-4.5-flash"
self.ai_request_params = json.dumps({"do_sample": False})
self.log("💯 已获取到智谱 GLM AI 配置, 使用智谱 GLM AI 答题")
else:
self.log("😭 未设置智谱 GLM AI GLM_API_KEY 环境变量")
else:
# 使用新的 AI 配置
if self.ai_api_key and self.ai_request_url and self.ai_model:
self.log("💯 已获取到通用 AI 配置, 使用通用 AI 答题")
else:
self.log("⚠️ 通用 AI 配置不完整, 请检查 AI_API_KEY、AI_REQUEST_URL 和 AI_MODEL 环境变量")
# 获取预设答案
self.preset_answer = os.getenv("BJXD_ANSWER", "").upper()
@@ -534,26 +620,30 @@ class BeiJingHyundai:
self.preset_answer = ""
self.log("❌ 预设答案格式错误,仅支持 A/B/C/D")
self.log("获取用户信息")
# 获取所有用户信息
for token in tokens:
self.token = token
user = self.get_user_info()
if user:
self.users.append(user)
time.sleep(random.randint(3, 5))
if not self.users:
self.log("❌ 未获取到有效用户")
# 最后推送通知
self.push_notification()
return
# 设置分享用户ID
for i, user in enumerate(self.users):
prev_index = (i - 1) if i > 0 else len(self.users) - 1
# 如果有多个用户且上一个用户不是自己,使用上一个用户的 hid
if len(self.users) > 1 and self.users[prev_index]["hid"] != user["hid"]:
user["share_user_hid"] = self.users[prev_index]["hid"]
if len(self.users) > 1 and self.users[prev_index].get("hid") != user.get("hid"):
user["share_user_hid"] = self.users[prev_index].get("hid", "")
else:
# 否则从备用 hid 列表中选择一个
user["share_user_hid"] = self.get_backup_share_hid(user["hid"])
user["share_user_hid"] = self.get_backup_share_hid(user.get("hid", ""))
# 执行任务
self.log("\n============ 执行任务 ============")
@@ -571,11 +661,11 @@ class BeiJingHyundai:
# 打印用户信息
self.log(
f"👻 用户名: {self.user['nickname']} | "
f"手机号: {self.user['phone']} | "
f"积分: {self.user['score_value']}\n"
f"🆔 用户hid: {self.user['hid']}\n"
f"🆔 分享hid: {self.user['share_user_hid']}"
f"👻 用户名: {self.user.get('nickname', '未知')} | "
f"手机号: {self.user.get('phone', '未知')} | "
f"积分: {self.user.get('score_value', 0)}\n"
f"🆔 用户hid: {self.user.get('hid', '')}\n"
f"🆔 分享hid: {self.user.get('share_user_hid', '')}"
)
# 检查任务状态
@@ -583,36 +673,48 @@ class BeiJingHyundai:
self.log(f"任务状态: {self.user['task']}")
# 调试使用 设置任务状态
self.user["task"]["question"] = True
# self.user["task"]["sign"] = False
# self.user["task"]["view"] = False
# self.user["task"]["question"] = False
# 签到
if not self.user["task"]["sign"]:
# 获取任务状态
user_task = self.user.get("task", {})
# 任务:答题
if not user_task.get("question"):
self.get_question_info(self.user.get("share_user_hid", ""))
else:
self.log("✅ 答题任务 已完成,跳过")
if not self.correct_answer:
self.get_answered_question()
# 任务:签到
if not user_task.get("sign"):
self.get_sign_info()
time.sleep(random.randint(5, 10))
else:
self.log("✅ 签到任务 已完成,跳过")
# 阅读文章
if not self.user["task"]["view"]:
# 任务:阅读文章
if not user_task.get("view"):
article_ids = self.get_article_list()
if article_ids:
for article_id in article_ids: # 已经只有3篇了
for index, article_id in enumerate(article_ids): # 已经只有3篇了
self.log(f"🔄 开始处理第 {index + 1}/{len(article_ids)} 篇文章")
try:
self.get_article_detail(article_id)
except Exception as e:
self.log(f"❌ 第 {index + 1} 篇文章处理失败: {str(e)}")
# 每篇文章之间的延迟
time.sleep(random.randint(10, 15))
# 所有文章处理完成后提交积分
try:
self.submit_article_score()
except Exception as e:
self.log(f"❌ 提交文章积分失败: {str(e)}")
else:
self.log("✅ 浏览文章任务 已完成,跳过")
# 答题
if not self.user["task"]["question"]:
self.get_question_info(self.user["share_user_hid"])
else:
self.log("✅ 答题任务 已完成,跳过")
if not self.correct_answer:
self.get_answered_question()
self.log("\n============ 积分详情 ============")
for i, user in enumerate(self.users, 1):
if i > 1:
@@ -627,7 +729,7 @@ class BeiJingHyundai:
# 打印用户信息
self.log(
f"👻 用户名: {self.user['nickname']} | 手机号: {self.user['phone']}"
f"👻 用户名: {self.user.get('nickname', '未知')} | 手机号: {self.user.get('phone', '未知')}"
)
# 显示积分详情
+1 -1
View File
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
中国联通 Python 版 v1.0.5
new Env('中国联通');
包含以下功能:
1. 首页签到 (话费红包/积分)
2. 联通祝福 (各类抽奖)