diff --git a/discord_embed/api/post.mjs b/discord_embed/api/post.mjs index aa65a00..c4c171f 100644 --- a/discord_embed/api/post.mjs +++ b/discord_embed/api/post.mjs @@ -80,7 +80,7 @@ Redirecting /** POST: / */ async createNewLink(ctx) { ctx.state.video = ctx.req.body.video - ctx.state.image = ctx.req.body.image + ctx.state.image = ctx.req.body.image || 'https://cdn.nfp.is/av1/empty.png' let rateLimited = false let redisKey = 'ratelimit_' + ctx.req.ip.replace(/:/g, '-') diff --git a/discord_embed/package.json b/discord_embed/package.json index ef94843..ff35413 100644 --- a/discord_embed/package.json +++ b/discord_embed/package.json @@ -1,6 +1,6 @@ { "name": "discord_embed", - "version": "1.0.14", + "version": "1.0.15", "port": 4120, "description": "AV1 discord server embed helper", "main": "index.js", diff --git a/discord_embed/public/index.html b/discord_embed/public/index.html index 64161f9..db43712 100644 --- a/discord_embed/public/index.html +++ b/discord_embed/public/index.html @@ -2,7 +2,7 @@ - Discord Embedder from AV1 server 1.0.12 + Discord Embedder from AV1 server 1.0.15 {{ if (imageLink) { }} @@ -97,8 +97,7 @@ input[type=text] { label { font-size: 0.75rem; font-weight: 500; - margin-top: 1rem; - margin-bottom: 0.25rem; + margin: 0.5rem 0; display: block; } @@ -171,6 +170,46 @@ video { margin: 0 auto; } +h1 { + margin-bottom: 1rem; +} + +.warning { + font-size: 0.9rem; + color: #ffe69c; + margin-bottom: 0.5rem; +} + +.alert { + font-size: 0.9rem; + color: #f1aeb5; + margin-bottom: 0.5rem; +} + +.info { + font-size: 0.9rem; + color: #a3cfbb; + margin-bottom: 0.5rem; +} +.info a, .info a:visited, .info a:hover { + color: inherit; + text-decoration: underline; +} + +.row.optional { + background: #333; + margin: 1rem -0.5rem 0; + padding: 0rem 0.5rem 1rem; +} + +.hidden { + display: none; +} + +#previewVideo { + border: 1px solid white; +} + @@ -185,17 +224,20 @@ video { {{ } }}

Create/generate embed url

+

Please don't try to use youtube.com links or file sharing sites that don't allow direct link to the video. They will show a download page and won't embed properly (for example mediafire.com, megaupload, drive.google.com, etc.)
Those will all not work. (You can test if embedding works by clicking play below in the video player after filling out the video link.)

+

Video upload sites that work are sites like catbox.moe.

+

Video files of .mkv will not work! Only files like *.mov, *.mp4 and *.webm will work.

{{ if (error) { }}

{{=error}}

{{ } }} - + -
+
- +
or
- +
@@ -204,29 +246,41 @@ video {

- Alternatively, copy paste the following full url: + Preview:

-    {{=siteUrlBase}}?v=<video link>&i=<image link>
+    {{=siteUrlBase}}?v=<video link>
   
+ + +