Add YouTube v3 API

YouTube v2 is still supported as a fallback, but will log a warning
message to the error log as v2 is expected to be closed shortly after
April 20, 2015.

See also:
http://youtube-eng.blogspot.com/2015/03/dude-are-you-still-on-youtube-api-v2.html
This commit is contained in:
calzoneman 2015-03-27 18:44:46 -05:00
parent 9541b40f68
commit 27a50cb702
6 changed files with 310 additions and 225 deletions

View file

@ -67,7 +67,7 @@ LibraryModule.prototype.handleUncache = function (user, data) {
LibraryModule.prototype.handleSearchMedia = function (user, data) {
var query = data.query.substring(0, 100);
var searchYT = function () {
InfoGetter.Getters.ytSearch(query.split(" "), function (e, vids) {
InfoGetter.Getters.ytSearch(query, function (e, vids) {
if (!e) {
user.socket.emit("searchResults", {
source: "yt",

View file

@ -509,6 +509,7 @@ PlaylistModule.prototype.queueYouTubePlaylist = function (user, data) {
self.channel.activeLock.lock();
vids.forEach(function (media) {
data.link = util.formatLink(media.id, media.type);
self._addItem(media, data, user);
});
self.channel.activeLock.release();