discord_embed: Don't do url redirect for catbox links
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded

This commit is contained in:
Jonatan Nilsson 2022-12-01 10:16:24 +00:00
parent 203965027b
commit 260f2b6c7e
3 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ export default class ServeHandler extends Parent {
let res = await ctx.db.safeCallProc('discord_embed.link_get', [id - 3843]) let res = await ctx.db.safeCallProc('discord_embed.link_get', [id - 3843])
if (res.first.length) { if (res.first.length) {
videoLink = ctx.state.video = res.first[0].video_link videoLink = ctx.state.video = res.first[0].video_link
if (!ctx.state.video.startsWith('https://cdn.discordapp.com')) { if (!ctx.state.video.startsWith('https://cdn.discordapp.com') && !ctx.state.video.includes('catbox.')) {
videoLink = this.frontend + '/video/' + ctx.url.slice(1) + '.webm' videoLink = this.frontend + '/video/' + ctx.url.slice(1) + '.webm'
} }
imageLink = res.first[0].image_link imageLink = res.first[0].image_link

View file

@ -1,6 +1,6 @@
{ {
"name": "discord_embed", "name": "discord_embed",
"version": "1.0.11", "version": "1.0.12",
"port": 4120, "port": 4120,
"description": "AV1 discord server embed helper", "description": "AV1 discord server embed helper",
"main": "index.js", "main": "index.js",

View file

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Discord Embedder from AV1 server 1.0.11</title> <title>Discord Embedder from AV1 server 1.0.12</title>
<base href="/"> <base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
{{ if (imageLink) { }} {{ if (imageLink) { }}