feat: 添加回退方式配置选项,支持滑动和按返回键回退;优化日志清理机制

This commit is contained in:
Your Name committed 2026-01-05 00:38:27 +08:00
1 parent 46733155e0
commit 982357927e
4 files changed
+125 -50

No files matched your search

+11
View File
@@ -182,6 +182,12 @@ def parse_args(argv: list[str]) -> argparse.Namespace:
action="store_true",
help="关闭切换次数阈值回退到第一个直播间",
)
p.add_argument(
"--reset-after-swipes-action",
choices=["swipe", "back"],
default=None,
help="回退方式:swipe=滑动回退(默认),back=按返回键回退。",
)
p.add_argument(
"--swipe-down-back-count",
@@ -471,6 +477,11 @@ def main(argv: list[str]) -> int:
analyser.reset_after_swipes_enabled = True
if args.reset_after_swipes_disabled:
analyser.reset_after_swipes_enabled = False
if getattr(args, "reset_after_swipes_action", None) is not None:
try:
analyser.reset_after_swipes_action = str(args.reset_after_swipes_action or "swipe")
except Exception:
pass
# 下滑后返回并重新进入直播间的命令行覆盖(优先级高于 config.json)
if getattr(args, "swipe_down_back_count", None) is not None:
try: