fixes,fixes,fixes...
This commit is contained in:
parent
a2bc87baeb
commit
90401b3819
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
list.sh
|
||||
config_python.py
|
||||
config_list.sh
|
||||
config_list.sh
|
||||
__pycache__
|
9
check.sh
9
check.sh
@ -5,20 +5,21 @@
|
||||
|
||||
full_path=$(dirname "$(realpath $0)")
|
||||
|
||||
source $full_path/list.sh
|
||||
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 || kill -9 $(cat $storage_path/$1/pid)
|
||||
[ -f $storage_path/$1/pid ] && $full_path/lifeChk.py $1 && exit 0
|
||||
|
||||
#exit if no stream
|
||||
$full_path/lifeChk.py $1 || exit 0
|
||||
|
||||
echo `$full_path/lifeChk.py $1`
|
||||
|
||||
#set pid and start downloading
|
||||
|
||||
nohup $ytdl_path/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 & echo $! > $storage_path/$1/pid
|
||||
nohup /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 & echo $! > $storage_path/$1/pid
|
||||
|
||||
#remove pid
|
||||
|
||||
|
4
cron.sh
4
cron.sh
@ -12,7 +12,7 @@ for i in $list; do
|
||||
[ ! -d $storage_path/$i ] && mkdir -p $storage_path/$i && echo "Created dir $storage_path/$i"
|
||||
|
||||
#detached check & start
|
||||
screen -dmS $i bash $full_path/check.sh $i
|
||||
bash $full_path/check.sh $i
|
||||
sleep 2
|
||||
|
||||
done
|
||||
@ -21,6 +21,6 @@ done
|
||||
echo "===="
|
||||
|
||||
for i in $list; do
|
||||
[ -f $storage_path/$i/pid] && echo $i "is recording!" || echo $i "is not recording"
|
||||
[[ -f $storage_path/$i/pid ]] && echo $i "is recording!" || echo $i "is not recording"
|
||||
done
|
||||
echo "===="
|
||||
|
@ -9,7 +9,7 @@ import config_python
|
||||
|
||||
from twitch import TwitchClient
|
||||
|
||||
client = TwitchClient(client_id=twitchid) #client init
|
||||
client = TwitchClient(client_id=config_python.twitchid) #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)
|
||||
|
||||
|
2
requirements.txt
Normal file
2
requirements.txt
Normal file
@ -0,0 +1,2 @@
|
||||
youtube-dl==2021.4.17
|
||||
python-twitch-client==0.7.1
|
Loading…
Reference in New Issue
Block a user