1
0
mirror of https://github.com/mgerb/go-discord-bot synced 2026-01-10 09:02:49 +00:00

feat: add yt-dlp

This commit is contained in:
2022-04-24 20:25:50 -05:00
parent 0532acfddd
commit 86d96c1c1d
5 changed files with 38 additions and 12 deletions

View File

@@ -26,7 +26,7 @@ func getDownloaderHandler(c *gin.Context) {
}
// get the video title
titleCmd := exec.Command("youtube-dl", "--get-title", url)
titleCmd := exec.Command("yt-dlp", "--get-title", url)
var titleOut bytes.Buffer
titleCmd.Stdout = &titleOut
@@ -46,7 +46,7 @@ func getDownloaderHandler(c *gin.Context) {
cleanTitle := cleanseTitle(titleOut.String())
log.Debug(cleanTitle)
cmd := exec.Command("youtube-dl", "-x", "--audio-format", "mp3", "-o", config.Config.YoutubePath+"/"+cleanTitle+".%(ext)s", url)
cmd := exec.Command("yt-dlp", "-x", "--audio-format", "mp3", "-o", config.Config.YoutubePath+"/"+cleanTitle+".%(ext)s", url)
var out bytes.Buffer
cmd.Stdout = &out