single config
This commit is contained in:
parent
9b10d35eb6
commit
b4b1b6394d
10
check.sh
10
check.sh
@ -11,17 +11,17 @@ source $full_path/config_list.sh
|
||||
|
||||
#check if not running, kill if running and stream is finished (broken record)
|
||||
# [ -f $storage_path/$1/pid ] && $full_path/lifeChk.py $1 && exit 0 || kill -9 $(cat $storage_path/$1/pid)
|
||||
[ -f $storage_path/$1/pid ] && $full_path/lifeChk.py $1 && exit 0
|
||||
|
||||
#if pid exists and stream is live, than exit and do not start recording
|
||||
[ -f $storage_path/$1/pid ] && $full_path/lifeChk.py $1 $twitchid && exit 0
|
||||
|
||||
#exit if no stream
|
||||
$full_path/lifeChk.py $1 || exit 0
|
||||
$full_path/lifeChk.py $1 $twitchid || exit 0
|
||||
# echo `$full_path/lifeChk.py $1`
|
||||
|
||||
#set pid and start downloading
|
||||
#set pid and start recording
|
||||
echo $! > $storage_path/$1/pid
|
||||
/home/losted/.local/bin/youtube-dl -v -o $storage_path/$1/"%(upload_date)s_%(title)s__%(timestamp)s_%(id)s.%(ext)s" twitch.tv/$1 >> $storage_path/$1/youtube-dl.log 2>&1
|
||||
|
||||
|
||||
#remove pid
|
||||
|
||||
rm $storage_path/$1/pid
|
||||
|
@ -4,7 +4,7 @@
|
||||
###########
|
||||
|
||||
list="jesusavgn"
|
||||
|
||||
twitchid="123456789qwertyuiops"
|
||||
storage_path="/media/nfs/twitch/automatedRecording"
|
||||
ytdl_path="/home/ubuntu/.local/bin"
|
||||
ytdl_conf="-o %(uploader)s__%(upload_date)s_%(timestamp)s__%(title)s_%(id)s.%(ext)s"
|
||||
|
@ -1,2 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
twitchid=""
|
@ -3,13 +3,12 @@
|
||||
# return 0 if streamer is live (continue execution while in bash), 1 if not
|
||||
#################
|
||||
import sys
|
||||
import config_python
|
||||
#if not sys.argv[1]:
|
||||
# sys.exit(2)
|
||||
if (not sys.argv[1]) or (not sys.argv[2]):
|
||||
sys.exit(2)
|
||||
|
||||
from twitch import TwitchClient
|
||||
|
||||
client = TwitchClient(client_id=config_python.twitchid) #client init
|
||||
client = TwitchClient(client_id=sys.argv[2]) #client init
|
||||
user_id=client.users.translate_usernames_to_ids(sys.argv[1])[0].id #get id
|
||||
#get live by id (if var not empty)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user