refactor: remove Douyin, Weibo and WeChat channels (#347)
All three had rotted past honest usability: - Douyin's upstream (yzfly/douyin-mcp-server) is archived and required a 4-step manual local-server setup nobody could complete - Weibo depended on an unmaintained personal fork (mcp-server-weibo) - WeChat full-article reading was increasingly blocked by anti-bot (#339) while doctor still advertised it as zero-config Removes the channel files, installers, skill routing/trigger entries, reference sections and README rows (zh+en). Honest counts: 13 platforms, 6 zero-config. They can return when maintained upstreams exist. Follows the v1.4.0 precedent of removing Discord/Toutiao (#234). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -16,10 +16,7 @@ from .rss import RSSChannel
|
||||
from .bilibili import BilibiliChannel
|
||||
from .exa_search import ExaSearchChannel
|
||||
from .xiaohongshu import XiaoHongShuChannel
|
||||
from .douyin import DouyinChannel
|
||||
from .linkedin import LinkedInChannel
|
||||
from .wechat import WeChatChannel
|
||||
from .weibo import WeiboChannel
|
||||
from .xiaoyuzhou import XiaoyuzhouChannel
|
||||
from .v2ex import V2EXChannel
|
||||
from .xueqiu import XueqiuChannel
|
||||
@@ -32,10 +29,7 @@ ALL_CHANNELS: List[Channel] = [
|
||||
RedditChannel(),
|
||||
BilibiliChannel(),
|
||||
XiaoHongShuChannel(),
|
||||
DouyinChannel(),
|
||||
LinkedInChannel(),
|
||||
WeChatChannel(),
|
||||
WeiboChannel(),
|
||||
XiaoyuzhouChannel(),
|
||||
V2EXChannel(),
|
||||
XueqiuChannel(),
|
||||
|
||||
@@ -1,61 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Douyin (抖音) — check if mcporter + douyin-mcp-server is available."""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from agent_reach.utils.process import utf8_subprocess_env
|
||||
|
||||
from .base import Channel
|
||||
|
||||
|
||||
class DouyinChannel(Channel):
|
||||
name = "douyin"
|
||||
description = "抖音短视频"
|
||||
backends = ["douyin-mcp-server"]
|
||||
tier = 2
|
||||
|
||||
def can_handle(self, url: str) -> bool:
|
||||
from urllib.parse import urlparse
|
||||
d = urlparse(url).netloc.lower()
|
||||
return "douyin.com" in d or "iesdouyin.com" in d
|
||||
|
||||
def check(self, config=None):
|
||||
mcporter = shutil.which("mcporter")
|
||||
if not mcporter:
|
||||
return "off", (
|
||||
"需要 mcporter + douyin-mcp-server。安装步骤:\n"
|
||||
" 1. npm install -g mcporter\n"
|
||||
" 2. pip install douyin-mcp-server\n"
|
||||
" 3. 启动服务(见下方说明)\n"
|
||||
" 4. mcporter config add douyin http://localhost:18070/mcp\n"
|
||||
" 详见 https://github.com/yzfly/douyin-mcp-server"
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "config", "list"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=5,
|
||||
env=utf8_subprocess_env(),
|
||||
)
|
||||
if "douyin" not in r.stdout:
|
||||
return "off", (
|
||||
"mcporter 已装但抖音 MCP 未配置。运行:\n"
|
||||
" pip install douyin-mcp-server\n"
|
||||
" # 启动服务后:\n"
|
||||
" mcporter config add douyin http://localhost:18070/mcp"
|
||||
)
|
||||
except Exception:
|
||||
return "off", "mcporter 连接异常"
|
||||
# Verify MCP connectivity by listing available tools instead of
|
||||
# calling with a hardcoded (invalid) share link that always fails.
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "list", "douyin"],
|
||||
capture_output=True, encoding="utf-8", errors="replace", timeout=15,
|
||||
env=utf8_subprocess_env(),
|
||||
)
|
||||
if r.returncode == 0 and r.stdout.strip():
|
||||
return "ok", "完整可用(视频解析、下载链接获取)"
|
||||
return "warn", "MCP 已连接但工具列表为空,检查 douyin-mcp-server 服务是否在运行"
|
||||
except Exception:
|
||||
return "warn", "MCP 连接异常,检查 douyin-mcp-server 服务是否在运行"
|
||||
@@ -1,63 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""WeChat Official Account articles — read and search.
|
||||
|
||||
Read: Exa crawling (primary) / Camoufox stealth browser (optional)
|
||||
Search: Exa web_search with includeDomains mp.weixin.qq.com
|
||||
"""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
from .base import Channel
|
||||
|
||||
|
||||
def _exa_available() -> bool:
|
||||
mcporter = shutil.which("mcporter")
|
||||
if not mcporter:
|
||||
return False
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "config", "list"],
|
||||
capture_output=True, encoding="utf-8", errors="replace", timeout=5,
|
||||
)
|
||||
return "exa" in r.stdout.lower()
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
class WeChatChannel(Channel):
|
||||
name = "wechat"
|
||||
description = "微信公众号文章"
|
||||
backends = ["Exa via mcporter (搜索+阅读)", "Camoufox (可选阅读)"]
|
||||
tier = 0
|
||||
|
||||
def can_handle(self, url: str) -> bool:
|
||||
from urllib.parse import urlparse
|
||||
d = urlparse(url).netloc.lower()
|
||||
return "mp.weixin.qq.com" in d or "weixin.qq.com" in d
|
||||
|
||||
def check(self, config=None):
|
||||
has_exa = _exa_available()
|
||||
has_camoufox = False
|
||||
try:
|
||||
import camoufox # noqa: F401
|
||||
has_camoufox = True
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
if has_exa and has_camoufox:
|
||||
return "ok", "完整可用(Exa 搜索 + Exa/Camoufox 阅读公众号文章)"
|
||||
elif has_exa:
|
||||
return "ok", (
|
||||
"通过 Exa 搜索和阅读微信公众号文章(免费,无需额外配置)。"
|
||||
"可选安装 Camoufox 获得更好的全文阅读效果。"
|
||||
)
|
||||
elif has_camoufox:
|
||||
return "warn", (
|
||||
"Camoufox 可阅读公众号文章,但搜索功能需要 Exa。"
|
||||
"运行 `agent-reach install --env=auto` 安装 Exa。"
|
||||
)
|
||||
else:
|
||||
return "off", (
|
||||
"需要 mcporter + Exa MCP 来搜索和阅读微信公众号文章。\n"
|
||||
"运行 `agent-reach install --env=auto` 安装。"
|
||||
)
|
||||
@@ -1,59 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Weibo (微博) — check if mcporter + mcp-server-weibo is available."""
|
||||
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from agent_reach.utils.process import utf8_subprocess_env
|
||||
|
||||
from .base import Channel
|
||||
|
||||
|
||||
class WeiboChannel(Channel):
|
||||
name = "weibo"
|
||||
description = "微博动态与热搜"
|
||||
backends = ["mcp-server-weibo"]
|
||||
tier = 1
|
||||
|
||||
def can_handle(self, url: str) -> bool:
|
||||
from urllib.parse import urlparse
|
||||
d = urlparse(url).netloc.lower()
|
||||
return "weibo.com" in d or "weibo.cn" in d
|
||||
|
||||
def check(self, config=None):
|
||||
mcporter = shutil.which("mcporter")
|
||||
if not mcporter:
|
||||
return "off", (
|
||||
"需要 mcporter + mcp-server-weibo。安装步骤:\n"
|
||||
" 1. npm install -g mcporter\n"
|
||||
" 2. pip install git+https://github.com/Panniantong/mcp-server-weibo.git\n"
|
||||
" 3. mcporter config add weibo --command 'mcp-server-weibo' "
|
||||
"--env PYTHONUTF8=1 --env PYTHONIOENCODING=utf-8\n"
|
||||
" 详见 https://github.com/Panniantong/mcp-server-weibo"
|
||||
)
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "config", "list"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=5,
|
||||
env=utf8_subprocess_env(),
|
||||
)
|
||||
if "weibo" not in r.stdout:
|
||||
return "off", (
|
||||
"mcporter 已装但微博 MCP 未配置。运行:\n"
|
||||
" pip install git+https://github.com/Panniantong/mcp-server-weibo.git\n"
|
||||
" mcporter config add weibo --command 'mcp-server-weibo' "
|
||||
"--env PYTHONUTF8=1 --env PYTHONIOENCODING=utf-8"
|
||||
)
|
||||
except Exception:
|
||||
return "off", "mcporter 连接异常"
|
||||
try:
|
||||
r = subprocess.run(
|
||||
[mcporter, "list", "weibo"], capture_output=True,
|
||||
encoding="utf-8", errors="replace", timeout=15,
|
||||
env=utf8_subprocess_env(),
|
||||
)
|
||||
if r.returncode == 0 and "search_users" in r.stdout:
|
||||
return "ok", "完整可用(热搜、搜索、用户动态、评论)"
|
||||
return "warn", "MCP 已配置但工具加载失败,检查 mcp-server-weibo 版本"
|
||||
except Exception:
|
||||
return "warn", "MCP 连接异常,检查 mcp-server-weibo 是否可用"
|
||||
Reference in New Issue
Block a user