douyinWEB/scripts/_diag_channel_pk.py
eric d409e416da Ship physical dual-edge stack, Studio CDP live metrics, and ops tooling.
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>
2026-09-04 22:42:40 -05:00

25 lines
1.0 KiB
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 yt_assign_db, db
groups = yt_assign_db.list_groups(include_urls=False, include_secret=True)
for g in groups:
pk = str(g.get('channel_pk') or '')
ch = db.get_shorts_channel(pk) if pk else None
print('GROUP', g.get('name'), 'enabled', g.get('enabled'), 'has_key', bool(g.get('stream_key')))
print(' group yt', g.get('youtube_channel_id'))
print(' group pk', pk[:8] if pk else '')
if ch:
print(' shorts name', ch.get('name'))
print(' shorts yt', ch.get('youtube_channel_id'))
print(' shorts handle', ch.get('handle'))
print()
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()