Skip to content

Commit

Permalink
Fix download id bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AkiChase committed Jun 16, 2022
1 parent f36fd05 commit cabc821
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/course_helper/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ async def run(cls):
if Downloader.file_queue.empty():
break
file_info = Downloader.file_queue.get()
download_id = file_info['download_id']
try:
s = await User.get_login_session()
with s.get('https://course2.xmu.edu.cn/meol/common/script/download.jsp?'
f'fileid={file_info["file_id"]}&resid={file_info["res_id"]}', stream=True) as r:
file_size = int(r.headers['content-length']) # 文件大小 Byte
download_id = file_info['download_id']

# 检查path所在文件夹
cls.download_file_dir_check(file_info['path'])
Expand Down

0 comments on commit cabc821

Please sign in to comment.