From 2bd7cd6063d483bfa38dd204f5745558187b3ee1 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Sun, 4 Aug 2024 16:34:54 +0300 Subject: [PATCH] dylink: audio formats and no playlist - Ensure link gets a mp3/mp4/m4a - No playlist links Signed-off-by: HeshamTB --- dylinkprovider/dylinkprov.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dylinkprovider/dylinkprov.go b/dylinkprovider/dylinkprov.go index 218a9bb..3a2ce2e 100644 --- a/dylinkprovider/dylinkprov.go +++ b/dylinkprovider/dylinkprov.go @@ -82,7 +82,12 @@ func getRemoteLink(id string) (string, error) { var link string vidUrl := fmt.Sprintf("https://youtube.com/watch?v=%s", id) - ytCmd := ytdlp.New().ExtractAudio().GetURL() + ytCmd := ytdlp.New(). + ExtractAudio(). + GetURL(). + AudioFormat("ba[ext=mp3]/ba[ext=m4a]/ba[ext=mp4]"). + NoPlaylist() + ytRes, err := ytCmd.Run(context.Background(), vidUrl) if err != nil { return "", err