From a81f9340475b1227446db1d5c2a42f13cda892ab Mon Sep 17 00:00:00 2001 From: Michael Pacella Date: Thu, 11 Feb 2016 01:05:52 -0500 Subject: [PATCH] hack workaround to get certain youtube videos which do not provide m4a format audio to work. --format bestaudio can be used with youtube-dl instead of specifying the m4a format. --- service_youtube.go | 2 +- youtube_dl.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service_youtube.go b/service_youtube.go index 268ec73..008e9d4 100644 --- a/service_youtube.go +++ b/service_youtube.go @@ -91,7 +91,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis offset: int(yt.parseTime(offset, `T\=(?P\d+D)?(?P\d+H)?(?P\d+M)?(?P\d+S)?`).Seconds()), duration: int(yt.parseTime(duration, `P(?P\d+D)?T(?P\d+H)?(?P\d+M)?(?P\d+S)?`).Seconds()), thumbnail: thumbnail, - format: "m4a", + format: "bestaudio", skippers: make([]string, 0), playlist: playlist, dontSkip: false, diff --git a/youtube_dl.go b/youtube_dl.go index ff39510..5139e1a 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -167,7 +167,7 @@ func (dl *AudioTrack) ID() string { // Filename returns the filename of the Song. func (dl *AudioTrack) Filename() string { - return dl.id + "." + dl.format + return dl.id + ".m4a" } // Duration returns duration for the Song.