Fix https://github.com/matthieugrieger/mumbledj/issues/46: Download fail on songs with "-" at beginning of ID
This commit is contained in:
parent
ca558ffdd6
commit
85a57feb14
|
@ -1,6 +1,9 @@
|
|||
MumbleDJ Changelog
|
||||
==================
|
||||
|
||||
### February 20, 2015 -- `v2.6.4`
|
||||
* Fixed failed audio downloads for YouTube videos with IDs beginning with "-".
|
||||
|
||||
### February 19, 2015 -- `v2.6.3`
|
||||
* Added `gumbleutil.CertificateLockFile()` for more secure connections.
|
||||
* Added `-insecure` boolean commandline flag to allow MumbleDJ to connect to a server without overwriting `~/.mumbledj/cert.lock`.
|
||||
|
|
2
song.go
2
song.go
|
@ -80,7 +80,7 @@ func NewSong(user, id string, playlist *Playlist) (*Song, error) {
|
|||
// All downloaded songs are stored in ~/.mumbledj/songs and should be automatically cleaned.
|
||||
func (s *Song) Download() error {
|
||||
if _, err := os.Stat(fmt.Sprintf("%s/.mumbledj/songs/%s.m4a", dj.homeDir, s.youtubeId)); os.IsNotExist(err) {
|
||||
cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf(`~/.mumbledj/songs/%s.m4a`, s.youtubeId), "--format", "m4a", s.youtubeId)
|
||||
cmd := exec.Command("youtube-dl", "--output", fmt.Sprintf(`~/.mumbledj/songs/%s.m4a`, s.youtubeId), "--format", "m4a", "--", s.youtubeId)
|
||||
if err := cmd.Run(); err == nil {
|
||||
if dj.conf.Cache.Enabled {
|
||||
dj.cache.CheckMaximumDirectorySize()
|
||||
|
|
Reference in a new issue