From aa9d54390feb00c69f6afaaa0245710f808618a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9D=E6=B8=85?= <919836565@qq.com> Date: Sun, 8 Feb 2026 01:25:43 +0800 Subject: [PATCH] cdbyid --- .gitignore | 9 ++++++++- 123pan.py | 15 +++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 6551392..68af61b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ 123pan_config.json download/* -123pan.txt \ No newline at end of file +123pan.txt +dist/* +build/* +123pan.dist/* +.idea/* +123pan.exe +123pan.spec +android.py \ No newline at end of file diff --git a/123pan.py b/123pan.py index cff3a87..aa0f3a3 100644 --- a/123pan.py +++ b/123pan.py @@ -860,6 +860,21 @@ class Pan123: print(f"已切换到 {protocol} 协议") return True + def cdById(self, file_id: int): + """根据文件夹ID切换目录""" + # 重置文件页数和文件列表 + self.all_file = False + self.file_page = 0 + self.list = [] + + # 更新当前目录ID和目录列表 + self.parent_file_id = file_id + self.parent_file_list.append(self.parent_file_id) + + # 获取新目录内容并显示 + self.get_dir() + self.show() + if __name__ == "__main__": """主交互函数"""