sources: авто-расширение из публичных API без ключей (46 живых), universal generic_json, bsky/mastodon, --only по префиксу, auto_cycle
Some checks failed
ci / test (3.10) (push) Has been cancelled
ci / test (3.11) (push) Has been cancelled
ci / test (3.12) (push) Has been cancelled

This commit is contained in:
Vlad Gothbreach
2026-10-27 20:00:48 +03:00
parent f263d3ffff
commit 31a8dd8c4d
8 changed files with 650 additions and 17 deletions

31
tools/check_yield.py Normal file
View File

@@ -0,0 +1,31 @@
"""Проверка yield каждого источника: имя | items | первых 2 заголовка."""
import sys
import traceback
from concurrent.futures import ThreadPoolExecutor
sys.path.insert(0, ".")
from omni import feeds, sources # noqa: E402
prefix = sys.argv[1] if len(sys.argv) > 1 else "aa_"
picked = [s for s in sources.SOURCES if s.name.startswith(prefix)]
print("sources:", len(picked))
def run(src):
try:
items = feeds.fetch(src, limit=min(20, src.limit or 20))
return src.name, len(items), [i.title[:60] for i in items[:2]], ""
except Exception as exc:
return src.name, 0, [], "%s: %s" % (type(exc).__name__, str(exc)[:70])
with ThreadPoolExecutor(max_workers=10) as ex:
rows = list(ex.map(run, picked))
live = 0
for name, n, titles, err in sorted(rows, key=lambda r: -r[1]):
flag = "LIVE" if n else "DEAD"
live += bool(n)
print("%-26s %-4s %3d %s" % (name, flag, n, err or " | ".join(titles)))
print("LIVE %d / %d, items %d" % (live, len(rows), sum(r[1] for r in rows)))