更新设置

This commit is contained in:
Jerry Yan 2019-10-19 08:27:51 +08:00
parent 0fc33fccff
commit 204d8342bb

View File

@ -36,11 +36,6 @@ config = {
# 下播延迟投稿
"dly": 30
}
_config_fp = open("config.json", "r", encoding="utf8")
_config = json.load(_config_fp)
_config_fp.close()
del _config_fp
doCleanTime = datetime.now()
_clean_flag = None
delay = 30
@ -65,6 +60,15 @@ network = [{
}]
def reloadConfig():
global config
if(os.path.exists(config.json)):
_config_fp = open("config.json", "r", encoding="utf8")
_config = json.load(_config_fp)
config.update(_config)
_config_fp.close()
def resetDelay():
global delay
delay = config['dly']
@ -147,16 +151,8 @@ def getCurrentStatus():
}
def reloadConfig():
global config
_config_fp = open("config.json", "r", encoding="utf8")
_config = json.load(_config_fp)
config.update(_config)
_config_fp.close()
dt_format = "%Y/%m/%d %H:%M:%S"
reloadConfig()
broadcaster = ""
streamUrl = ""
isBroadcasting = False