downloader: correct download func to not set title to stdout

This commit is contained in:
HeshamTB 2023-08-20 14:50:42 +03:00
parent 8d983de8ef
commit 766b4075dd

View File

@ -124,17 +124,13 @@ func ytdlpDownload(
ctx *DownloadCtx, downloadCtxs chan *DownloadCtx, errs chan *DownloadCtx) { ctx *DownloadCtx, downloadCtxs chan *DownloadCtx, errs chan *DownloadCtx) {
cmd := exec.Command(YT_DLP, ctx.link) cmd := exec.Command(YT_DLP, ctx.link)
stdout, err := cmd.Output() _, err := cmd.Output()
if err != nil { if err != nil {
ctx.err = &err ctx.err = &err
ctx.status = JOB_STATUS_ERR ctx.status = JOB_STATUS_ERR
errs <- ctx errs <- ctx
return return
} }
title := string(stdout)
title = strings.TrimSpace(title)
ctx.title = title
downloadCtxs <- ctx downloadCtxs <- ctx
} }