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>
50 lines
2.0 KiB
Python
50 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
import sys, paramiko
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
REMOTE = r"""
|
|
curl -sS -c /tmp/dy.ck -X POST https://dy.nomadro.live/api/auth/login \
|
|
-H 'Content-Type: application/json' \
|
|
-d '{"username":"hackrobot","password":"Xiao4669805@"}' >/dev/null 2>/dev/null || true
|
|
|
|
echo '=== schedule ==='
|
|
curl -sS -b /tmp/dy.ck 'https://dy.nomadro.live/api/youtube/assign/schedule' 2>/dev/null | python3 -c "
|
|
import json,sys
|
|
s=json.load(sys.stdin)
|
|
print('channels', s.get('channel_count'), 'slot_h', s.get('slot_hours'), 'now', s.get('now_label'))
|
|
for c in s.get('channels') or []:
|
|
print(' ', c.get('start_label'), c.get('end_label'), c.get('name'), 'active', c.get('active'))
|
|
"
|
|
|
|
echo '=== relay ==='
|
|
curl -sS -b /tmp/dy.ck 'https://dy.nomadro.live/api/youtube/relay/status' 2>/dev/null | python3 -c "
|
|
import json,sys
|
|
r=json.load(sys.stdin)
|
|
print('auto', r.get('enabled'), 'pushing', r.get('pushing_count'))
|
|
for g in r.get('groups') or []:
|
|
if g.get('has_stream_key') and g.get('enabled'):
|
|
print(' ', g.get('name'), 'pushing', g.get('is_pushing'), 'status', g.get('status'), 'err', (g.get('error') or '')[:50])
|
|
"
|
|
|
|
echo '=== live-map ==='
|
|
curl -sS -b /tmp/dy.ck 'https://dy.nomadro.live/api/youtube/live-map' 2>/dev/null | python3 -c "
|
|
import json,sys
|
|
m=json.load(sys.stdin)
|
|
print('yt_live_count', m.get('live_count'))
|
|
"
|
|
|
|
echo '=== keyed groups ==='
|
|
cd /opt/douyinWEB/backend && .venv/bin/python3 <<'PY'
|
|
from app import yt_assign_db
|
|
for g in yt_assign_db.list_groups(include_urls=False, include_secret=True):
|
|
if g.get('has_stream_key'):
|
|
meta = yt_assign_db._group_yt_channel_meta(g)
|
|
print(g.get('name'), 'enabled', g.get('enabled'), 'neko', g.get('neko_instance_id'), 'yt', meta.get('youtube_channel_id','')[:20])
|
|
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,e=c.exec_command(REMOTE,timeout=120)
|
|
print(o.read().decode())
|
|
if e.read(): print('ERR')
|
|
c.close()
|