pull/157/merge
Matthieu Grieger 2016-11-05 19:22:58 -07:00
parent 51db9c3061
commit e1e3a334cd
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ func (yt *YouTube) getTrack(id string, submitter *gumble.User) (bot.Track, error
return bot.Track{}, err
}
items, _ := v.GetObjectArray("items")
if len(items) == 0 {
return bot.Track{}, errors.New("This YouTube video is private")
}
item := items[0]
title, _ := item.GetString("snippet", "title")
thumbnail, _ := item.GetString("snippet", "thumbnails", "high", "url")