From 77fe8ad53b87f46c68de1a93f53d3f56576c8ff6 Mon Sep 17 00:00:00 2001 From: lulzette Date: Mon, 17 Feb 2020 21:46:13 +0300 Subject: [PATCH] some fixes --- .gitignore | 1 + .vscode/settings.json | 3 --- check.sh | 2 +- conf_python.py.template | 2 ++ main.sh => cron.sh | 0 lifeChk.py | 3 ++- main.py | 1 - 7 files changed, 6 insertions(+), 6 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 conf_python.py.template rename main.sh => cron.sh (100%) mode change 100644 => 100755 lifeChk.py delete mode 100644 main.py diff --git a/.gitignore b/.gitignore index 64718b4..0728bed 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ list.sh +conf_python.py \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index b26f7c4..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "python.pythonPath": "/bin/python" -} \ No newline at end of file diff --git a/check.sh b/check.sh index 065b266..94f1e46 100755 --- a/check.sh +++ b/check.sh @@ -13,5 +13,5 @@ source /opt/downloader/list.sh #set pid and start downloading touch $path/$1/pid -/home/ubuntu/.local/bin/youtube-dl -v -o $path/$1/"%(uploader)s__%(upload_date)s_%(timestamp)s__%(title)s_%(id)s.%(ext)s" twitch.tv/$1 > $path/$1/youtube-dl.log +/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 rm $path/$1/pid diff --git a/conf_python.py.template b/conf_python.py.template new file mode 100644 index 0000000..dcc99a6 --- /dev/null +++ b/conf_python.py.template @@ -0,0 +1,2 @@ +#!/usr/bin/python3 +twitchid="" \ No newline at end of file diff --git a/main.sh b/cron.sh similarity index 100% rename from main.sh rename to cron.sh diff --git a/lifeChk.py b/lifeChk.py old mode 100644 new mode 100755 index baaf437..1a7268d --- a/lifeChk.py +++ b/lifeChk.py @@ -3,11 +3,12 @@ # return 0 if streamer is live (continue exec while in bash), 1 if not ################# import sys +import conf_python #if not sys.argv[1]: # sys.exit(2) from twitch import TwitchClient -twitchid = "59hrsplx7dmvc17pqkqcm9l3n1uzc4" + client = TwitchClient(client_id=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) diff --git a/main.py b/main.py deleted file mode 100644 index d8dbf66..0000000 --- a/main.py +++ /dev/null @@ -1 +0,0 @@ -#!/bin/python3