From a5bebd06c8f436bb3b056d0ff8e615ac8319d64a Mon Sep 17 00:00:00 2001 From: MichaelOultram Date: Thu, 13 Aug 2015 14:07:04 +0100 Subject: [PATCH] Checking output of youtube-dl when downloading[ci skip] --- service_youtube.go | 1 + youtube_dl.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/service_youtube.go b/service_youtube.go index 4f86ca7..08dc01a 100644 --- a/service_youtube.go +++ b/service_youtube.go @@ -165,6 +165,7 @@ func (yt YouTube) NewSong(user *gumble.User, id, offset string, playlist Playlis submitter: user, title: title, id: id, + url: "https://youtu.be/" + id, offset: int((offsetDays * 86400) + (offsetHours * 3600) + (offsetMinutes * 60) + offsetSeconds), duration: durationString, thumbnail: thumbnail, diff --git a/youtube_dl.go b/youtube_dl.go index 81373ec..7546fa4 100644 --- a/youtube_dl.go +++ b/youtube_dl.go @@ -40,7 +40,7 @@ func (dl *YouTubeDLSong) Download() error { // Checks to see if song is already downloaded if _, err := os.Stat(fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename())); os.IsNotExist(err) { - cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename()), "--format m4a", "--prefer-ffmpeg", "--", dl.url) + cmd := exec.Command("youtube-dl", "--no-mtime", "--output", fmt.Sprintf("%s/.mumbledj/songs/%s", dj.homeDir, dl.Filename()), "--format m4a", "--prefer-ffmpeg", "--", dl.url) err = cmd.Run() if err == nil { if dj.conf.Cache.Enabled {