Go to file
Joakim Hellsén 3b654681e1 Update poetry.lock
Package operations: 0 installs, 15 updates, 0 removals

  • Updating astroid (2.9.1 -> 2.9.3)
  • Updating frozenlist (1.2.0 -> 1.3.0)
  • Updating anyio (3.4.0 -> 3.5.0)
  • Updating charset-normalizer (2.0.9 -> 2.0.10)
  • Updating dnspython (2.1.0 -> 2.2.0)
  • Updating pylint-plugin-utils (0.6 -> 0.7)
  • Updating h11 (0.12.0 -> 0.13.0)
  • Updating urllib3 (1.26.7 -> 1.26.8)
  • Updating gitpython (3.1.24 -> 3.1.26)
  • Updating pylint-django (2.4.4 -> 2.5.0)
  • Updating requests (2.27.0 -> 2.27.1)
  • Updating prospector (1.5.3.1 -> 1.6.0)
  • Updating pygments (2.11.1 -> 2.11.2)
  • Updating starlette (0.16.0 -> 0.17.1)
  • Updating fastapi (0.70.1 -> 0.72.0
2022-01-20 14:00:53 +01:00
2022-01-03 20:40:02 +01:00
2022-01-03 20:40:02 +01:00
2021-12-08 19:44:50 +01:00
2021-05-10 23:13:11 +02:00
2022-01-20 14:00:53 +01:00
2022-01-20 14:00:53 +01:00
2022-01-03 19:11:55 +01:00

discord-embed

Discord will only create embeds for videos and images if they are smaller than 8MB. We can "abuse" this by using the twitter:image HTML meta tag.

This is useful when you send a video and want it to be playable in Discord.

How it works

This program will create a .html that you will send instead of a .mp4 file. Discord will parse the HTML and create an embed for you. The embed will be the same as the one you would get if you send a .mp4 file.

Installation

This implies that you have experience with Nginx. Don't be afraid to contact me if you need help.

  • Install latest version of git, Python, Poetry and Nginx.
  • Clone the repository or download the source code directly from GitHub.
  • Install the dependencies using Poetry.
    • poetry install
  • Rename .env.example to .env and fill in the required values.
  • Copy discord-embed.service to /etc/systemd/system/discord-embed.service.
    • sudo cp discord-embed.service /etc/systemd/system/discord-embed.service
    • Change lovinator to your username.
    • Change DOMAIN to the domain where we will serve the files.
  • There is a bundled nginx config file that can be used to serve the site.
    • sudo cp nginx.conf /etc/nginx/
  • Start Nginx at boot.
    • sudo systemctl enable --now nginx
  • Create directory for uploaded files.
    • sudo mkdir /Uploads
  • Check what user is running Nginx, Arch is using http. Others could be www-data:
    • ps aux | grep nginx
  • Change permissions of /Uploads directory. Change lovinator to your username and http to the user running Nginx.
    • sudo chown -R lovinator:http /Uploads
  • Create log folder.
    • sudo mkdir /var/log/discord-embed
  • Change permissions of /var/log/discord-embed directory. Change lovinator to your username.
    • sudo chown -R lovinator:lovinator /var/log/discord-embed
  • Start the services.
    • sudo systemctl enable --now discord-embed.service
    • sudo systemctl enable --now discord-embed.socket
  • Check if the services are running.
    • sudo systemctl status discord-embed.service
    • sudo systemctl status discord-embed.socket
  • Check logs for errors.
    • cat /var/log/discord-embed/error.log and cat /var/log/discord-embed/access.log

Need help?

Description
Discord will only create embeds for videos and images if they are smaller than 10MiB. We can "abuse" this by using the twitter:image HTML meta tag.
Readme GPL-3.0 1.6 MiB
Languages
Python 93.6%
Dockerfile 6.4%