douyinWEB/scripts/_check_b_ui_meta.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

33 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
import paramiko
REMOTE = r"""
cd /opt/douyinWEB/backend
.venv/bin/python - <<'PY'
from app import db, youtube_manage as ytm
for ch in db.list_shorts_channels(enabled=None):
if str(ch.get('oauth_profile_id') or '').upper() != 'B':
continue
sn = ytm._snippet_from_channel_row(ch) or {}
print(
ch.get('name'),
'| yt_id', ch.get('youtube_channel_id'),
'| thumb', (sn.get('thumb_url') or '')[:70],
'| subs', sn.get('subscriber_count'),
'| videos', sn.get('video_count'),
'| views', sn.get('view_count'),
'| oauth_err', ch.get('oauth_error') or '(none)',
)
PY
"""
c = paramiko.SSHClient()
c.set_missing_host_key_policy(paramiko.AutoAddPolicy())
c.connect("108.174.50.68", 22, "root", "Xiao4669805", timeout=45, allow_agent=False, look_for_keys=False)
_i, o, e = c.exec_command(REMOTE, timeout=60)
print(o.read().decode("utf-8", "replace"))
err = e.read().decode("utf-8", "replace").strip()
if err:
print("ERR", err[:400])
c.close()