合并外部维护版本并同步自动每日功能
This commit is contained in:
+6
-12
@@ -165,12 +165,6 @@ async def _run_queue(host: str, port: int):
|
||||
await danmu_queue.main(host=host, port=port)
|
||||
|
||||
|
||||
async def _run_music(port: int):
|
||||
import music_monitor
|
||||
|
||||
await music_monitor.run_monitor(port)
|
||||
|
||||
|
||||
def _run_tts_monitor():
|
||||
import tts_monitor
|
||||
|
||||
@@ -204,8 +198,11 @@ async def _run_all(host: str, port: int):
|
||||
# Refuse stale/conflicting listeners before creating any helper process.
|
||||
_assert_port_available(host, port)
|
||||
queue_task = asyncio.create_task(_run_queue(host, port), name="queue-main")
|
||||
children.append(_spawn_role("music", port, host, visible=False))
|
||||
children.append(_spawn_role("tts", port, host, visible=True))
|
||||
# pythonw 无窗口模式下 TTS 监控窗无法显示内容(stdout 为 None),
|
||||
# 且其每秒的 cls 清屏会不断弹出新控制台窗口,直接跳过。
|
||||
running_windowless = sys.stdout is None or sys.executable.lower().endswith("pythonw.exe")
|
||||
if not running_windowless:
|
||||
children.append(_spawn_role("tts", port, host, visible=True))
|
||||
for child in children:
|
||||
job.assign(child)
|
||||
await queue_task
|
||||
@@ -222,7 +219,7 @@ async def _run_all(host: str, port: int):
|
||||
def main():
|
||||
ensure_runtime_dirs()
|
||||
parser = argparse.ArgumentParser(description="BetterGI 直播联动统一入口")
|
||||
parser.add_argument("--role", choices=["all", "queue", "music", "tts"], default="all")
|
||||
parser.add_argument("--role", choices=["all", "queue", "tts"], default="all")
|
||||
parser.add_argument("--port", type=int, default=8086)
|
||||
parser.add_argument("--host", default="0.0.0.0", help="Web service bind address")
|
||||
args = parser.parse_args()
|
||||
@@ -238,9 +235,6 @@ def main():
|
||||
if args.role == "tts":
|
||||
_run_tts_monitor()
|
||||
return 0
|
||||
if args.role == "music":
|
||||
asyncio.run(_run_music(args.port))
|
||||
return 0
|
||||
if args.role == "queue":
|
||||
asyncio.run(_run_queue(args.host, args.port))
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user