Last active
January 17, 2018 16:50
-
-
Save narate/eb492e2915ee7638ed906862e243164b to your computer and use it in GitHub Desktop.
ffplay live from vibie.live required ffmpeg --with-ffplay and jq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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