Заменил os.system на нативные аналоги

This commit is contained in:
Lulzette 2021-09-25 23:49:08 +03:00
parent c38cb73e3e
commit b0c0573d34

View File

@ -69,7 +69,7 @@ def recorder(i):
subprocess.call(cmdline) subprocess.call(cmdline)
log.info("Запись стрима %s закончена\n" % i) log.info("Запись стрима %s закончена\n" % i)
if (os.path.exists(path+"/pid")): if (os.path.exists(path+"/pid")):
os.system("rm "+path+"/pid") os.remove(path+"/pid")
log.info("lock файл удален") log.info("lock файл удален")
@ -105,7 +105,7 @@ def checkAlive():
if (client.streams.get_stream_by_user(user_id).stream_type == 'live') and not (os.path.exists(config_python.path+"/"+i+"/pid")): if (client.streams.get_stream_by_user(user_id).stream_type == 'live') and not (os.path.exists(config_python.path+"/"+i+"/pid")):
log.info(i + " стримит") log.info(i + " стримит")
startRecord(i) startRecord(i)
os.system("touch "+path+"/pid") open(path+"/pid", 'w').close
else: else:
log.info( log.info(
colored( colored(
@ -119,7 +119,7 @@ def checkAlive():
log.info(i + " Не стримит") log.info(i + " Не стримит")
# Если есть лок, то удаляем # Если есть лок, то удаляем
if (os.path.exists(path+"/pid")): if (os.path.exists(path+"/pid")):
os.system("rm "+path+"/pid") os.remove(path+"/pid")
def removeOldStreams(): def removeOldStreams():