fix: import paths (fetchers→readers), schema field mismatch, RSS detection

Bugs found during fresh pip install testing:
- readers/*.py still referenced agent_eyes.fetchers → fixed to agent_eyes.readers
- reader.py passed 'author'/'metadata' to UnifiedContent which doesn't have those → use 'extra' field
- RSS URL detection missed domains containing 'rss' (e.g. hnrss.org)
This commit is contained in:
Panniantong
2026-02-24 05:13:52 +01:00
parent 8eab038cb9
commit d891af5b7d
5 changed files with 11 additions and 13 deletions
+3 -5
View File
@@ -51,7 +51,7 @@ class UniversalReader:
return "reddit"
if "github.com" in domain:
return "github"
if url.endswith(".xml") or "/rss" in url or "/feed" in url or "/atom" in url:
if url.endswith(".xml") or "/rss" in url or "/feed" in url or "/atom" in url or "rss" in domain:
return "rss"
return "generic"
@@ -131,9 +131,8 @@ class UniversalReader:
title=data["title"],
content=data.get("content", ""),
url=data["url"],
author=data.get("author", ""),
media_type=MediaType.TEXT,
metadata={"score": data.get("score", 0), "num_comments": data.get("num_comments", 0)},
extra={"author": data.get("author", ""), "score": data.get("score", 0), "num_comments": data.get("num_comments", 0)},
)
if platform == "github":
@@ -145,9 +144,8 @@ class UniversalReader:
title=data["title"],
content=data.get("content", ""),
url=data["url"],
author=data.get("author", ""),
media_type=MediaType.TEXT,
metadata={k: v for k, v in data.items() if k not in ("title", "content", "url", "author", "platform")},
extra={k: v for k, v in data.items() if k not in ("title", "content", "url", "platform")},
)
if platform == "telegram":