From a7663dd77c424e37b6d5cff0e1d8cd0ec67f7f15 Mon Sep 17 00:00:00 2001 From: Henry <2671230065@qq.com> Date: Mon, 16 Sep 2024 21:35:01 +0800 Subject: [PATCH] fix: unable to download in linux --- gui/download2.py | 4 ++-- main.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/download2.py b/gui/download2.py index aaaffc7..49d1c7c 100644 --- a/gui/download2.py +++ b/gui/download2.py @@ -156,7 +156,7 @@ def get_cram_class(course, user_id, access_token): } -def download2(course_list, user_id, access_token, aria2_path, aria2_config, custom_down_path, now, all): +def download2(course_list, user_id, access_token, aria2_path, aria2_config, custom_down_path, now, all, isWindows): global aria2process if custom_down_path == '': custom_down_path = "乐读-下载" @@ -216,7 +216,7 @@ def switchpauseresume(button): root = ttk.Window(title='乐读视频下载器-下载', themename="morph") root.geometry("") if now==1: - aria2process = subprocess.Popen([aria2_path, "--conf-path", aria2_config], shell=True) + aria2process = subprocess.Popen([aria2_path, "--conf-path", aria2_config], shell=isWindows) time.sleep(1) jsonrpc = Aria2RPC() lecturers = get_lecturers(course_list, user_id, access_token) diff --git a/main.py b/main.py index abd90b8..9709756 100644 --- a/main.py +++ b/main.py @@ -55,7 +55,7 @@ def download(): result, custom_down_path = download1(uid, token) aria2_path, aria2_config = get_aria2c_path_conf() for count, course in enumerate(result): - download2(course, uid, token, aria2_path, aria2_config, custom_down_path, count + 1, len(result)) + download2(course, uid, token, aria2_path, aria2_config, custom_down_path, count + 1, len(result), platform.system()=="Windows") def get_aria2c_path_conf():