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>
44 lines
1.7 KiB
Python
44 lines
1.7 KiB
Python
# -*- coding: utf-8 -*-
|
|
import json
|
|
import paramiko
|
|
import sys
|
|
|
|
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
|
|
|
|
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)
|
|
|
|
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
|
|
curl -sS -b /tmp/dy.ck https://dy.nomadro.live/api/youtube/relay/status -o /tmp/relay.json
|
|
python3 <<'PY'
|
|
import json
|
|
from pathlib import Path
|
|
d=json.loads(Path('/tmp/relay.json').read_text())
|
|
print('BJ now from schedule:', d.get('schedule',{}).get('now_beijing'))
|
|
for ch in d.get('schedule',{}).get('channels',[]):
|
|
if ch.get('active'):
|
|
print('ACTIVE SLOT:', ch.get('name'), ch.get('group_id'), ch.get('start_label'), '-', ch.get('end_label'))
|
|
for g in d.get('groups',[]):
|
|
if 'Evan' in str(g.get('name')) or g.get('business_status') not in ('misconfigured',):
|
|
print('\n===', g.get('name'), g.get('group_id'))
|
|
print('biz', g.get('business_status'), g.get('business_note'))
|
|
print('status', g.get('status'), 'manual', g.get('manual_hold'))
|
|
print('source', g.get('source_url'), g.get('source_room_id'))
|
|
rl=g.get('recent_log')
|
|
if isinstance(rl, list):
|
|
for line in rl[-20:]:
|
|
print(' ', line[:240])
|
|
elif isinstance(rl, str):
|
|
print(rl[-2000:])
|
|
PY
|
|
journalctl -u douyinweb-api -n 40 --no-pager 2>/dev/null | tail -20
|
|
"""
|
|
|
|
_, o, e = c.exec_command(REMOTE, timeout=90)
|
|
print(o.read().decode())
|
|
c.close()
|