From 681288476022765ce132a1f01067bb227b2b338a Mon Sep 17 00:00:00 2001 From: Xaekai Date: Mon, 24 Jan 2022 04:38:15 -0800 Subject: [PATCH] Fixup Livestream.com --- player/livestream.com.coffee | 11 ++++++----- src/get-info.js | 8 +++----- www/js/util.js | 3 ++- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/player/livestream.com.coffee b/player/livestream.com.coffee index 8d121f96..a04ed961 100644 --- a/player/livestream.com.coffee +++ b/player/livestream.com.coffee @@ -6,11 +6,12 @@ window.LivestreamPlayer = class LivestreamPlayer extends EmbedPlayer @load(data) load: (data) -> + [ account, event ] = data.id.split(';') data.meta.embed = - src: "https://cdn.livestream.com/embed/#{data.id}?\ - layout=4&\ - color=0x000000&\ - iconColorOver=0xe7e7e7&\ - iconColor=0xcccccc" + src: "https://livestream.com/accounts/#{account}/events/#{event}/player?\ + enableInfoAndActivity=false&\ + defaultDrawer=&\ + autoPlay=true&\ + mute=false" tag: 'iframe' super(data) diff --git a/src/get-info.js b/src/get-info.js index 4b4f5ddc..74e798f1 100644 --- a/src/get-info.js +++ b/src/get-info.js @@ -216,14 +216,12 @@ var Getters = { /* livestream.com */ li: function (id, callback) { - var m = id.match(/([\w-]+)/); - if (m) { - id = m[1]; - } else { + if (!id.match(/^\d+;\d+$/)) { callback("Invalid ID", null); return; } - var title = "Livestream.com - " + id; + + var title = "Livestream.com"; var media = new Media(id, title, "--:--", "li"); callback(false, media); }, diff --git a/www/js/util.js b/www/js/util.js index 022fe933..8c48bc97 100644 --- a/www/js/util.js +++ b/www/js/util.js @@ -33,7 +33,8 @@ function formatURL(data) { case "sc": return data.id; case "li": - return "https://livestream.com/" + data.id; + const [account,event] = data.id.split(';'); + return `https://livestream.com/accounts/${account}/events/${event}`; case "tw": return "https://twitch.tv/" + data.id; case "rt":