Skip to content

Commit

Permalink
fix: unable to download in linux
Browse files Browse the repository at this point in the history
  • Loading branch information
itsHenry35 committed Sep 16, 2024
1 parent 3e5ab18 commit a7663dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gui/download2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "乐读-下载"
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit a7663dd

Please sign in to comment.