feat: 新增 YouTube/Bilibili/XHS 搜索 CLI 命令 + 修复 B站搜索
- cli.py: 新增 search-youtube / search-bilibili / search-xhs 子命令 - core.py: 新增 search_youtube / search_bilibili / search_xhs 方法 - bilibili.py: 搜索策略改为 yt-dlp → Exa fallback(服务器 IP 被 B站 412) - 本地机器走 yt-dlp bilisearch(有 title/uploader) - 服务器自动 fallback 到 Exa site:bilibili.com - 修复 mcporter 输出解析(Title:/URL: 格式) 测试结果: 15/15 全通(8 read + 7 search)
This commit is contained in:
@@ -66,6 +66,21 @@ def main():
|
||||
p_st.add_argument("query", nargs="+", help="Search query")
|
||||
p_st.add_argument("-n", "--num", type=int, default=10, help="Number of results")
|
||||
|
||||
# ── search-youtube ──
|
||||
p_sy = sub.add_parser("search-youtube", help="Search YouTube")
|
||||
p_sy.add_argument("query", nargs="+", help="Search query")
|
||||
p_sy.add_argument("-n", "--num", type=int, default=5, help="Number of results")
|
||||
|
||||
# ── search-bilibili ──
|
||||
p_sb = sub.add_parser("search-bilibili", help="Search Bilibili")
|
||||
p_sb.add_argument("query", nargs="+", help="Search query")
|
||||
p_sb.add_argument("-n", "--num", type=int, default=5, help="Number of results")
|
||||
|
||||
# ── search-xhs ──
|
||||
p_sx = sub.add_parser("search-xhs", help="Search XiaoHongShu")
|
||||
p_sx.add_argument("query", nargs="+", help="Search query")
|
||||
p_sx.add_argument("-n", "--num", type=int, default=10, help="Number of results")
|
||||
|
||||
# ── setup ──
|
||||
sub.add_parser("setup", help="Interactive configuration wizard")
|
||||
|
||||
@@ -575,6 +590,12 @@ async def _cmd_search(args):
|
||||
results = await eyes.search_github(query, language=getattr(args, "lang", None), limit=num)
|
||||
elif args.command == "search-twitter":
|
||||
results = await eyes.search_twitter(query, limit=num)
|
||||
elif args.command == "search-youtube":
|
||||
results = await eyes.search_youtube(query, limit=num)
|
||||
elif args.command == "search-bilibili":
|
||||
results = await eyes.search_bilibili(query, limit=num)
|
||||
elif args.command == "search-xhs":
|
||||
results = await eyes.search_xhs(query, limit=num)
|
||||
else:
|
||||
print(f"Unknown command: {args.command}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
Reference in New Issue
Block a user