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:
parent
43d5d0e192
commit
2bd7cd6063
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user