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>
32 lines
980 B
Python
32 lines
980 B
Python
# -*- coding: utf-8 -*-
|
|
import paramiko
|
|
|
|
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)
|
|
|
|
script = r"""
|
|
import sqlite3
|
|
conn = sqlite3.connect('/opt/douyinWEB/backend/data/monitor.db')
|
|
conn.row_factory = sqlite3.Row
|
|
cur = conn.cursor()
|
|
cur.execute('''
|
|
SELECT id, name, youtube_channel_id, oauth_profile_id, oauth_error
|
|
FROM shorts_channels
|
|
WHERE enabled=1 AND upper(coalesce(oauth_profile_id,''))='B'
|
|
AND (oauth_ok IS NULL OR oauth_ok=0 OR oauth_error LIKE '%force-ssl%')
|
|
ORDER BY name
|
|
''')
|
|
for r in cur.fetchall():
|
|
print(r['id'], '|', r['name'], '|', r['youtube_channel_id'] or '')
|
|
conn.close()
|
|
"""
|
|
|
|
sftp = c.open_sftp()
|
|
with sftp.file("/tmp/list_b.py", "w") as f:
|
|
f.write(script)
|
|
sftp.close()
|
|
_, o, _ = c.exec_command("python3 /tmp/list_b.py", timeout=60)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
c.close()
|