That is true. But. If the stream is off for 15 minutes or so, it will not come back. I'm not sure of the exact time limit.
If your OBS is installed on a Linux machine and you are into command line operations, you can use a YouTube utility called "youtube-dl" to check the status of the stream. Then using the results, you can automatically restart the YouTube livestream.
Here is the command to get you started.
sudo pip3 install youtube-dl
youtube-dl -F 'htttps:/www.youtube.com/watch?v=YOUR_VIDEO_ID'
Replace YOUR_VIDEO_ID with the actual video ID of the live stream. If the live stream is active, this command will list available formats for the video. If the stream is not active, it will return an error.
Or, another approach is to monitor the bandwidth used by your ethernet connection. You can do that using a Linux utility called ifstat.
sudo apt-get install ifstat
#!/bin/bash
# Monitor eth0 and execute a script if bandwidth falls below 100bps
# Path to the restart script
RESTART_SCRIPT="/home/pi/scripts/restart.sh"
log_debug() {
echo "[DEBUG] $(date '+%Y-%m-%d %H:%M:%S') - $1"
}
log_debug "Starting bandwidth monitor for eth0."
while true; do
read RX TX <<< $(ifstat -i eth0 1 1 | awk 'NR==3 {print $1, $2}')
log_debug "Current bandwidth - RX: ${RX}bps, TX: ${TX}bps"
if (( $(echo "$RX < 100" | bc -l) )) || (( $(echo "$TX < 100" | bc -l) )); then
log_debug "Bandwidth below threshold. Executing restart script."
bash "$RESTART_SCRIPT"
log_debug "Restart script executed."
break
else
log_debug "Bandwidth is above the threshold."
fi
sleep 5
done
In this example the script monitors eth0 and if the bandwidth goes below 100 bps the script runs another bash script called restart.sh. The restart script kills the existing stream and restarts a new one.