Compare commits

...

2 Commits

2 changed files with 7 additions and 6 deletions

View File

@ -4,7 +4,6 @@ import (
"context"
"dndmusicbot/ffmpeg"
discordspeaker "dndmusicbot/speaker"
"dndmusicbot/ytdl"
"encoding/json"
"fmt"
"log"
@ -163,7 +162,7 @@ func (app *App) ambianceAdd(payload ...interface{}) {
return
}
err := ytdl.DownloadAmbiance(amburl, ambtitle)
err := DownloadAmbiance(amburl, ambtitle)
if err != nil {
log.Println(err)
return
@ -384,7 +383,7 @@ func (app *App) loadPlaylist(payload ...interface{}) {
}
_, yt, err := app.cache.GetOrCreateBytes(vid+".txt", func() ([]byte, error) {
uri, err := ytdl.NewYTdl(vid)
uri, err := NewYTdl(vid)
if err != nil {
return nil, err
}

View File

@ -1,4 +1,4 @@
package ytdl
package main
import (
"fmt"
@ -9,8 +9,9 @@ import (
var yturl = "https://youtu.be/%s"
func NewYTdl(vid string) ([]byte, error) {
ytdl := config.GetString("youtube.ytdl")
uri, err := exec.Command(
"./bin/yt-dlp_linux",
ytdl,
fmt.Sprintf(yturl, vid),
"--cookies", "./cookies.txt",
"--no-call-home",
@ -29,8 +30,9 @@ func NewYTdl(vid string) ([]byte, error) {
}
func DownloadAmbiance(uri string, name string) error {
ytdl := config.GetString("youtube.ytdl")
err := exec.Command(
"./bin/yt-dlp_linux",
ytdl,
uri,
"-x",
"--audio-format", "mp3",