Переход от месива из баш скриптов к нормальному питоновскому коду #5

Merged
lulzette merged 32 commits from move-to-python into master 2022-11-13 12:45:18 +03:00
Showing only changes of commit c08670d2a2 - Show all commits

View File

@ -7,6 +7,7 @@
import os import os
import sys import sys
from threading import Thread from threading import Thread
from types import resolve_bases
import config_python import config_python
import schedule import schedule
from twitch import TwitchClient from twitch import TwitchClient
@ -87,7 +88,16 @@ def checkAlive():
if not (os.path.exists(path)): if not (os.path.exists(path)):
os.makedirs(path) os.makedirs(path)
# Получить ID по нику # Получить 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): if client.streams.get_stream_by_user(user_id):
# Если стрим идет и лок файла нет, то записываем и ставим лок # Если стрим идет и лок файла нет, то записываем и ставим лок