Merge pull request #112 from fiveofeight/upstream

Fix https://github.com/matthieugrieger/mumbledj/issues/111: Fixed youtube offsets not working when the url used &t and #t vs ?t.
This commit is contained in:
Matthieu Grieger 2016-01-14 12:32:10 -08:00
commit 408d7e4835

View file

@ -88,7 +88,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis
title: title,
id: id,
url: "https://youtu.be/" + id,
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()),
thumbnail: thumbnail,
format: "m4a",