初始版本

This commit is contained in:
2022-04-15 14:33:01 +08:00
parent 09b2956573
commit e72eeb1f0e
6 changed files with 124 additions and 7 deletions

View File

@ -20,6 +20,11 @@ VIDEO_BITRATE = "2.5M"
# [video]
# title
VIDEO_TITLE = "【永恒de草薙直播录播】直播于 {}"
# [clip]
# each_sec
VIDEO_CLIP_EACH_SEC = 6000
# overflow_sec
VIDEO_CLIP_OVERFLOW_SEC = 5
# [recorder]
# bili_dir
BILILIVE_RECORDER_DIRECTORY = "./"
@ -48,6 +53,11 @@ def load_config():
section = config['video']
global VIDEO_TITLE
VIDEO_TITLE = section.get('title', VIDEO_TITLE)
if config.has_section("clip"):
section = config['clip']
global VIDEO_CLIP_EACH_SEC, VIDEO_CLIP_OVERFLOW_SEC
VIDEO_CLIP_EACH_SEC = section.get('each_sec', VIDEO_CLIP_EACH_SEC)
VIDEO_CLIP_OVERFLOW_SEC = section.get('overflow_sec', VIDEO_CLIP_OVERFLOW_SEC)
if config.has_section("ffmpeg"):
section = config['ffmpeg']
global FFMPEG_EXEC, FFMPEG_USE_GPU, VIDEO_BITRATE
@ -78,6 +88,10 @@ def get_config():
'video': {
'title': VIDEO_TITLE,
},
'clip': {
'each_sec': VIDEO_CLIP_EACH_SEC,
'overflow_sec': VIDEO_CLIP_OVERFLOW_SEC,
},
'ffmpeg': {
'exec': FFMPEG_EXEC,
'gpu': FFMPEG_USE_GPU,
@ -102,4 +116,4 @@ def write_config():
config[_i] = _config[_i]
with open("config.ini", "w", encoding="utf-8") as f:
config.write(f)
return True
return True