Add alerts to downloader
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"log"
|
||||
|
||||
"github.com/lrstanley/go-ytdlp"
|
||||
"github.com/gen2brain/beeep"
|
||||
)
|
||||
|
||||
const OUTPUT_DIR = "C:/Users/Administrator/ytdlpVideos"
|
||||
@@ -33,7 +34,17 @@ var dl = ytdlp.New().
|
||||
|
||||
func DownloadURL(url string, status chan error) {
|
||||
log.Printf("Downloading %s", url)
|
||||
_, err := dl.Run(context.TODO(), url)
|
||||
|
||||
err := beeep.Beep(beeep.DefaultFreq, beeep.DefaultDuration)
|
||||
if err != nil {
|
||||
log.Printf("Failed beeping with %+v", err)
|
||||
}
|
||||
err = beeep.Alert("Download Started", url, "assets/information.png")
|
||||
if err != nil {
|
||||
log.Printf("Failed alerting with %+v", err)
|
||||
}
|
||||
|
||||
_, err = dl.Run(context.TODO(), url)
|
||||
if err != nil {
|
||||
status <- err
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user