# -*- 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("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False) cmd = r""" systemctl restart douyinweb-web sleep 2 systemctl is-active douyinweb-web docker ps -a --filter name=douyinweb-neko --format '{{.Names}} {{.Status}}' curl -fsS -X POST http://127.0.0.1:8014/api/youtube/studio/ingest -H 'Content-Type: application/json' -d '{"live_status":"ok","source":"final"}' echo curl -fsS -o /dev/null -w 'neko1:%{http_code}\n' https://dy.nomadro.live/neko/1/ curl -fsS -o /dev/null -w 'neko2:%{http_code}\n' https://dy.nomadro.live/neko/2/ """ _i, o, e = c.exec_command(cmd, timeout=60) print(o.read().decode("utf-8", "replace")) print(e.read().decode("utf-8", "replace")[:400]) c.close()