精确描述每个渠道的能力层次
核心修改: - GitHub: 零配置=公开仓库可读可搜,配置 gh/token 后=Fork、Issue、PR、Review 全部可用 - Reddit: 三层能力——Exa 搜索(免费)→代理读帖子→OAuth Bot 高级操作(发帖等) - 小红书: 必须配 Cookie,没有降级方案,明确说明 - B站: 本地可用/服务器需代理,区分清楚 - Twitter: 零配置可读推文,birdx+Cookie 解锁搜索发推 每个渠道的 check() 方法都改为自定义逻辑,精确反映当前环境的实际能力。
This commit is contained in:
@@ -14,13 +14,13 @@ Agent Eyes 把最好的开源工具粘在一起,一次安装全部搞定。
|
|||||||
|------|------|:--------:|------|
|
|------|------|:--------:|------|
|
||||||
| 🌐 **网页** | 阅读 | 零配置 | 任意 URL → 干净 Markdown([Jina Reader](https://github.com/jina-ai/reader) ⭐9.8K 驱动) |
|
| 🌐 **网页** | 阅读 | 零配置 | 任意 URL → 干净 Markdown([Jina Reader](https://github.com/jina-ai/reader) ⭐9.8K 驱动) |
|
||||||
| 🐦 **Twitter/X** | 阅读 · 搜索 | 零配置 / Cookie | 单条推文零配置可读(Jina Reader)。装 [birdx](https://github.com/runesleo/birdx) + Cookie 解锁搜索、时间线、发推 |
|
| 🐦 **Twitter/X** | 阅读 · 搜索 | 零配置 / Cookie | 单条推文零配置可读(Jina Reader)。装 [birdx](https://github.com/runesleo/birdx) + Cookie 解锁搜索、时间线、发推 |
|
||||||
| 📕 **小红书** | 阅读 · 搜索 · **发帖 · 评论 · 点赞 · 收藏** | Cookie | 完整操作能力:发图文/视频笔记、回复评论、查看用户主页 |
|
| 📕 **小红书** | 阅读 · 搜索 · **发帖 · 评论 · 点赞 · 收藏** | Cookie | 配置 Cookie 即可使用全部功能:发图文/视频笔记、回复评论、查看用户主页 |
|
||||||
| 🔍 **全网搜索** | 搜索 | 免费 Key | AI 语义搜索,一个 Key 搜全网 + Reddit + Twitter([Exa](https://exa.ai) 驱动) |
|
| 🔍 **全网搜索** | 搜索 | 免费 Key | AI 语义搜索,一个 Key 搜全网 + Reddit + Twitter([Exa](https://exa.ai) 驱动) |
|
||||||
| 📦 **GitHub** | 阅读 · 搜索 | 零配置 | 公开仓库代码、README、搜索([GitHub API](https://docs.github.com/en/rest) 驱动)。设 token 可访问私有仓库 |
|
| 📦 **GitHub** | 阅读 · 搜索 | 零配置 | 公开仓库直接可用。配置 `gh` CLI 或 Token 后可解锁 Fork、Issue、PR、Review 等完整操作 |
|
||||||
| 📺 **YouTube** | 阅读 | 零配置 | 1800+ 视频网站字幕提取([yt-dlp](https://github.com/yt-dlp/yt-dlp) ⭐148K 驱动) |
|
| 📺 **YouTube** | 阅读 | 零配置 | 1800+ 视频网站字幕提取([yt-dlp](https://github.com/yt-dlp/yt-dlp) ⭐148K 驱动) |
|
||||||
| 📺 **B站** | 阅读 | 零配置 / 代理 | 视频信息 + 字幕。本地直接用,服务器需代理 |
|
| 📺 **B站** | 阅读 | 零配置 / 代理 | 视频信息 + 字幕。本地直接用,服务器配个代理即可 |
|
||||||
| 📡 **RSS** | 阅读 | 零配置 | 任意 RSS/Atom 源([feedparser](https://github.com/kurtmckee/feedparser) ⭐2.3K 驱动) |
|
| 📡 **RSS** | 阅读 | 零配置 | 任意 RSS/Atom 源([feedparser](https://github.com/kurtmckee/feedparser) ⭐2.3K 驱动) |
|
||||||
| 📖 **Reddit** | 搜索 · 阅读 | 免费 / 代理 | 搜索通过 Exa 免费可用;完整阅读需代理 |
|
| 📖 **Reddit** | 搜索 · 阅读 | 免费 / 代理 | 搜索通过 Exa 免费直接可用。读帖子配个代理即可。配置 OAuth Bot 可解锁高级搜索和发帖 |
|
||||||
|
|
||||||
> **配置难度说明:** 零配置 = 装好即用 · 免费 Key = 30 秒注册 · Cookie = 从浏览器导出 · 代理 = $1/月
|
> **配置难度说明:** 零配置 = 装好即用 · 免费 Key = 30 秒注册 · Cookie = 从浏览器导出 · 代理 = $1/月
|
||||||
|
|
||||||
@@ -112,7 +112,7 @@ $ agent-eyes doctor
|
|||||||
========================================
|
========================================
|
||||||
|
|
||||||
✅ 装好即用:
|
✅ 装好即用:
|
||||||
✅ GitHub 仓库和代码 — 公开仓库可用。配置 github_token 可访问私有仓库
|
✅ GitHub 仓库和代码 — 公开仓库可读可搜。配置 gh CLI 或 Token 可解锁 Fork、Issue、PR 等操作
|
||||||
✅ Twitter/X 推文 — 可读取推文。安装 birdx + 配置 Cookie 可解锁搜索和发推
|
✅ Twitter/X 推文 — 可读取推文。安装 birdx + 配置 Cookie 可解锁搜索和发推
|
||||||
✅ YouTube 视频字幕 — yt-dlp
|
✅ YouTube 视频字幕 — yt-dlp
|
||||||
⚠️ B站视频信息和字幕 — 服务器 IP 可能被封,配置代理即可解决
|
⚠️ B站视频信息和字幕 — 服务器 IP 可能被封,配置代理即可解决
|
||||||
@@ -123,8 +123,8 @@ $ agent-eyes doctor
|
|||||||
⬜ 全网语义搜索 — 注册 exa.ai 获取免费 Key,配置一下就能用
|
⬜ 全网语义搜索 — 注册 exa.ai 获取免费 Key,配置一下就能用
|
||||||
|
|
||||||
🔧 配置后可用:
|
🔧 配置后可用:
|
||||||
⬜ Reddit 帖子和评论 — 配个代理就能用
|
⬜ Reddit 帖子和评论 — 搜索用 Exa 免费可用。读帖子需配个代理
|
||||||
⬜ 小红书笔记 — 导入浏览器 Cookie 就能用
|
⬜ 小红书笔记 — 需要配置 Cookie 才能访问。导入浏览器 Cookie 即可
|
||||||
|
|
||||||
状态:6/9 个渠道可用
|
状态:6/9 个渠道可用
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -27,10 +27,12 @@ class GitHubChannel(Channel):
|
|||||||
return h
|
return h
|
||||||
|
|
||||||
def check(self, config=None):
|
def check(self, config=None):
|
||||||
|
import shutil
|
||||||
token = config.get("github_token") if config else None
|
token = config.get("github_token") if config else None
|
||||||
if token:
|
has_gh = shutil.which("gh")
|
||||||
return "ok", "已认证,可访问私有仓库"
|
if token or has_gh:
|
||||||
return "ok", "公开仓库可用。配置 github_token 可访问私有仓库"
|
return "ok", "完整可用(读取、搜索、Fork、Issue、PR 等)"
|
||||||
|
return "ok", "公开仓库可读可搜。配置 gh CLI 或 github_token 可解锁 Fork、Issue、PR 等操作"
|
||||||
|
|
||||||
def can_handle(self, url: str) -> bool:
|
def can_handle(self, url: str) -> bool:
|
||||||
domain = urlparse(url).netloc.lower()
|
domain = urlparse(url).netloc.lower()
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ Backend: Reddit public JSON API (append .json to any URL)
|
|||||||
Swap to: any Reddit access method
|
Swap to: any Reddit access method
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
import os
|
||||||
import requests
|
import requests
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from .base import Channel, ReadResult
|
from .base import Channel, ReadResult
|
||||||
@@ -14,7 +15,6 @@ class RedditChannel(Channel):
|
|||||||
name = "reddit"
|
name = "reddit"
|
||||||
description = "Reddit 帖子和评论"
|
description = "Reddit 帖子和评论"
|
||||||
backends = ["Reddit JSON API"]
|
backends = ["Reddit JSON API"]
|
||||||
requires_config = ["reddit_proxy"]
|
|
||||||
tier = 2
|
tier = 2
|
||||||
|
|
||||||
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
|
USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36"
|
||||||
@@ -23,6 +23,18 @@ class RedditChannel(Channel):
|
|||||||
domain = urlparse(url).netloc.lower()
|
domain = urlparse(url).netloc.lower()
|
||||||
return "reddit.com" in domain or "redd.it" in domain
|
return "reddit.com" in domain or "redd.it" in domain
|
||||||
|
|
||||||
|
def check(self, config=None):
|
||||||
|
proxy = config.get("reddit_proxy") if config else None
|
||||||
|
has_bot = bool(os.environ.get("REDDIT_CLIENT_ID"))
|
||||||
|
if proxy and has_bot:
|
||||||
|
return "ok", "完整可用(代理 + OAuth Bot)"
|
||||||
|
elif proxy:
|
||||||
|
return "ok", "代理已配置,可读取帖子。配置 REDDIT_CLIENT_ID/SECRET 可解锁高级搜索和发帖"
|
||||||
|
elif has_bot:
|
||||||
|
return "warn", "OAuth Bot 已配置,但服务器直连可能被封。配个代理更稳定:agent-eyes configure proxy URL"
|
||||||
|
else:
|
||||||
|
return "off", "搜索用 Exa 免费可用。读帖子需配个代理:agent-eyes configure proxy URL"
|
||||||
|
|
||||||
async def read(self, url: str, config=None) -> ReadResult:
|
async def read(self, url: str, config=None) -> ReadResult:
|
||||||
proxy = config.get("reddit_proxy") if config else None
|
proxy = config.get("reddit_proxy") if config else None
|
||||||
proxies = {"http": proxy, "https": proxy} if proxy else None
|
proxies = {"http": proxy, "https": proxy} if proxy else None
|
||||||
|
|||||||
@@ -16,13 +16,18 @@ class XiaoHongShuChannel(Channel):
|
|||||||
name = "xiaohongshu"
|
name = "xiaohongshu"
|
||||||
description = "小红书笔记"
|
description = "小红书笔记"
|
||||||
backends = ["XHS Web API"]
|
backends = ["XHS Web API"]
|
||||||
requires_config = ["xhs_cookie"]
|
|
||||||
tier = 2
|
tier = 2
|
||||||
|
|
||||||
def can_handle(self, url: str) -> bool:
|
def can_handle(self, url: str) -> bool:
|
||||||
domain = urlparse(url).netloc.lower()
|
domain = urlparse(url).netloc.lower()
|
||||||
return "xiaohongshu.com" in domain or "xhslink.com" in domain
|
return "xiaohongshu.com" in domain or "xhslink.com" in domain
|
||||||
|
|
||||||
|
def check(self, config=None):
|
||||||
|
cookie = config.get("xhs_cookie") if config else None
|
||||||
|
if cookie:
|
||||||
|
return "ok", "Cookie 已配置,完整可用"
|
||||||
|
return "off", "需要配置 Cookie 才能访问。导入浏览器 Cookie 即可:agent-eyes configure --from-browser chrome"
|
||||||
|
|
||||||
async def read(self, url: str, config=None) -> ReadResult:
|
async def read(self, url: str, config=None) -> ReadResult:
|
||||||
cookie = config.get("xhs_cookie") if config else None
|
cookie = config.get("xhs_cookie") if config else None
|
||||||
|
|
||||||
|
|||||||
@@ -64,12 +64,8 @@ def format_report(results: Dict[str, dict]) -> str:
|
|||||||
for key, r in tier2.items():
|
for key, r in tier2.items():
|
||||||
if r["status"] == "ok":
|
if r["status"] == "ok":
|
||||||
lines.append(f" ✅ {r['name']} — {r['message']}")
|
lines.append(f" ✅ {r['name']} — {r['message']}")
|
||||||
else:
|
elif r["status"] == "warn":
|
||||||
# Friendly message about what to configure
|
lines.append(f" ⚠️ {r['name']} — {r['message']}")
|
||||||
if "proxy" in str(r.get("message", "")):
|
|
||||||
lines.append(f" ⬜ {r['name']} — 配个代理就能用:agent-eyes configure proxy URL")
|
|
||||||
elif "cookie" in str(r.get("message", "")):
|
|
||||||
lines.append(f" ⬜ {r['name']} — 导入浏览器 Cookie 就能用:agent-eyes configure --from-browser chrome")
|
|
||||||
else:
|
else:
|
||||||
lines.append(f" ⬜ {r['name']} — {r['message']}")
|
lines.append(f" ⬜ {r['name']} — {r['message']}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user