Skip to content

Instantly share code, notes, and snippets.

@Ceralor
Created June 14, 2020 17:27
Show Gist options
  • Save Ceralor/534e9bdaeaa48cc1d33441651d8db2eb to your computer and use it in GitHub Desktop.
Save Ceralor/534e9bdaeaa48cc1d33441651d8db2eb to your computer and use it in GitHub Desktop.
#!/bin/bash
read -r -d '' PICUSAGE << eos
Usage: picartostream [--chat] UserName1 [UserName2 [...]]
Hint: the last username used is the chat opened
eos
chatwith=""
if (( $# == 0 )); then
echo "$PICUSAGE"
fi
for arg in $@; do
case "$arg" in
--chat)
chatwith="yes"
;;
*)
vlc --pidfile /run/$arg-stream.pid --input-title-format "Picarto - $arg" --open https://1-edge1-us-west.picarto.tv/mp4/$arg.mp4\?token\=public &>/dev/null &
disown
username="$arg"
;;
esac
done
if [ -n "$chatwith" ]; then
if (( $# > 1 )); then
epiphany "https://picarto.tv/chatpopout/$username/public" &>/dev/null &
disown
else
echo "ERROR: Must provide at least one username"
echo "$PICUSAGE"
return 1
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment