douyinWEB/scripts/_verify_avatar2.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

29 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
import paramiko
import sys
import time
if hasattr(sys.stdout, "reconfigure"):
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
def run(c, cmd, timeout=30):
_, o, e = c.exec_command(cmd, timeout=timeout)
out = o.read().decode("utf-8", "replace")
err = e.read().decode("utf-8", "replace")
print(out)
if err.strip():
print("ERR", err[:400])
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False)
run(c, "systemctl is-active douyinweb-api || systemctl start douyinweb-api; sleep 2; systemctl is-active douyinweb-api")
run(
c,
"cd /opt/douyinWEB/backend && PYTHONPATH=. .venv/bin/python -c \"from app.db import get_room_by_room_id; r=get_room_by_room_id('120371233716'); print(r.get('avatar_url') if r else None)\"",
)
run(c, "curl -sI https://dy.nomadro.live/douyin-covers/covers/avatars/120371233716.jpg | head -5")
c.close()