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>
40 lines
1.6 KiB
Python
40 lines
1.6 KiB
Python
# -*- coding: utf-8 -*-
|
|
import sys
|
|
import paramiko
|
|
|
|
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=45, allow_agent=False, look_for_keys=False)
|
|
cmd = r"""
|
|
cd /opt/douyinWEB/backend
|
|
.venv/bin/python - <<'PY'
|
|
from app import youtube_neko, yt_assign_db
|
|
groups = yt_assign_db.list_groups(include_urls=False)
|
|
for g in groups:
|
|
print(g.get('name'), 'neko', g.get('neko_instance_id'), 'enabled', g.get('neko_enabled'))
|
|
print('sync', youtube_neko.sync_for_groups(groups))
|
|
for i in youtube_neko.list_instances(2):
|
|
print('inst', i.get('id'), 'run', i.get('running'), 'ready', i.get('ready'), i.get('studio_url'))
|
|
# confirm script on disk for running instances
|
|
from pathlib import Path
|
|
ext='dhdgffkkebhmkfjojejmpbldmpobfkfo'
|
|
for i in (1,2):
|
|
for area in ('Local Extension Settings','Managed Extension Settings'):
|
|
d=Path(f'/opt/douyinWEB/backend/data/neko/profiles/{i}/Default/{area}/{ext}')
|
|
hit=False
|
|
if d.is_dir():
|
|
for f in d.iterdir():
|
|
if f.is_file() and b'YouTube Studio Auto Dismiss' in f.read_bytes():
|
|
hit=True; break
|
|
print(f'profile{i} {area} script={hit}')
|
|
PY
|
|
# confirm no auto-dismiss.js
|
|
ls /opt/douyinWEB/backend/neko/live-ops-extension/
|
|
docker exec douyinweb-neko-2 sh -c 'for f in /proc/[0-9]*/cmdline; do tr "\0" " " < "$f"; echo; done' 2>/dev/null | grep load-extension | head -3
|
|
"""
|
|
_i, o, e = c.exec_command(cmd, timeout=90)
|
|
print(o.read().decode("utf-8", "replace"))
|
|
print(e.read().decode("utf-8", "replace")[:500])
|
|
c.close()
|