Deprecate jwplayer and googleplus videos

This commit is contained in:
Calvin Montgomery 2017-04-11 21:55:31 -07:00
parent 25c663c110
commit 8d40c87dda
6 changed files with 3 additions and 183 deletions

View file

@ -26,12 +26,6 @@ MediaRefresherModule.prototype.onPreMediaChange = function (data, cb) {
pl._refreshing = true;
return this.initGoogleDocs(data, function () {
pl._refreshing = false;
cb(null, ChannelModule.PASSTHROUGH);
});
case "gp":
pl._refreshing = true;
return this.initGooglePlus(data, function () {
pl._refreshing = false;
cb(null, ChannelModule.PASSTHROUGH);
});
@ -169,65 +163,6 @@ MediaRefresherModule.prototype.refreshGoogleDocs = function (media, cb) {
});
};
MediaRefresherModule.prototype.initGooglePlus = function (media, cb) {
var self = this;
if (self.dead || self.channel.dead) {
self.unload();
return;
}
self.channel.refCounter.ref("MediaRefresherModule::initGooglePlus");
InfoGetter.getMedia(media.id, "gp", function (err, data) {
if (self.dead || self.channel.dead) {
return;
}
if (typeof err === "string") {
err = err.replace(/Forbidden/, "Access Denied");
}
switch (err) {
case "Access Denied":
case "Not Found":
case "Internal Server Error":
case "Service Unavailable":
case "The video is still being processed":
case "A processing error has occured":
case "The video has been processed but is not yet accessible":
case ("Unable to retreive video information. Check that the video exists " +
"and is shared publicly"):
self.channel.logger.log("[mediarefresher] Google+ refresh failed: " +
err);
self.channel.refCounter.unref("MediaRefresherModule::initGooglePlus");
if (cb) cb();
return;
default:
if (err) {
self.channel.logger.log("[mediarefresher] Google+ refresh failed: " +
err);
LOGGER.error("Google+ refresh failed for ID " + media.id +
": " + err);
self.channel.refCounter.unref("MediaRefresherModule::initGooglePlus");
if (cb) cb();
return;
}
}
if (media !== self._media) {
self.channel.refCounter.unref("MediaRefresherModule::initGooglePlus");
if (cb) cb();
return;
}
self.channel.logger.log("[mediarefresher] Refreshed Google+ video with ID " +
media.id);
media.meta = data.meta;
self.channel.refCounter.unref("MediaRefresherModule::initGooglePlus");
if (cb) cb();
});
};
MediaRefresherModule.prototype.initVidme = function (data, cb) {
var self = this;
self.refreshVidme(data, cb);

View file

@ -126,7 +126,7 @@ PlaylistModule.prototype.load = function (data) {
} catch (e) {
return;
}
} else if (item.media.type === "gd" || item.media.type === "gp") {
} else if (item.media.type === "gd") {
delete item.media.meta.gpdirect;
}
@ -394,11 +394,6 @@ PlaylistModule.prototype.handleQueue = function (user, data) {
var queueby = user.getName();
var duration = undefined;
/**
* Duration can optionally be specified for a livestream.
* The UI for it only shows up for jw: queues, but it is
* accepted for any live media
*/
if (util.isLive(type) && typeof data.duration === "number") {
duration = !isNaN(data.duration) ? data.duration : undefined;
}
@ -821,7 +816,7 @@ PlaylistModule.prototype.handleUpdate = function (user, data) {
}
var media = this.current.media;
if (util.isLive(media.type) && media.type !== "jw") {
if (util.isLive(media.type)) {
return;
}

View file

@ -16,31 +16,6 @@ import { LoggerFactory } from '@calzoneman/jsli';
const LOGGER = LoggerFactory.getLogger('get-info');
/*
* Preference map of quality => youtube formats.
* see https://en.wikipedia.org/wiki/Youtube#Quality_and_codecs
*
* Prefer WebM over MP4, ignore other codecs (e.g. FLV)
*/
const GOOGLE_PREFERENCE = {
"hd1080": [37, 46],
"hd720": [22, 45],
"large": [59, 44],
"medium": [18, 43, 34] // 34 is 360p FLV as a last-ditch
};
const CONTENT_TYPES = {
43: "webm",
44: "webm",
45: "webm",
46: "webm",
18: "mp4",
22: "mp4",
37: "mp4",
59: "mp4",
34: "flv"
};
var urlRetrieve = function (transport, options, callback) {
var req = transport.request(options, function (res) {
res.on("error", function (err) {
@ -466,13 +441,6 @@ var Getters = {
});
},
/* JWPlayer */
jw: function (id, callback) {
var title = "JWPlayer - " + id;
var media = new Media(id, title, "--:--", "jw");
callback(false, media);
},
/* rtmp stream */
rt: function (id, callback) {
var title = "Livestream";
@ -536,21 +504,6 @@ var Getters = {
});
},
/* Google+ videos */
gp: function (id, callback) {
var data = {
type: "google+",
kind: "single",
id: id
};
mediaquery.lookup(data).then(function (video) {
callback(null, convertMedia(video));
}).catch(function (err) {
callback(err.message || err);
});
},
/* ffmpeg for raw files */
fi: function (id, cb) {
ffmpeg.query(id, function (err, data) {

View file

@ -230,8 +230,6 @@
return "http://twitch.tv/" + id;
case "rt":
return id;
case "jw":
return id;
case "im":
return "http://imgur.com/a/" + id;
case "us":
@ -259,7 +257,6 @@
case "rt":
case "cu":
case "im":
case "jw":
case "hb":
case "hl":
return true;