dylink: audio formats and no playlist

- Ensure link gets a mp3/mp4/m4a
    - No playlist links

Signed-off-by: HeshamTB <hishaminv@gmail.com>
This commit is contained in:
HeshamTB 2024-08-04 16:34:54 +03:00
parent 43d5d0e192
commit 2bd7cd6063
Signed by: Hesham
GPG Key ID: 74876157D199B09E

View File

@ -82,7 +82,12 @@ func getRemoteLink(id string) (string, error) {
var link string var link string
vidUrl := fmt.Sprintf("https://youtube.com/watch?v=%s", id) 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) ytRes, err := ytCmd.Run(context.Background(), vidUrl)
if err != nil { if err != nil {
return "", err return "", err