feat: 启用杨浩功能并调整日志时间戳设置为系统时间

This commit is contained in:
Your Name committed 2026-01-16 17:46:09 +08:00
1 parent 575d6f3fd5
commit 8d31e0ba1a
5 files changed
+41 -27

No files matched your search

+1 -1
View File
@@ -70,7 +70,7 @@
"fudai_quiet_hours_enabled": true,
"fudai_quiet_start_hour": 2,
"fudai_quiet_end_hour": 9,
"yanghao_enabled": false,
"yanghao_enabled": true,
"yanghao_enable_actions": true,
"yanghao_like_icon_x": 988,
"yanghao_like_icon_y": 1218,
+2 -2
View File
@@ -75,8 +75,8 @@ class fudai_analyse:
self._run_id = str(int(time.time()))
self._log_seq = 0
self._log_kv_orig = None
# 设置使用真实时间戳(显示实际年份而不是系统时间)
self._use_real_timestamp = True
# 日志时间戳使用系统时间(不强制替换年份)
self._use_real_timestamp = False
# 使用增强版本(通过日志包装器)
self._log_kv = lambda *args, **kwargs: douyin_logging_wrapper.LoggingWrapper.enhanced_log_kv(
self, *args, **kwargs
+18 -6
View File
@@ -466,13 +466,25 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
if button_text:
# 检查是否包含无法参与的关键词
unable_to_participate_keywords = [
"无法参与", "不能参与", "不可参与", "还没到时间", "活动已结束",
"活动结束", "已结束", "已过期", "已截止", "时长不足"
"无法参与",
"不能参与",
"不可参与",
"还没到时间",
"活动已结束",
"活动结束",
"已结束",
"已过期",
"已截止",
"时长不足",
]
watch_required_keywords = [
"还需看播", "观看", "看播", "观看时长", "观看分钟"
"还需看播",
"观看",
"看播",
"观看时长",
"观看分钟",
]
# 检查无法参与关键词
for keyword in unable_to_participate_keywords:
if keyword in button_text:
@@ -493,7 +505,7 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
elapsed_seconds=round(elapsed, 2),
)
return True, "button_unable_to_participate"
# 检查观看要求关键词
for keyword in watch_required_keywords:
if keyword in button_text:
@@ -514,7 +526,7 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
elapsed_seconds=round(elapsed, 2),
)
return True, "button_watch_required"
try:
analyser._log_kv(
"筛选",
+18 -6
View File
@@ -4311,13 +4311,25 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
if button_text:
# 检查是否包含无法参与的关键词
unable_to_participate_keywords = [
"无法参与", "不能参与", "不可参与", "还没到时间", "活动已结束",
"活动结束", "已结束", "已过期", "已截止", "时长不足"
"无法参与",
"不能参与",
"不可参与",
"还没到时间",
"活动已结束",
"活动结束",
"已结束",
"已过期",
"已截止",
"时长不足",
]
watch_required_keywords = [
"还需看播", "观看", "看播", "观看时长", "观看分钟"
"还需看播",
"观看",
"看播",
"观看时长",
"观看分钟",
]
# 检查无法参与关键词
for keyword in unable_to_participate_keywords:
if keyword in button_text:
@@ -4338,7 +4350,7 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
elapsed_seconds=round(elapsed, 2),
)
return True, "button_unable_to_participate"
# 检查观看要求关键词
for keyword in watch_required_keywords:
if keyword in button_text:
@@ -4359,7 +4371,7 @@ def should_skip_fudai_by_config(analyser: Any, detail: Tuple) -> Tuple[bool, str
elapsed_seconds=round(elapsed, 2),
)
return True, "button_watch_required"
try:
analyser._log_kv(
"筛选",
+2 -12
View File
@@ -174,19 +174,9 @@ class LoggingWrapper:
except Exception:
analyser._log_seq = 1
# 获取时间戳
# 获取时间戳(使用系统时间)
try:
# 检查是否启用真实时间戳(显示实际年份而不是系统时间)
use_real_timestamp = getattr(analyser, "_use_real_timestamp", False)
if use_real_timestamp:
# 使用真实时间:获取当前实际年份,但保持其他时间部分
now = datetime.now()
# 假设真实年份是2024(可以根据需要调整)
real_year = 2024
real_now = now.replace(year=real_year)
timestamp = real_now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
else:
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S.%f")[:-3]
except Exception:
# 如果无法导入 datetime(极少见),回退为 time.strftime
try: