Skip to content

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

fix: 修复推送时间窗口判断问题

sansancae334d94eb0
diff --git a/main.py b/main.py
index abcec14d1b..be04f808d0 100644
--- a/main.py
+++ b/main.py
@@ -380,7 +380,35 @@ class PushRecordManager:
"""检查当前时间是否在指定时间范围内"""
now = get_beijing_time()
current_time = now.strftime("%H:%M")
- return start_time <= current_time <= end_time
+
+ def normalize_time(time_str: str) -> str:
+ """将时间字符串标准化为 HH:MM 格式"""
+ try:
+ parts = time_str.strip().split(":")
+ if len(parts) != 2:
+ raise ValueError(f"时间格式错误: {time_str}")
+
+ hour = int(parts[0])
+ minute = int(parts[1])
+
+ if not (0 <= hour <= 23 and 0 <= minute <= 59):
+ raise ValueError(f"时间范围错误: {time_str}")
+
+ return f"{hour:02d}:{minute:02d}"
+ except Exception as e:
+ print(f"时间格式化错误 '{time_str}': {e}")
+ return time_str
+
+ normalized_start = normalize_time(start_time)
+ normalized_end = normalize_time(end_time)
+ normalized_current = normalize_time(current_time)
+
+ result = normalized_start <= normalized_current <= normalized_end
+
+ if not result:
+ print(f"时间窗口判断:当前 {normalized_current},窗口 {normalized_start}-{normalized_end}")
+
+ return result
# === 数据获取 ===