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.
This commit is contained in:
parent
aa285bf817
commit
a81f934047
|
@ -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()),
|
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()),
|
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,
|
thumbnail: thumbnail,
|
||||||
format: "m4a",
|
format: "bestaudio",
|
||||||
skippers: make([]string, 0),
|
skippers: make([]string, 0),
|
||||||
playlist: playlist,
|
playlist: playlist,
|
||||||
dontSkip: false,
|
dontSkip: false,
|
||||||
|
|
|
@ -167,7 +167,7 @@ func (dl *AudioTrack) ID() string {
|
||||||
|
|
||||||
// Filename returns the filename of the Song.
|
// Filename returns the filename of the Song.
|
||||||
func (dl *AudioTrack) Filename() string {
|
func (dl *AudioTrack) Filename() string {
|
||||||
return dl.id + "." + dl.format
|
return dl.id + ".m4a"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration returns duration for the Song.
|
// Duration returns duration for the Song.
|
||||||
|
|
Reference in a new issue