48h article window, add CISA feeds, remove dead feeds

This commit is contained in:
bot
2026-04-29 10:28:09 +03:00
parent 47d8394568
commit 898909e061
4 changed files with 8 additions and 9 deletions
+5 -5
View File
@@ -219,12 +219,12 @@ class RSSFeedManager:
'canonical_url': canonical_url,
}
def is_article_from_today(self, published_dt: datetime) -> bool:
"""Allow only items published on today's UTC date."""
now_utc = datetime.now(timezone.utc).date()
def is_article_recent(self, published_dt: datetime) -> bool:
"""Allow articles published within the last 48 hours."""
if published_dt.tzinfo is None:
published_dt = published_dt.replace(tzinfo=timezone.utc)
return published_dt.astimezone(timezone.utc).date() == now_utc
age = datetime.now(timezone.utc) - published_dt.astimezone(timezone.utc)
return age.total_seconds() <= 48 * 3600
def is_duplicate_article(self, article: Dict) -> bool:
"""Check URL/content fingerprint duplicates against sent-history."""
@@ -309,7 +309,7 @@ class RSSFeedManager:
published_dt = datetime(*published[:6], tzinfo=timezone.utc)
# Strict real-time gate: today's UTC articles only.
if not self.is_article_from_today(published_dt):
if not self.is_article_recent(published_dt):
continue
# Get content/description