From 3678ff7e31ef4ca9af9c906a90ab684438d1370c Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 3 Jan 2026 20:59:43 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=8C=E5=90=88=E5=B9=B6=E5=A4=9A?= =?UTF-8?q?=E8=A1=8C=E8=B5=8B=E5=80=BC=E4=B8=BA=E5=8D=95=E8=A1=8C=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E9=83=A8=E5=88=86=E5=BC=82=E5=B8=B8=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.json | 2 +- douyin/core/douyin_fudai.py | 8 ++++++-- douyin/utils/douyin_config.py | 12 +++--------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/config/config.json b/config/config.json index b451504..5056ffa 100644 --- a/config/config.json +++ b/config/config.json @@ -190,4 +190,4 @@ "fansclub_manual_wait_seconds": 3.0, "enable_streaming_screenshot": false, "fudai_exit_after_misses": 30 -} +} \ No newline at end of file diff --git a/douyin/core/douyin_fudai.py b/douyin/core/douyin_fudai.py index 2b24d40..936c413 100644 --- a/douyin/core/douyin_fudai.py +++ b/douyin/core/douyin_fudai.py @@ -330,7 +330,9 @@ class fudai_analyse: except Exception: # 兜底:若模块不可用则快速返回 try: - self._log_kv("养号", "_yanghao_recommend_flow 未能执行 - 模块缺失或异常") + self._log_kv( + "养号", "_yanghao_recommend_flow 未能执行 - 模块缺失或异常" + ) except Exception: pass @@ -354,7 +356,9 @@ class fudai_analyse: return int(douyin_yanghao.yanghao_get_recommend_seconds(self)) except Exception: try: - return int(getattr(self, "yanghao_recommend_duration_seconds", 60) or 60) + return int( + getattr(self, "yanghao_recommend_duration_seconds", 60) or 60 + ) except Exception: return 60 diff --git a/douyin/utils/douyin_config.py b/douyin/utils/douyin_config.py index 9bdc1f0..4db7517 100644 --- a/douyin/utils/douyin_config.py +++ b/douyin/utils/douyin_config.py @@ -300,9 +300,7 @@ class ConfigManager: analyser.yanghao_fav_prob = float(config["yanghao_fav_prob"] or 0.0) if "yanghao_comment_prob" in config: - analyser.yanghao_comment_prob = float( - config["yanghao_comment_prob"] or 0.0 - ) + analyser.yanghao_comment_prob = float(config["yanghao_comment_prob"] or 0.0) # icon 坐标/偏移/模板路径 if "yanghao_like_icon_x" in config: @@ -352,13 +350,9 @@ class ConfigManager: config["yanghao_comment_input_y"] or 0 ) if "yanghao_comment_send_x" in config: - analyser.yanghao_comment_send_x = int( - config["yanghao_comment_send_x"] or 0 - ) + analyser.yanghao_comment_send_x = int(config["yanghao_comment_send_x"] or 0) if "yanghao_comment_send_y" in config: - analyser.yanghao_comment_send_y = int( - config["yanghao_comment_send_y"] or 0 - ) + analyser.yanghao_comment_send_y = int(config["yanghao_comment_send_y"] or 0) if "yanghao_comment_close_x" in config: analyser.yanghao_comment_close_x = int( config["yanghao_comment_close_x"] or 0