Fixup Livestream.com

This commit is contained in:
Xaekai 2022-01-24 04:38:15 -08:00
parent d3aed7121b
commit 6812884760
3 changed files with 11 additions and 11 deletions

View file

@ -6,11 +6,12 @@ window.LivestreamPlayer = class LivestreamPlayer extends EmbedPlayer
@load(data) @load(data)
load: (data) -> load: (data) ->
[ account, event ] = data.id.split(';')
data.meta.embed = data.meta.embed =
src: "https://cdn.livestream.com/embed/#{data.id}?\ src: "https://livestream.com/accounts/#{account}/events/#{event}/player?\
layout=4&\ enableInfoAndActivity=false&\
color=0x000000&\ defaultDrawer=&\
iconColorOver=0xe7e7e7&\ autoPlay=true&\
iconColor=0xcccccc" mute=false"
tag: 'iframe' tag: 'iframe'
super(data) super(data)

View file

@ -216,14 +216,12 @@ var Getters = {
/* livestream.com */ /* livestream.com */
li: function (id, callback) { li: function (id, callback) {
var m = id.match(/([\w-]+)/); if (!id.match(/^\d+;\d+$/)) {
if (m) {
id = m[1];
} else {
callback("Invalid ID", null); callback("Invalid ID", null);
return; return;
} }
var title = "Livestream.com - " + id;
var title = "Livestream.com";
var media = new Media(id, title, "--:--", "li"); var media = new Media(id, title, "--:--", "li");
callback(false, media); callback(false, media);
}, },

View file

@ -33,7 +33,8 @@ function formatURL(data) {
case "sc": case "sc":
return data.id; return data.id;
case "li": case "li":
return "https://livestream.com/" + data.id; const [account,event] = data.id.split(';');
return `https://livestream.com/accounts/${account}/events/${event}`;
case "tw": case "tw":
return "https://twitch.tv/" + data.id; return "https://twitch.tv/" + data.id;
case "rt": case "rt":