Close video file that exists when checking

This commit is contained in:
2024-11-05 16:03:38 +01:00
parent 9b38ea7068
commit 07c20f4582

View File

@@ -63,8 +63,9 @@ func DownloadR(url string) error {
} }
fullVideoPath := filepath.Join(OUTPUT_DIR, videoAuthor, videoTitle+".mp4") fullVideoPath := filepath.Join(OUTPUT_DIR, videoAuthor, videoTitle+".mp4")
_, err = os.Open(fullVideoPath) videoFileHandle, err := os.Open(fullVideoPath)
if err == nil { if err == nil {
videoFileHandle.Close()
log.Printf("File %s already exists, skipping download", fullVideoPath) log.Printf("File %s already exists, skipping download", fullVideoPath)
return nil return nil
} }