douyinWEB/scripts/_diag_yt_relay2.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
Capture Neko/WG/network hubs, Studio viewer charts, physical deploy docs, and one-shot scripts so VPS vs physical can be toggled later without losing WIP.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-04 22:42:40 -05:00

28 lines
982 B
Python

# -*- coding: utf-8 -*-
import sys
import paramiko
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("107.173.30.245", 22, "root", "Xiao4669805", timeout=30, allow_agent=False, look_for_keys=False)
def run(cmd: str, timeout: int = 60) -> str:
_, o, e = c.exec_command(cmd, timeout=timeout)
return (o.read() + e.read()).decode("utf-8", "replace").strip()
print("=== unit ExecStart ===")
print(run("systemctl cat douyinweb-api | head -40"))
print("=== dry run start via curl (expect 401) ===")
print(run("curl -s -X POST http://127.0.0.1:8014/api/youtube/relay/groups/ef7cfc0c-3800-4b80-9dbc-2ebd309e557d/start | head -c 300"))
print("=== sqlite relay states ===")
print(
run(
"sqlite3 /opt/douyinWEB/backend/data/monitor.db "
"\"SELECT group_id,status,substr(error,1,80),ffmpeg_pid,substr(recent_log,1,120) FROM yt_relay_states;\""
)
)
c.close()