本次更新为 multi-platform-media-manage 项目添加了以下增强功能,以解决跨区域发布时遇到的风控问题。
微信视频号(weixin):
✅ 推荐配置:
{
"platform": "weixin",
"proxy": {
"enabled": false // 微信视频号建议不使用代理
}
}
其他平台:
文件: server/python/utils/stealth.py
提供以下反检测能力:
navigator.webdriver 属性文件: server/python/platforms/base.py
改进的 init_browser 方法:
文件: server/python/app.py
新增 _test_proxy_for_platform 函数:
端点: POST /proxy/test
用于在发布前测试代理配置:
// 请求
{
"provider": "shenlong",
"productKey": "your-product-key",
"signature": "your-signature",
"platform": "douyin" // 可选,测试对特定平台的可用性
}
// 响应
{
"success": true,
"proxy": "http://x.x.x.x:port",
"platform_test": {
"ok": true,
"blocked": false,
"cost_ms": 1234
}
}
文件: server/python/platforms/base.py
新增方法:
human_like_delay(): 模拟随机延迟human_like_scroll(): 模拟滚动行为human_like_type(): 模拟输入行为random_mouse_move(): 随机移动鼠标POST /publish
{
"platform": "douyin",
"cookie": "your-cookies",
"title": "视频标题",
"video_path": "/path/to/video.mp4",
"proxy": {
"enabled": true,
"provider": "shenlong",
"productKey": "your-key",
"signature": "your-sign",
"regionCode": "500000" // 重庆
}
}
POST /publish/ai-assisted
{
"platform": "douyin",
"cookie": "your-cookies",
"title": "视频标题",
"video_path": "/path/to/video.mp4",
"headless": false, // 显示浏览器窗口,便于处理验证码
"return_screenshot": true,
"proxy": {
"enabled": true,
"provider": "shenlong",
"productKey": "your-key",
"signature": "your-sign"
}
}
curl -X POST http://localhost:5005/proxy/test \
-H "Content-Type: application/json" \
-d '{
"provider": "shenlong",
"productKey": "your-key",
"signature": "your-sign",
"platform": "douyin"
}'
首次发布:
headless: false 显示浏览器窗口批量发布:
遇到验证码:
need_captcha: true 时手动处理查看日志:
[Proxy] shenlong resolved: city=- area=500100 candidates=5/10
[Proxy] test ok: 192.168.***.***:8080 cost=234ms
[Proxy] platform douyin ok: 192.168.***.***:8080 cost=1234ms
[douyin] 已注入反检测脚本
检查截图:
screenshot_base64原因: 代理 IP 可能被目标平台标记
解决方案:
/proxy/test 接口测试代理原因: 浏览器指纹或行为模式被识别
解决方案:
headless: false 观察页面行为原因: 代理 IP 与账号登录地不一致
解决方案:
--disable-blink-features=AutomationControlled 参数add_init_script()_test_proxy_connectivity)_test_proxy_for_platform)utils/stealth.py 反检测脚本base.py 浏览器初始化/proxy/test 和 /proxy/platforms API