These should check for failure

This commit is contained in:
Logan G 2025-01-03 02:02:27 -07:00
parent dc0f9af220
commit b282f3df37
Signed by: logan
GPG key ID: E328528C921E7A7A

View file

@ -65,6 +65,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) {
defer videoDLResult.Close() defer videoDLResult.Close()
file, err := os.OpenFile(tempPath+"-vid", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) file, err := os.OpenFile(tempPath+"-vid", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
return err
}
defer file.Close() defer file.Close()
io.Copy(file, videoDLResult) io.Copy(file, videoDLResult)
@ -85,6 +89,10 @@ func downloadVideo(url string, path string, group GroupConfig) (err error) {
defer audioDLResult.Close() defer audioDLResult.Close()
file, err := os.OpenFile(tempPath+"-audio", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644) file, err := os.OpenFile(tempPath+"-audio", os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0644)
if err != nil {
return err
}
defer file.Close() defer file.Close()
io.Copy(file, audioDLResult) io.Copy(file, audioDLResult)