Add alerts to downloader

This commit is contained in:
2024-06-25 13:28:58 +02:00
parent 089e7f637f
commit aad190d94c
4 changed files with 27 additions and 1 deletions

View File

@@ -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