fix: 修复 MCP 模式无法下载文件的问题

Closes #322
This commit is contained in:
Quan 2025-11-30 10:55:45 +08:00
parent 1e5ffc1907
commit 41c83af184
4 changed files with 5 additions and 3 deletions

View File

@ -38,7 +38,6 @@ class XHSDownloader(App):
**self.parameter, **self.parameter,
_print=False, _print=False,
) )
self.APP.init_script_server()
async def on_mount(self) -> None: async def on_mount(self) -> None:
self.theme = "nord" self.theme = "nord"

View File

@ -168,6 +168,7 @@ class XHS:
self.queue = Queue() self.queue = Queue()
self.event = Event() self.event = Event()
self.script = None self.script = None
self.init_script_server()
def __extract_image(self, container: dict, data: Namespace): def __extract_image(self, container: dict, data: Namespace):
container["下载地址"], container["动图地址"] = self.image.get_image_link( container["下载地址"], container["动图地址"] = self.image.get_image_link(
@ -750,7 +751,7 @@ class XHS:
) -> dict: ) -> dict:
msg, data = await self.deal_detail_mcp( msg, data = await self.deal_detail_mcp(
url, url,
False, True,
index, index,
) )
match ( match (

View File

@ -286,6 +286,7 @@ class Download:
str(error), str(error),
ERROR, ERROR,
) )
return False
@staticmethod @staticmethod
def __create_progress( def __create_progress(

View File

@ -1,6 +1,7 @@
**项目更新内容:** **项目更新内容:**
1. 调整内置延时机制 1. 修复 MCP 模式无法下载文件的问题
2. 调整内置延时机制
***** *****