From 64bee1de43d587f0716244b1a9497f998ee9cd1f Mon Sep 17 00:00:00 2001 From: limil Date: Sat, 2 Aug 2025 17:44:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PikPakFileSystem.py | 8 ++++---- aria2helper.py | 2 +- main.py | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PikPakFileSystem.py b/PikPakFileSystem.py index fa58f2b..09abcf3 100644 --- a/PikPakFileSystem.py +++ b/PikPakFileSystem.py @@ -151,9 +151,9 @@ class PikPakFileSystem: return node return None - async def _refresh(self, node : NodeBase): + async def _refresh(self, node : NodeBase, no_cache : bool = False): if isinstance(node, DirNode): - if node.lastUpdate != None: + if not no_cache and node.lastUpdate != None: return next_page_token : str = None children_info : list[Dict[str, Any]] = [] @@ -283,11 +283,11 @@ class PikPakFileSystem: await self._refresh(node) return node.url - async def GetChildrenNames(self, path : str, ignore_files : bool) -> list[str]: + async def GetChildrenNames(self, path : str, ignore_files : bool, no_cache : bool = False) -> list[str]: node = await self._path_to_node(path) if not isinstance(node, DirNode): return [] - await self._refresh(node) + await self._refresh(node, no_cache) children_names : list[str] = [] for child_id in node.children_id: child = await self._get_node_by_id(child_id) diff --git a/aria2helper.py b/aria2helper.py index 27b036f..49b93ae 100644 --- a/aria2helper.py +++ b/aria2helper.py @@ -9,7 +9,7 @@ class Aria2Status(Enum): COMPLETE = "complete" REMOVED = "removed" -ARIA_ADDRESS = "http://100.96.0.2:6800/jsonrpc" +ARIA_ADDRESS = "http://192.168.31.21:30001/jsonrpc" ARIA_SECRET = "jfaieofjosiefjoiaesjfoiasejf" BASE_PATH = "/downloads" diff --git a/main.py b/main.py index 9b24205..e534153 100644 --- a/main.py +++ b/main.py @@ -197,7 +197,7 @@ class App(cmd2.Cmd): List files in a directory """ if await Client.IsDir(args.path): - for child_name in await Client.GetChildrenNames(args.path, False): + for child_name in await Client.GetChildrenNames(args.path, False, True): await self.print(child_name) else: await self.print(await Client.GetFileUrlByPath(args.path))