The only downloader you need. 下载器的集大成者。
TypeScript asyncasynciobittorentbtcross-platformdownload-managerdownloaderfluent-designftphttp3magnetpyqtpyside6pythonqtquicreactsoftwarestreaming
fix(cli): 修复 Linux 和 macOS 打包版 ghd 命令无效
XiaoYouChR7ee0dcc57691
diff --git a/Ghost-Downloader-3.py b/Ghost-Downloader-3.pyindex c3844218..79a5ed96 100644--- a/Ghost-Downloader-3.py+++ b/Ghost-Downloader-3.py@@ -293,7 +293,9 @@ def startApp(application: Application, primaryInstance: PrimaryInstance, isSilenif __name__ == "__main__":from app.platform import instance- if (exitCode := instance.request(sys.argv, os.getcwd())) is not None:+ # 打包版的 argv[0] 被 Nuitka 换成真实路径,只有 original_argv0 还保留 ghd+ argv = [__compiled__.original_argv0, *sys.argv[1:]] if "__compiled__" in globals() else sys.argv+ if (exitCode := instance.request(argv, os.getcwd())) is not None:sys.exit(exitCode)from app.cli import isSilent@@ -301,10 +303,10 @@ if __name__ == "__main__":setupEnvironment()app = Application(sys.argv)- primaryInstance = instance.open(app, sys.argv, os.getcwd())+ primaryInstance = instance.open(app, argv, os.getcwd())if primaryInstance is None:sys.exit(0)- startApp(app, primaryInstance, isSilent=isSilent(sys.argv[1:]))+ startApp(app, primaryInstance, isSilent=isSilent(argv[1:]))exitCode = app.exec()primaryInstance.close()sys.exit(exitCode)diff --git a/docs/adr/0020-argv-to-primary-instance-over-local-socket.md b/docs/adr/0020-argv-to-primary-instance-over-local-socket.mdindex 78281253..77936317 100644--- a/docs/adr/0020-argv-to-primary-instance-over-local-socket.md+++ b/docs/adr/0020-argv-to-primary-instance-over-local-socket.md@@ -24,4 +24,6 @@- 锁和 socket 按用户区分(Unix 用 uid),与锁 key 为 `DESKTOP_ID` 的旧版本不再互斥。- 以 `ghd` 调用的 argv 一律是子命令:打错的子命令报用法错误,不回落为打开链接,否则没有 Primary Instance 时,打错命令的进程会在 Agent 的 shell 里启动成 GUI。+- 打包版的 `sys.argv[0]` 被 Nuitka 换成真实路径,入口改用 `__compiled__.original_argv0` 判断是否以 `ghd` 调用。+ `EXECUTABLE_PATH` 要的就是真实路径,仍用 `sys.argv[0]`。- stdout 是终端时只把 JSON 缩进显示,不像 gh 那样换成表格:有的 Agent 在伪终端里执行命令,按 TTY 切换输出格式会让它们拿不到 JSON。