From 97b54d23c48c390f306d1fde4228737cf742fc84 Mon Sep 17 00:00:00 2001 From: Jonatan Nilsson Date: Mon, 9 Jan 2023 08:27:07 +0000 Subject: [PATCH] Hopefully fix url embed from resources that don't work well with the url redirect --- discord_embed/api/serve.mjs | 4 +++- discord_embed/package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/discord_embed/api/serve.mjs b/discord_embed/api/serve.mjs index 0f02d92..08e0345 100644 --- a/discord_embed/api/serve.mjs +++ b/discord_embed/api/serve.mjs @@ -38,7 +38,9 @@ export default class ServeHandler extends Parent { let res = await ctx.db.safeCallProc('discord_embed.link_get', [id - 3843]) if (res.first.length) { videoLink = ctx.state.video = res.first[0].video_link - if (!ctx.state.video.startsWith('https://cdn.discordapp.com') && !ctx.state.video.includes('catbox.')) { + if (!ctx.state.video.startsWith('https://cdn.discordapp.com') + && !ctx.state.video.includes('catbox.') + && ctx.state.video.includes('?')) { videoLink = this.frontend + '/video/' + ctx.url.slice(1) + '.webm' } imageLink = res.first[0].image_link diff --git a/discord_embed/package.json b/discord_embed/package.json index 17100d3..22c4b5f 100644 --- a/discord_embed/package.json +++ b/discord_embed/package.json @@ -1,6 +1,6 @@ { "name": "discord_embed", - "version": "1.0.12", + "version": "1.0.13", "port": 4120, "description": "AV1 discord server embed helper", "main": "index.js",