From 643caedd8c3f21838d17d0051beaba4f95968e0b Mon Sep 17 00:00:00 2001 From: Andrea Fazzi Date: Tue, 9 Nov 2021 06:35:57 +0100 Subject: [PATCH] Save proper filename --- backend/youtube/youtube-dl/youtube-dl.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/youtube/youtube-dl/youtube-dl.go b/backend/youtube/youtube-dl/youtube-dl.go index 7b13f80..1bd2cac 100644 --- a/backend/youtube/youtube-dl/youtube-dl.go +++ b/backend/youtube/youtube-dl/youtube-dl.go @@ -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)