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.

pull/121/head
Michael Pacella 2016-02-11 01:05:52 -05:00
parent aa285bf817
commit a81f934047
2 changed files with 2 additions and 2 deletions

View File

@ -91,7 +91,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis
offset: int(yt.parseTime(offset, `T\=(?P<days>\d+D)?(?P<hours>\d+H)?(?P<minutes>\d+M)?(?P<seconds>\d+S)?`).Seconds()),
duration: int(yt.parseTime(duration, `P(?P<days>\d+D)?T(?P<hours>\d+H)?(?P<minutes>\d+M)?(?P<seconds>\d+S)?`).Seconds()),
thumbnail: thumbnail,
format: "m4a",
format: "bestaudio",
skippers: make([]string, 0),
playlist: playlist,
dontSkip: false,

View File

@ -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.