From c08670d2a2ff008700f8ddb6c5c5406e9a00d98e Mon Sep 17 00:00:00 2001 From: Lulzette Date: Sat, 25 Sep 2021 14:25:34 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D1=83=D1=81=D1=82=D0=BE=D0=B9=D1=87=D0=B8=D0=B2=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BA=20=D0=BD=D0=B5=D1=81=D1=83=D1=89=D0=B5?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B8=D0=BC/=D0=B7=D0=B0?= =?UTF-8?q?=D0=B1=D0=B0=D0=BD=D0=B5=D0=BD=D1=8B=D0=BC=20=D1=8E=D0=B7=D0=B5?= =?UTF-8?q?=D1=80=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- daemon.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/daemon.py b/daemon.py index 404cc40..c32f8ea 100755 --- a/daemon.py +++ b/daemon.py @@ -7,6 +7,7 @@ import os import sys from threading import Thread +from types import resolve_bases import config_python import schedule from twitch import TwitchClient @@ -87,7 +88,16 @@ def checkAlive(): if not (os.path.exists(path)): os.makedirs(path) # Получить ID по нику - user_id = client.users.translate_usernames_to_ids(i)[0]['id'] + resolved_id = client.users.translate_usernames_to_ids(i) + if not resolved_id: + log.error( + colored( + "Аккаунт " + i + " не найден", + 'red', + ) + ) + break + user_id = resolved_id[0]['id'] # Если стрим идет, то идем дальше if client.streams.get_stream_by_user(user_id): # Если стрим идет и лок файла нет, то записываем и ставим лок