{"id":26722694,"url":"https://github.com/thelovinator1/discord-embed","last_synced_at":"2025-04-14T06:55:20.624Z","repository":{"id":38079953,"uuid":"366177092","full_name":"TheLovinator1/discord-embed","owner":"TheLovinator1","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.","archived":false,"fork":false,"pushed_at":"2025-02-20T22:00:33.000Z","size":1452,"stargazers_count":22,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T20:42:09.099Z","etag":null,"topics":["discord","discord-webhooks","fastapi","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheLovinator1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-05-10T21:13:10.000Z","updated_at":"2025-02-20T22:00:37.000Z","dependencies_parsed_at":"2023-02-16T14:20:20.269Z","dependency_job_id":"53dc9af9-4f57-47bd-ab4d-bbc3497e46d4","html_url":"https://github.com/TheLovinator1/discord-embed","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLovinator1%2Fdiscord-embed","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLovinator1%2Fdiscord-embed/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLovinator1%2Fdiscord-embed/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheLovinator1%2Fdiscord-embed/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheLovinator1","download_url":"https://codeload.github.com/TheLovinator1/discord-embed/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837281,"owners_count":21169374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["discord","discord-webhooks","fastapi","hacktoberfest"],"created_at":"2025-03-27T20:36:41.978Z","updated_at":"2025-04-14T06:55:20.597Z","avatar_url":"https://github.com/TheLovinator1.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# discord-embed\n\nDiscord will only create embeds for videos and images if they are smaller than 10MiB. We can \"abuse\" this by using\nthe [twitter:image HTML meta tag](https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/markup).\n\nThis is useful when you send a video and want it to be playable in Discord.\n\n## How it works\n\nThis program will create a .html that you will send instead of a .mp4 file. Discord will parse the HTML and create an\nembed for you. The embed will be the same as the one you would get if you send a .mp4 file.\n\n## Environment variables\n\n| Variable      | Description                                                      |\n|---------------|------------------------------------------------------------------|\n| SERVE_DOMAIN  | Domain where we server files from, not where we upload files to. |\n| UPLOAD_FOLDER | Path to the directory where we store files.                      |\n| WEBHOOK_URL   | Discord Webhook URL                                              |\n\n## How to use\n\nThis project is meant to be used with Docker. You can find a docker-compose.yml file in this repository.\n\nWe have to do some URL rewriting to make this work. You can find examples for Nginx and Caddy below.\n\n## Nginx\n\nYou have two example files here: [embed.subdomain.conf](embed.subdomain.conf) and [i.subdomain.conf](i.subdomain.conf)\n\n* embed.subdomain.conf\n  * This is the file you will use for the subdomain where you will upload files to.\n* i.subdomain.conf:\n  * This is the file you will use for the subdomain where you will serve files from.\n\n## Caddy\n\n```yaml\n# SERVE_DOMAIN = i.example.com\n# UPLOAD_FOLDER = /var/www/embed\nembed.example.com {\n  reverse_proxy * http://discord-embed:5000 # The Docker container where discord-embed runs\n}\n\ni.example.com {\n  root * /var/www/embed\n  try_files {uri} {uri}/ {uri}.html\n  file_server\n}\n```\n\n## ShareX\n\nThere is a [ShareX.sxcu](ShareX.sxcu) file in this repository. You can import it into ShareX and use it to upload files\nto your server. You will have to change the RequestURL to your own domain. (The domain where discord-embed runs).\n\nIt will return a JSON object with the URL to the file. This is the URL you will send in Discord.\n\n```JSON\n{\n  \"Version\": \"14.1.1\",\n  \"Name\": \"Discord Embed\",\n  \"DestinationType\": \"FileUploader\",\n  \"RequestMethod\": \"POST\",\n  \"RequestURL\": \"https://embed.example.com/uploadfiles/\",\n  \"Body\": \"MultipartFormData\",\n  \"FileFormName\": \"file\",\n  \"URL\": \"{json:html_url}\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelovinator1%2Fdiscord-embed","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthelovinator1%2Fdiscord-embed","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthelovinator1%2Fdiscord-embed/lists"}