douyinWEB/scripts/reconcile_clips_vps.py
2026-08-10 20:11:23 -05:00

23 lines
776 B
Python

# -*- coding: utf-8 -*-
import paramiko
import sys
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)
cmd = (
"cd /opt/douyinWEB/backend && .venv/bin/python -c "
"'from app import db; db.init_db(); "
"m=db.reconcile_missing_shorts_clips(); h=db.reconcile_false_failed_shorts(); "
"print(\"missing\", m, \"healed\", h); "
"j=db.get_shorts_job(\"7c0e94e0-338a-4060-bbf9-7a16e7e26bc5\"); print(\"job\", j)'"
)
_, stdout, stderr = c.exec_command(cmd)
print(stdout.read().decode())
err = stderr.read().decode()
if err.strip():
print("stderr:", err)
c.close()