Skip to content

Instantly share code, notes, and snippets.

@narate
Last active January 17, 2018 16:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save narate/eb492e2915ee7638ed906862e243164b to your computer and use it in GitHub Desktop.
Save narate/eb492e2915ee7638ed906862e243164b to your computer and use it in GitHub Desktop.
ffplay live from vibie.live required ffmpeg --with-ffplay and jq
#!/bin/bash
LIVE_DATA=$(curl -s "$1" | grep __NEXT_DATA__ | sed 's/__NEXT_DATA__ =//g')
STATUS=$(echo $LIVE_DATA | jq '.props.live.status' | sed 's/"//g')
if [ $STATUS == "inactive" ]
then
echo "ERROR: live status is $STATUS"
exit -1
fi
M3U8=$(echo $LIVE_DATA | jq '.props.live.preview_url' | sed 's/"//g' | sed 's/preview/hls/g' | sed 's/.jpg/.m3u8/g')
#ffplay $M3U8
open -a "quicktime player" $M3U8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment