discord_embed: Add cdn.discordapp.com support
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
All checks were successful
continuous-integration/appveyor/branch AppVeyor build succeeded
This commit is contained in:
parent
8badc915cd
commit
6faf71ba18
2 changed files with 6 additions and 2 deletions
|
@ -38,7 +38,11 @@ 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) {
|
||||||
ctx.state.video = res.first[0].video_link
|
ctx.state.video = res.first[0].video_link
|
||||||
|
if (ctx.state.video.startsWith('https://cdn.discordapp.com')) {
|
||||||
|
videoLink = ctx.state.video.replace('https://cdn.discordapp.com', 'https://discordproxy.nfp.is')
|
||||||
|
} else {
|
||||||
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
|
||||||
} else {
|
} else {
|
||||||
ctx.status = 404
|
ctx.status = 404
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "discord_embed",
|
"name": "discord_embed",
|
||||||
"version": "1.0.9",
|
"version": "1.0.10",
|
||||||
"port": 4120,
|
"port": 4120,
|
||||||
"description": "AV1 discord server embed helper",
|
"description": "AV1 discord server embed helper",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|
Loading…
Reference in a new issue