#!/usr/bin/env python3 """Check what JS is actually served on host03 for live_youtube.""" from __future__ import annotations import paramiko HOST, USER, PASS = "10.88.0.3", "eric", "Xiao4669805" BASE = "/opt/live/d2ypp" cmds = [ f"grep -r 'hideStatusOverview' {BASE}/web-console/out {BASE}/web-console/components 2>/dev/null | head -5", f"grep -r 'HIDE_YOUTUBE_LIVE_PROCESS_LOG' {BASE}/web-console 2>/dev/null | head -5", f"grep -r '进程状态' {BASE}/web-console/out/_next 2>/dev/null | head -3", f"ls -la {BASE}/web-console/out/index.html {BASE}/web-console/out/_next/static/chunks/app/page*.js 2>/dev/null", "curl -sS http://127.0.0.1:8001/ | head -c 2000", f"stat {BASE}/web-console/out/index.html 2>/dev/null", f"grep 'hideStatusOverview' {BASE}/web-console/out/_next/static/chunks/*.js 2>/dev/null | head -2", f"find {BASE}/web-console/out/_next/static/chunks -name 'page*.js' -printf '%T@ %p\\n' 2>/dev/null | sort -nr | head -5", ] c = paramiko.SSHClient() c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) c.connect(HOST, username=USER, password=PASS, timeout=20) for cmd in cmds: _, o, e = c.exec_command(cmd, timeout=60) out = (o.read() + e.read()).decode("utf-8", "replace") print(f"\n=== {cmd[:90]} ===\n{out[:2500]}") c.close()