fix: create download directory before starting task
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -114,6 +114,13 @@ func (task *Task) Start() {
|
||||
task.UpdateStatus(db, "error", fmt.Errorf("bilibili.GetSessdata: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
// 确保下载目录存在
|
||||
if err := os.MkdirAll(task.Folder, os.ModePerm); err != nil {
|
||||
task.UpdateStatus(db, "error", fmt.Errorf("创建下载目录失败: %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
client := &bilibili.BiliClient{SESSDATA: sessdata}
|
||||
|
||||
GlobalDownloadSem.Acquire()
|
||||
|
||||
Reference in New Issue
Block a user