if [[ "$full" =~ $re ]]; then
echo "${BASH_REMATCH[1]}${relative}"
else
- echo >&2 "Unable to split url after hostname: $full"
+ echo >&2 "ERROR: Unable to split url after hostname: $full"
fi
return
fi
}
function fatal() {
- echo >&2 "Fatal error: $1"
+ echo >&2 "FATAL ERROR: $1"
exit 1
}
fi
done <"$TMPFILE"
else
- echo >&2 "Unable to request: $hls"
+ echo >&2 "ERROR: Unable to request: $hls"
fi
rm "$TMPFILE"
}
pretty_time=$($DATE${stream_time%.*} +"%Y-%m-%d %H:%M:%S")
echo "NOTICE: Using time-offset of -$STREAM_TIME_SCREW seconds so time is $pretty_time, real time is $(date ${realtime} +"%Y-%m-%d %H:%M:%S")"
- echo "$pretty_time: Started monitoring using: $stream"
+ echo "$pretty_time: INFO: Started monitoring using: $stream"
while true; do
starttime=$(date +%s)
stream_time=$(echo "$stream_time + $nextSegmentLength" | bc)
pretty_time=$($DATE${stream_time%.*} +"%Y-%m-%d %H:%M:%S")
if [[ $curSeq -ne $nextSeq ]]; then
- echo >&2 "$pretty_time: WARN: Skipped a segment by mistake ($curSeq > $nextSeq)"
+ echo >&2 "$pretty_time: WARN: Lost segments ($curSeq > $nextSeq)"
fi
#echo >&2 "$pretty_time: Current mode length: $curLength"
nextSeq=$(($curSeq + 1))
value="${BASH_REMATCH[2]}"
if [ "$tag" == "EXT-X-TARGETDURATION" ]; then
if [ "$value" != "$target_duration" ]; then
- echo "$pretty_time: Changing target duration to: $value"
+ echo "$pretty_time: INFO: Changing target duration to: $value"
target_duration="$value"
fi
elif [ "$tag" == "EXTINF" ]; then
if [[ $curSeq -ge $nextSeq ]]; then # we are interested in this tag
if [ "$tag" == "EXT-X-CUE-OUT" ]; then
# Begin ad block
- echo "$pretty_time: Seeing CUE-OUT (Ad block start) of duration: $value"
+ echo "$pretty_time: INFO: Seeing CUE-OUT (Ad block start) of duration: $value"
if [ "$mode" == "ADBLOCK" ]; then
echo >&2 "$pretty_time: ERROR: Already in ad block - extra cue-out after $curLength"
else
- echo "$pretty_time: Ad-block started after $curLength seconds"
+ echo "$pretty_time: INFO: Ad-block started after $curLength seconds"
fi
mode="ADBLOCK"
expectedAdLength=$value
curLength=0
elif [ "$tag" == "EXT-X-CUE-IN" ]; then
# End ad block
- echo "$pretty_time: Seeing CUE-IN (Ad block end) after duration: $curLength"
+ echo "$pretty_time: INFO: Seeing CUE-IN (Ad block end) after duration: $curLength"
if [ "$mode" == "ADBLOCK" ]; then
if [ "$expectedAdLength" != "$curLength" ]; then
echo >&2 "$pretty_time: WARN: Block was not the length expected ($curLength <> $expectedAdLength)"
fi
else
- echo >&2 "$pretty_time: Unable to request: $stream"
+ echo >&2 "$pretty_time: WARN: Unable to request: $stream"
failed=$(($failed + 1))
fi
rm "$TMPFILE"
while true; do
streamurl=$(resolveFirstStream "$1")
if [ -e "$streamurl" ]; then
- echo >&2 "Invalid HLS-stream: $1"
+ echo >&2 "ERROR: Invalid HLS-stream: $1"
sleep 10
fi