From 9d7f54d1dc4f3a5378479e7ba7bfffbe667445a1 Mon Sep 17 00:00:00 2001 From: JerryYan_at_Remote <792602257@qq.com> Date: Sun, 30 Apr 2023 08:35:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=8F=E6=98=8E=E5=BA=A6?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 4 +++- config.py | 6 +++++- templates/index.html | 5 +++++ workflow/danmaku.py | 5 +++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 294b402..19a5799 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,6 @@ __pycache__ venv build/ dist/ -access_token \ No newline at end of file +access_token +winsw.* +*.json \ No newline at end of file diff --git a/config.py b/config.py index 696e3c6..c513791 100644 --- a/config.py +++ b/config.py @@ -17,6 +17,8 @@ DANMAKU_FONT_NAME = "Sarasa Term SC" DANMAKU_FONT_SIZE = 40 # resolution VIDEO_RESOLUTION = "1280x720" +# opacity +DANMAKU_OPACITY = 100 # [ffmpeg] # exec FFMPEG_EXEC = "ffmpeg" @@ -68,13 +70,14 @@ def load_config(): if config.has_section("danmaku"): section = config['danmaku'] global DANMAKU_EXEC, DANMAKU_SPEED, DANMAKU_FONT_NAME, VIDEO_RESOLUTION, DANMAKU_FONT_SIZE, \ - DANMAKU_USE_DANMU2ASS, DANMAKU_USE_DANMAKUFACTORY + DANMAKU_USE_DANMU2ASS, DANMAKU_USE_DANMAKUFACTORY, DANMAKU_OPACITY DANMAKU_USE_DANMU2ASS = section.getboolean('use_danmu2ass', DANMAKU_USE_DANMU2ASS) DANMAKU_USE_DANMAKUFACTORY = section.getboolean('use_danmakufactory', DANMAKU_USE_DANMAKUFACTORY) DANMAKU_EXEC = section.get('exec', DANMAKU_EXEC) DANMAKU_SPEED = section.getfloat('speed', DANMAKU_SPEED) DANMAKU_FONT_NAME = section.get('font', DANMAKU_FONT_NAME) DANMAKU_FONT_SIZE = section.getint('font_size', DANMAKU_FONT_SIZE) + DANMAKU_OPACITY = section.getint('opacity', DANMAKU_OPACITY) VIDEO_RESOLUTION = section.get('resolution', VIDEO_RESOLUTION) if config.has_section("video"): section = config['video'] @@ -118,6 +121,7 @@ def get_config(): 'speed': DANMAKU_SPEED, 'font': DANMAKU_FONT_NAME, 'font_size': DANMAKU_FONT_SIZE, + 'opacity': DANMAKU_OPACITY, 'resolution': VIDEO_RESOLUTION, }, 'video': { diff --git a/templates/index.html b/templates/index.html index bf2c5ce..760d7fe 100644 --- a/templates/index.html +++ b/templates/index.html @@ -146,6 +146,10 @@