Remove some legacy cruft

This commit is contained in:
Calvin Montgomery 2021-08-19 20:44:57 -07:00
parent 7214b7c474
commit 394f03ee1c
7 changed files with 15 additions and 90 deletions

View file

@ -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.81.0", "version": "3.82.0",
"repository": { "repository": {
"url": "http://github.com/calzoneman/sync" "url": "http://github.com/calzoneman/sync"
}, },

View file

@ -24,27 +24,10 @@ window.EmbedPlayer = class EmbedPlayer extends Player
console.error('EmbedPlayer::load(): missing meta.embed') console.error('EmbedPlayer::load(): missing meta.embed')
return return
if embed.tag == 'object' @player = @loadIframe(embed)
@player = @loadObject(embed)
else
@player = @loadIframe(embed)
removeOld(@player) removeOld(@player)
loadObject: (embed) ->
object = $('<object/>').attr(
type: 'application/x-shockwave-flash'
data: embed.src
wmode: 'opaque'
)
genParam('allowfullscreen', 'true').appendTo(object)
genParam('allowscriptaccess', 'always').appendTo(object)
for key, value of embed.params
genParam(key, value).appendTo(object)
return object
loadIframe: (embed) -> loadIframe: (embed) ->
if embed.src.indexOf('http:') == 0 and location.protocol == 'https:' if embed.src.indexOf('http:') == 0 and location.protocol == 'https:'
if @__proto__.mixedContentError? if @__proto__.mixedContentError?

View file

@ -6,18 +6,11 @@ window.LivestreamPlayer = class LivestreamPlayer extends EmbedPlayer
@load(data) @load(data)
load: (data) -> load: (data) ->
if LIVESTREAM_CHROMELESS data.meta.embed =
data.meta.embed = src: "https://cdn.livestream.com/embed/#{data.id}?\
src: 'https://cdn.livestream.com/chromelessPlayer/v20/playerapi.swf' layout=4&\
tag: 'object' color=0x000000&\
params: iconColorOver=0xe7e7e7&\
flashvars: "channel=#{data.id}" iconColor=0xcccccc"
else tag: 'iframe'
data.meta.embed =
src: "https://cdn.livestream.com/embed/#{data.id}?\
layout=4&\
color=0x000000&\
iconColorOver=0xe7e7e7&\
iconColor=0xcccccc"
tag: 'iframe'
super(data) super(data)

View file

@ -158,15 +158,19 @@ 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", "mx"].includes(item.media.type)) { } else if (["vm", "jw", "mx", "im"].includes(item.media.type)) {
// JW has been deprecated for a long time // JW has been deprecated for a long time
// VM shut down in December 2017 // VM shut down in December 2017
// Mixer shut down in July 2020 // Mixer shut down in July 2020
// Dunno when imgur album embeds stopped working but they don't work either
LOGGER.warn( LOGGER.warn(
"Dropping playlist item with deprecated type %s", "Dropping playlist item with deprecated type %s",
item.media.type item.media.type
); );
return; return;
} else if (item.media.meta.embed && item.media.meta.embed.tag !== 'iframe') {
LOGGER.warn("Dropping playlist item with flash embed");
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,

View file

@ -340,23 +340,6 @@ var Getters = {
callback(false, media); callback(false, media);
}, },
/* imgur.com albums */
im: function (id, callback) {
/**
* TODO: Consider deprecating this in favor of custom embeds
*/
var m = id.match(/([\w-]+)/);
if (m) {
id = m[1];
} else {
callback("Invalid ID", null);
return;
}
var title = "Imgur Album - " + id;
var media = new Media(id, title, "--:--", "im");
callback(false, media);
},
/* custom embed */ /* custom embed */
cu: function (id, callback) { cu: function (id, callback) {
var media; var media;

View file

@ -177,7 +177,7 @@
}; };
}, },
root.formatLink = function (id, type, meta) { root.formatLink = function (id, type, _meta) {
switch (type) { switch (type) {
case "yt": case "yt":
return "https://youtu.be/" + id; return "https://youtu.be/" + id;
@ -193,8 +193,6 @@
return "https://twitch.tv/" + id; return "https://twitch.tv/" + id;
case "rt": case "rt":
return id; return id;
case "im":
return "https://imgur.com/a/" + id;
case "us": case "us":
return "https://ustream.tv/channel/" + id; return "https://ustream.tv/channel/" + id;
case "gd": case "gd":
@ -211,12 +209,6 @@
return "https://clips.twitch.tv/" + id; return "https://clips.twitch.tv/" + id;
case "cm": case "cm":
return id; return id;
case "mx":
if (meta !== null) {
return `https://mixer.com/${meta.mixer.channelToken}`;
} else {
return `https://mixer.com/${id}`;
}
default: default:
return ""; return "";
} }
@ -229,10 +221,8 @@
case "us": case "us":
case "rt": case "rt":
case "cu": case "cu":
case "im":
case "hb": case "hb":
case "hl": case "hl":
case "mx":
return true; return true;
default: default:
return false; return false;

View file

@ -38,8 +38,6 @@ function formatURL(data) {
return "https://twitch.tv/" + data.id; return "https://twitch.tv/" + data.id;
case "rt": case "rt":
return data.id; return data.id;
case "im":
return "https://imgur.com/a/" + data.id;
case "us": case "us":
return "https://ustream.tv/channel/" + data.id; return "https://ustream.tv/channel/" + data.id;
case "gd": case "gd":
@ -56,8 +54,6 @@ function formatURL(data) {
return "https://clips.twitch.tv/" + data.id; return "https://clips.twitch.tv/" + data.id;
case "cm": case "cm":
return data.id; return data.id;
case "mx":
return "https://mixer.com/" + data.meta.mixer.channelToken;
default: default:
return "#"; return "#";
} }
@ -1401,13 +1397,6 @@ function parseMediaLink(url) {
}; };
} }
if((m = url.match(/imgur\.com\/a\/([^\?&#]+)/))) {
return {
id: m[1],
type: "im"
};
}
if((m = url.match(/soundcloud\.com\/([^\?&#]+)/))) { if((m = url.match(/soundcloud\.com\/([^\?&#]+)/))) {
return { return {
id: url, id: url,
@ -1423,15 +1412,6 @@ function parseMediaLink(url) {
}; };
} }
// Deprecated as of December 2017
if ((m = url.match(/vid\.me\/embedded\/([\w-]+)/)) ||
(m = url.match(/vid\.me\/([\w-]+)/))) {
return {
id: m[1],
type: "vm"
};
}
if ((m = url.match(/(.*\.m3u8)/))) { if ((m = url.match(/(.*\.m3u8)/))) {
return { return {
id: url, id: url,
@ -1446,14 +1426,6 @@ function parseMediaLink(url) {
}; };
} }
// Deprecated as of July 2020
if ((m = url.match(/\bmixer\.com\/([\w-]+)/))) {
return {
id: m[1],
type: "mx"
};
}
/* Shorthand URIs */ /* Shorthand URIs */
// So we still trim DailyMotion URLs // So we still trim DailyMotion URLs
if((m = url.match(/^dm:([^\?&#_]+)/))) { if((m = url.match(/^dm:([^\?&#_]+)/))) {