Save proper filename

This commit is contained in:
Andrea Fazzi 2021-11-09 06:35:57 +01:00
parent 55d95b1e58
commit 643caedd8c

View file

@ -32,7 +32,7 @@ func (d *YoutubeDlDownloader) StartDownload(video *youtube.Video, tasks task.Tas
}
log.Printf("Download of video ID %s STARTED.", video.ID)
cmd := exec.CommandContext(context.Background(), d.CommandName, "-o", filepath.Join("data/", video.Filename), "--newline", d.Url)
cmd := exec.CommandContext(context.Background(), d.CommandName, "-o", filepath.Join("data/", video.ID+filepath.Ext(video.Filename)), "--newline", d.Url)
stdout, err := cmd.StdoutPipe()
if err != nil {
panic(err)