Now an archive program instead of a bulk downloader

This commit is contained in:
Logan G 2024-12-31 19:08:47 -07:00
parent d9b58bbade
commit 0c3104dfc8
Signed by: logan
GPG key ID: E328528C921E7A7A

10
ytva.go
View file

@ -144,10 +144,20 @@ func main() {
} }
} }
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
log.Infof("Downloading video: %s", v.Title) log.Infof("Downloading video: %s", v.Title)
if err := downloadVideo(v.WebpageURL, path, group); err != nil { if err := downloadVideo(v.WebpageURL, path, group); err != nil {
log.Error(err) log.Error(err)
} }
} else {
log.Error(err)
continue
}
} else {
log.Infof("Video %s already exists, skipping", v.Title)
continue
}
} }
} }
} }