# -*- coding: utf-8 -*- import sys, 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): _, o, e = c.exec_command(cmd, timeout=60) return (o.read()+e.read()).decode("utf-8","replace").strip() print(run(r"""cd /opt/douyinWEB/backend && .venv/bin/python - <<'PY' from app import db from app.yt_long_pipeline import yt_long_pipeline cfg = db.get_settings_map() print('raw yt_long_enabled', repr(cfg.get('yt_long_enabled')), type(cfg.get('yt_long_enabled'))) st = yt_long_pipeline.status() print('status enabled', st.get('enabled')) # force keep disabled for safety unless user turned on via UI intentionally # print only for now PY""")) c.close()