From b282f3df37772f366dbbc7b506d72ffdbdc7c467 Mon Sep 17 00:00:00 2001 From: Logan G Date: Fri, 3 Jan 2025 02:02:27 -0700 Subject: [PATCH] These should check for failure --- download.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/download.go b/download.go index 9b36c75..11f0cb1 100644 --- a/download.go +++ b/download.go @@ -65,6 +65,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) { defer videoDLResult.Close() file, err := os.OpenFile(tempPath+"-vid", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) + if err != nil { + return err + } + defer file.Close() io.Copy(file, videoDLResult) @@ -85,6 +89,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) { defer audioDLResult.Close() file, err := os.OpenFile(tempPath+"-audio", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) + if err != nil { + return err + } + defer file.Close() io.Copy(file, audioDLResult)