refactor: 优化代码格式,合并多行赋值为单行,调整部分异常处理逻辑
This commit is contained in:
1 parent
6a59365aae
commit
3678ff7e31
3 files changed
+10
-12
No files matched your search
+1
-1
@@ -190,4 +190,4 @@
|
||||
"fansclub_manual_wait_seconds": 3.0,
|
||||
"enable_streaming_screenshot": false,
|
||||
"fudai_exit_after_misses": 30
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user