Close video file that exists when checking
This commit is contained in:
@@ -63,8 +63,9 @@ func DownloadR(url string) error {
|
||||
}
|
||||
|
||||
fullVideoPath := filepath.Join(OUTPUT_DIR, videoAuthor, videoTitle+".mp4")
|
||||
_, err = os.Open(fullVideoPath)
|
||||
videoFileHandle, err := os.Open(fullVideoPath)
|
||||
if err == nil {
|
||||
videoFileHandle.Close()
|
||||
log.Printf("File %s already exists, skipping download", fullVideoPath)
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user