-
-
Save fcicq/93106778ebea9e31bab5 to your computer and use it in GitHub Desktop.
Simple recorder for Twitcasting.tv
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 | |
# coding: utf-8 | |
# twitcast.sh by dyama | |
LIVESTREAMER="streamlink" | |
($LIVESTREAMER --version 1>/dev/null 2>&1) || (echo 'install streamlink first (run pip/pip3 install streamlink)'; exit) | |
if [ -n "$1" ]; then | |
id=$(echo "$1" | sed 's|^.*/||g') | |
while true; do | |
while true; do | |
(curl -s "http://api.twitcasting.tv/api/livestatus?user=$id" | grep "\"islive\":true") && break | |
echo "Not Alive, Sleeping $(date +'%F_%H-%M-%S')" | |
sleep 30 | |
done | |
fname="${id}_$(date +'%F_%H-%M-%S').ts" | |
$LIVESTREAMER --hls-segment-threads 3 --hls-segment-timeout 1.5 --http-timeout 1.5 -o "$fname" "hlsvariant://twitcasting.tv/$id/metastream.m3u8?video=1" best | |
# ffmpeg -nostdin -i "http://twitcasting.tv/$id/metastream.m3u8?video=1" \ | |
# -vcodec copy -acodec copy -fflags nobuffer -f mpegts "$fname" | |
if [ "$2" != "loop" ]; then | |
break | |
fi | |
done | |
else | |
echo "usage: $0 twitcasting_account" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<input type="hidden" id="movie_file_path" value="ttp://dl01.twitcasting.tv/USERNAME/download/VIDEOID">
ffmpeg -i URI -c copy -bsf:a aac_adtstoasc OUTFILE