# -*- coding: utf-8 -*- import sys import paramiko sys.stdout.reconfigure(encoding="utf-8", errors="replace") from pathlib import Path ROOT = Path(__file__).resolve().parents[1] 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) sftp = c.open_sftp() sftp.put(str(ROOT / "backend/neko/cdp_end_stream.py"), "/tmp/cdp_end_stream.py") sftp.close() _, o, e = c.exec_command( "install -m 0644 /tmp/cdp_end_stream.py /opt/douyinWEB/backend/neko/cdp_end_stream.py && " "grep -n 'Not yet\\|CONFIRM_EXACT\\|pre_confirm' /opt/douyinWEB/backend/neko/cdp_end_stream.py | head -20 && " "echo DONE", timeout=30, ) print((o.read() + e.read()).decode("utf-8", "replace")) c.close()