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>
21 lines
838 B
Python
21 lines
838 B
Python
# -*- coding: utf-8 -*-
|
|
import sys, paramiko
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
REMOTE = r"""
|
|
cd /opt/douyinWEB/backend && .venv/bin/python3 <<'PY'
|
|
from app import youtube_relay_db, yt_assign_db
|
|
for g in yt_assign_db.list_groups(include_urls=False):
|
|
gid = g['id']
|
|
st = youtube_relay_db.get_relay_state(gid) or {}
|
|
err = str(st.get('error') or '')
|
|
if '非当前时段' in err:
|
|
youtube_relay_db.upsert_relay_state(gid, status='outside_slot', error='', recent_log=st.get('recent_log') or [])
|
|
print('cleaned', g.get('name'))
|
|
PY
|
|
"""
|
|
c=paramiko.SSHClient(); c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
|
|
c.connect('108.174.50.68',22,'root','Xiao4669805',timeout=60,allow_agent=False,look_for_keys=False)
|
|
_,o,_=c.exec_command(REMOTE,timeout=60)
|
|
print(o.read().decode())
|
|
c.close()
|