Skip to content

Commit

Permalink
ytdlp bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
aimerneige committed Sep 3, 2023
1 parent 375aef5 commit 304ea74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugin/ytdlp/ytdlp.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func init() {
ctx.Send(fmt.Sprintf("视频标题:%s视频大小:%s即将开始下载视频,请稍候。", videoTitle, videoFileSize))
fileName := fmt.Sprintf("%d_%d.mp4", ctx.Event.Sender.ID, time.Now().Unix())
videoFilePath := path.Join(tempFileDir, fileName)
cmdDownload := exec.Command("yt-dlp", url, "-o", videoFilePath)
cmdDownload := exec.Command("yt-dlp", url, "-f", "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best", "-o", videoFilePath)
downloadLogInByte, err := cmdDownload.Output()
downloadLog := string(downloadLogInByte)
if err != nil {
Expand All @@ -77,5 +77,6 @@ func init() {
}
ctx.Send(fmt.Sprintln("文件上传失败。", errMsg))
}
os.Remove(videoFilePath)
})
}

0 comments on commit 304ea74

Please sign in to comment.