slight dl-only PoC

This commit is contained in:
2026-01-21 15:40:40 -05:00
parent 1b9437fea9
commit 9345a941fb
6 changed files with 90 additions and 11 deletions

29
app/ytdlp.go Normal file
View File

@@ -0,0 +1,29 @@
package main
import (
"time"
"fmt"
"context"
"github.com/lrstanley/go-ytdlp"
)
func downloadVideo(out_dir, url string) {
dl := ytdlp.New().
SetWorkDir(out_dir).
FormatSort("res,ext:mp4:m4a").
RecodeVideo("mp4").
ProgressFunc(100*time.Millisecond, func(prog ytdlp.ProgressUpdate) {
fmt.Printf(
"%s @ %s [eta: %s] :: %s\n",
prog.Status,
prog.PercentString(),
prog.ETA(),
prog.Filename,
)
}).
Output("%(extractor)s - %(title)s.%(ext)s")
_, err := dl.Run(context.TODO(), url)
if err != nil {
panic(err)
}
}