mirror of https://github.com/calzoneman/sync.git
Disable vid.me (RIP)
This commit is contained in:
parent
0c330a82ce
commit
b7bc93f194
|
@ -2,7 +2,7 @@
|
||||||
"author": "Calvin Montgomery",
|
"author": "Calvin Montgomery",
|
||||||
"name": "CyTube",
|
"name": "CyTube",
|
||||||
"description": "Online media synchronizer and chat",
|
"description": "Online media synchronizer and chat",
|
||||||
"version": "3.51.13",
|
"version": "3.51.14",
|
||||||
"repository": {
|
"repository": {
|
||||||
"url": "http://github.com/calzoneman/sync"
|
"url": "http://github.com/calzoneman/sync"
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,12 +27,6 @@ MediaRefresherModule.prototype.onPreMediaChange = function (data, cb) {
|
||||||
pl._refreshing = false;
|
pl._refreshing = false;
|
||||||
cb(null, ChannelModule.PASSTHROUGH);
|
cb(null, ChannelModule.PASSTHROUGH);
|
||||||
});
|
});
|
||||||
case "vm":
|
|
||||||
pl._refreshing = true;
|
|
||||||
return this.initVidme(data, function () {
|
|
||||||
pl._refreshing = false;
|
|
||||||
cb(null, ChannelModule.PASSTHROUGH);
|
|
||||||
});
|
|
||||||
default:
|
default:
|
||||||
return cb(null, ChannelModule.PASSTHROUGH);
|
return cb(null, ChannelModule.PASSTHROUGH);
|
||||||
}
|
}
|
||||||
|
@ -76,58 +70,4 @@ MediaRefresherModule.prototype.initVimeo = function (data, cb) {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
MediaRefresherModule.prototype.initVidme = function (data, cb) {
|
|
||||||
var self = this;
|
|
||||||
self.refreshVidme(data, cb);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Refresh every 55 minutes.
|
|
||||||
* The expiration is 1 hour, but refresh 5 minutes early to be safe
|
|
||||||
*/
|
|
||||||
self._interval = setInterval(function () {
|
|
||||||
self.refreshVidme(data);
|
|
||||||
}, 55 * 60 * 1000);
|
|
||||||
};
|
|
||||||
|
|
||||||
MediaRefresherModule.prototype.refreshVidme = function (media, cb) {
|
|
||||||
var self = this;
|
|
||||||
|
|
||||||
if (self.dead || self.channel.dead) {
|
|
||||||
self.unload();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.channel.refCounter.ref("MediaRefresherModule::refreshVidme");
|
|
||||||
InfoGetter.getMedia(media.id, "vm", function (err, data) {
|
|
||||||
if (self.dead || self.channel.dead) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (err) {
|
|
||||||
self.channel.logger.log("[mediarefresher] Vidme refresh failed: " + err);
|
|
||||||
self.channel.refCounter.unref("MediaRefresherModule::refreshVidme");
|
|
||||||
if (cb) {
|
|
||||||
process.nextTick(cb);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (media !== self._media) {
|
|
||||||
self.channel.refCounter.unref("MediaRefresherModule::refreshVidme");
|
|
||||||
if (cb) {
|
|
||||||
process.nextTick(cb);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
self.channel.logger.log("[mediarefresher] Refreshed Vidme video with ID " +
|
|
||||||
media.id);
|
|
||||||
media.meta = data.meta;
|
|
||||||
self.channel.refCounter.unref("MediaRefresherModule::refreshVidme");
|
|
||||||
if (cb) {
|
|
||||||
process.nextTick(cb);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = MediaRefresherModule;
|
module.exports = MediaRefresherModule;
|
||||||
|
|
|
@ -130,7 +130,11 @@ PlaylistModule.prototype.load = function (data) {
|
||||||
var self = this;
|
var self = this;
|
||||||
let { playlist, playlistPosition } = data;
|
let { playlist, playlistPosition } = data;
|
||||||
|
|
||||||
if (typeof playlist !== "object" || !playlist.hasOwnProperty("pl")) {
|
if (typeof playlist !== "object") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!playlist.hasOwnProperty("pl")) {
|
||||||
LOGGER.warn(
|
LOGGER.warn(
|
||||||
"Bad playlist for channel %s",
|
"Bad playlist for channel %s",
|
||||||
self.channel.uniqueName
|
self.channel.uniqueName
|
||||||
|
@ -156,6 +160,14 @@ PlaylistModule.prototype.load = function (data) {
|
||||||
}
|
}
|
||||||
} else if (item.media.type === "gd") {
|
} else if (item.media.type === "gd") {
|
||||||
delete item.media.meta.gpdirect;
|
delete item.media.meta.gpdirect;
|
||||||
|
} else if (["vm", "jw"].includes(item.media.type)) {
|
||||||
|
// JW has been deprecated for a long time
|
||||||
|
// VM shut down in December 2017
|
||||||
|
LOGGER.warn(
|
||||||
|
"Dropping playlist item with deprecated type %s",
|
||||||
|
item.media.type
|
||||||
|
);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var m = new Media(item.media.id, item.media.title, item.media.seconds,
|
var m = new Media(item.media.id, item.media.title, item.media.seconds,
|
||||||
|
@ -175,6 +187,13 @@ PlaylistModule.prototype.load = function (data) {
|
||||||
i++;
|
i++;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sanity check, in case the current item happened to be deleted by
|
||||||
|
// one of the checks above
|
||||||
|
if (!self.current && self.meta.count > 0) {
|
||||||
|
self.current = self.items.first;
|
||||||
|
playlistPosition.time = -3;
|
||||||
|
}
|
||||||
|
|
||||||
self.meta.time = util.formatTime(self.meta.rawTime);
|
self.meta.time = util.formatTime(self.meta.rawTime);
|
||||||
self.startPlayback(playlistPosition.time);
|
self.startPlayback(playlistPosition.time);
|
||||||
self.dirty = false;
|
self.dirty = false;
|
||||||
|
|
|
@ -512,18 +512,10 @@ var Getters = {
|
||||||
|
|
||||||
/* vid.me */
|
/* vid.me */
|
||||||
vm: function (id, callback) {
|
vm: function (id, callback) {
|
||||||
if (!/^[\w-]+$/.test(id)) {
|
process.nextTick(
|
||||||
process.nextTick(callback, "Invalid vid.me ID");
|
callback,
|
||||||
return;
|
"As of December 2017, vid.me is no longer in service."
|
||||||
}
|
);
|
||||||
|
|
||||||
Vidme.lookup(id).then(video => {
|
|
||||||
const media = new Media(video.id, video.title, video.duration,
|
|
||||||
"vm", video.meta);
|
|
||||||
process.nextTick(callback, false, media);
|
|
||||||
}).catch(function (err) {
|
|
||||||
callback(err.message || err, null);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/* streamable */
|
/* streamable */
|
||||||
|
|
|
@ -224,8 +224,6 @@
|
||||||
return "https://vimeo.com/" + id;
|
return "https://vimeo.com/" + id;
|
||||||
case "dm":
|
case "dm":
|
||||||
return "https://dailymotion.com/video/" + id;
|
return "https://dailymotion.com/video/" + id;
|
||||||
case "vm":
|
|
||||||
return "https://vid.me/" + id;
|
|
||||||
case "sc":
|
case "sc":
|
||||||
return id;
|
return id;
|
||||||
case "li":
|
case "li":
|
||||||
|
|
15
www/js/ui.js
15
www/js/ui.js
|
@ -367,6 +367,21 @@ function queue(pos, src) {
|
||||||
var title = undefined;
|
var title = undefined;
|
||||||
if (data.type === "fi") {
|
if (data.type === "fi") {
|
||||||
title = $("#addfromurl-title-val").val();
|
title = $("#addfromurl-title-val").val();
|
||||||
|
} else if (data.type === "vm") {
|
||||||
|
/*
|
||||||
|
* As of December 2017, vid.me is no longer in service.
|
||||||
|
* Leaving this temporarily to hopefully avoid confusion
|
||||||
|
* for people pasting old vid.me links.
|
||||||
|
*
|
||||||
|
* TODO: remove at some point in the future
|
||||||
|
*/
|
||||||
|
|
||||||
|
Callbacks.queueFail({
|
||||||
|
link: link,
|
||||||
|
msg: "As of December 2017, vid.me is no longer in service."
|
||||||
|
});
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.id == null || data.type == null) {
|
if (data.id == null || data.type == null) {
|
||||||
|
|
|
@ -30,8 +30,6 @@ function formatURL(data) {
|
||||||
return "https://vimeo.com/" + data.id;
|
return "https://vimeo.com/" + data.id;
|
||||||
case "dm":
|
case "dm":
|
||||||
return "https://dailymotion.com/video/" + data.id;
|
return "https://dailymotion.com/video/" + data.id;
|
||||||
case "vm":
|
|
||||||
return "https://vid.me/" + data.id;
|
|
||||||
case "sc":
|
case "sc":
|
||||||
return data.id;
|
return data.id;
|
||||||
case "li":
|
case "li":
|
||||||
|
|
Loading…
Reference in New Issue