Skip to content

Instantly share code, notes, and snippets.

@favna
Last active May 16, 2022 20:41
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save favna/796449877f1c1d09118b466fa025945b to your computer and use it in GitHub Desktop.
Save favna/796449877f1c1d09118b466fa025945b to your computer and use it in GitHub Desktop.
Streamable CURL Upload

A simple Bash command for using in WSL / Ubuntu / Debian to upload to Streamable

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
@chrismccoy
Copy link

instead of the perl code, you can just pass -r (raw) to jq to not print the quotes, avoid using perl

@favna
Copy link
Author

favna commented May 16, 2022

instead of the perl code, you can just pass -r (raw) to jq to not print the quotes, avoid using perl

Cleaned it up a bit. I haven't looked at this Gist in a very long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment