- Shell 100%
| embed.sh | Changes default expiration, adds argument input, and simplifies URL parsing. | |
| LICENSE | Initial commit | |
| README.md | Removes unnecessary path delimiter. | |
Purpose
At the time of writing, Discord limits the size of file uploads to 10MB by default, extendable to 500MB with a Nitro subscription. Using a temporary third party file storage website, this limitation can be circumvented by creating an embeddable version of the external link.
Setup
This script can be executed graphically if the KDE Plasma desktop environment is installed on a Linux system.
Other desktop environments are recommended to run the script from a terminal to provide manual input as a fallback.
In either case, granting it executable permissions is recommended for convenience.
To do so from a terminal, run chmod +x ./embed.sh.
In a graphical context, right click embed.sh >> Properties >> Permissions >> Allow executing file as program.
bash embed.sh will execute the script from within the same directory or when placed in $PATH.
How to use
Copy a video file, then run the script (optionally entering the file path as the second argument).
The video will be automatically uploaded, and upon completion will return a URL to the clipboard.
Paste the URL into Discord for a functioning embedded preview.
By default, the uploaded file is set to expire after 12 hours, which will also render the embed link ineffective.
Executing the script through a terminal supports custom time expiry values of 1, 12, 24, or 72 hours:
# Forces file to expire 1 hour after upload
bash embed.sh 1