2019-11-09 01:29:29 +03:00
|
|
|
#!/bin/bash
|
|
|
|
##########
|
|
|
|
# check if stream is live and start recording using youtube-dl
|
|
|
|
##########
|
|
|
|
|
|
|
|
source /opt/downloader/list.sh
|
|
|
|
#check if not running
|
|
|
|
[ -f $path/$1/pid ] && exit 0
|
|
|
|
|
|
|
|
#check if live
|
|
|
|
/opt/downloader/lifeChk.py $1 || exit 0
|
|
|
|
|
|
|
|
|
|
|
|
#set pid and start downloading
|
|
|
|
touch $path/$1/pid
|
2020-02-17 21:46:13 +03:00
|
|
|
/home/ubuntu/.local/bin/youtube-dl -v -o $path/$1/"%(upload_date)s_%(title)s__%(timestamp)s_%(id)s.%(ext)s" twitch.tv/$1 >> $path/$1/youtube-dl.log
|
2019-11-09 01:29:29 +03:00
|
|
|
rm $path/$1/pid
|