note: Copy part only configured for WSL (Windows Subsystem Linux), if you want to use this on Ubuntu / Debian change the second line to use xclip
instead
Function will always output to the STDOUT
Add to ~/.bashrc
/ ~/.zshrc
# Upload to Streamable.com from command line
# Usage: streamupload /path/to/videofile
# Example: streamupload /home/myuser/videos/input.mp4
STREAMABLEUSER="your_username"
STREAMABLEPASSWORD="your_password"
streamupload() {
code=$(curl --request POST --url https://api.streamable.com/upload --user $STREAMABLEUSER:$STREAMABLEPASSWORD --form file=@"$1" | jq -r '.shortcode');
echo Added https://streamable.com/$code to your clipboard;
echo https://streamable.com/$code | clip.exe;
}
Run:
source ~/.bashrc
instead of the perl code, you can just pass -r (raw) to jq to not print the quotes, avoid using perl