The President has his birthday coming up and his supporters have specifically requested that people upload video messages for him (see details).
This repo contains a Bash script that demonstrates how to upload a video file to AWS S3 from the command line, instead of from a browser.
Requires curl
and jq
.
Download the script, set it to be executable:
chmod +x happy-birthday.sh
To see options, just run the script without options:
$ happy-birthday.sh
To upload a particular file and accept defaults:
$ happy-birthday.sh -f /path/to/my/video/file
The script first connects to the main website to get a CSRF token and cookie (which is written to a file called cookie.txt
). These are then used to get AWS connection details that describe how to upload the file to S3. The final call to curl then uploads to S3.