package yt import ( "fmt" "io" "os/exec" ) func RunYtDlpProcess(link string, output string) string { output_template := fmt.Sprintf("%s/%%(title)s.%%(ext)s", output) cmd := exec.Command("yt-dlp", link, "-o", output_template) cmdOut, _ := cmd.StdoutPipe() cmd.Start() cmd.Wait() cmdOutBytes, _ := io.ReadAll(cmdOut) return string(cmdOutBytes) }