update start.sh

This commit is contained in:
mshe 2026-06-08 16:22:16 +08:00
parent 7f2758820f
commit 6d8e52f484
1 changed files with 3 additions and 4 deletions

7
app.py
View File

@ -47,7 +47,7 @@ async def start_spider(spider_code: str) -> str:
try:
# 调用外部 start_spider.sh 脚本,传入 spider_code 作为参数
process = await asyncio.create_subprocess_exec(
"/home/dgs/vnc-server/bin/start_spider.sh",
"/home/dgs/vnc-server/start_spider.sh",
spider_code,
stdout=asyncio.subprocess.PIPE,
stderr=asyncio.subprocess.PIPE
@ -82,12 +82,11 @@ async def close_vnc_server(index: int) -> str:
except Exception as e:
return f"❌ 执行出错: {str(e)}"
# 单参数模板
@mcp.resource("data://spider_code")
def get_spider_code_list() -> str:
spider_list = [
{"spider_code": "01","name": "阳光采购爬虫"},
{"spider_code": "02","name": "QQ邮箱爬虫"},
{"code": "01","name": "阳光采购爬虫"},
{"code": "02","name": "QQ邮箱爬虫"},
]
return json.dumps(spider_list, ensure_ascii=False)
# 运行服务器