Compare commits

..

No commits in common. "aa8c052c93de705b810ffcf5ced3e631b30a781c" and "a87b30f88c6719745caf79e0c2013614dfd014f8" have entirely different histories.

2 changed files with 6 additions and 7 deletions

View File

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

View File

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