blob: b9dc3336f203538ef073730e34f044a3eccdf409 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
package yt
import (
"fmt"
"os/exec"
"git.sr.ht/~gabrielgio/midr/db"
)
func RunYtDlpProcess(entry *db.Entry) error {
args := []string{entry.Link}
output_template := fmt.Sprintf("%s/%%(title)s.%%(ext)s", entry.OutputFolder)
args = append(args, "-o", output_template)
downloaded_txt := fmt.Sprintf("%s/downloaded.txt", entry.OutputFolder)
args = append(args, "--download-archive", downloaded_txt)
if len(entry.DateAfter) > 0 {
args = append(args, "--dateafter", entry.DateAfter)
}
cmd := exec.Command("yt-dlp", args...)
return cmd.Run()
}
|