Integrate ws client into downloader

This commit is contained in:
2024-06-18 09:38:55 +02:00
parent 0e9ddcd7a4
commit b4d161e8e9
5 changed files with 95 additions and 9 deletions

View File

@@ -30,3 +30,14 @@ func Download(event PBEvent, status chan error) {
log.Printf("Downloaded %s (%s)", event.Record.Id, event.Record.Link)
SetDownloaded(event)
}
func DownloadURL(url string, status chan error) {
log.Printf("Downloading %s", url)
_, err := dl.Run(context.TODO(), url)
if err != nil {
status <- err
return
}
log.Printf("Downloaded %s", url)
}