44 lines
1.5 KiB
Python
44 lines
1.5 KiB
Python
#!/usr/bin/env python3
|
|
"""Inspect live-map entries for nomad vlog channels on dy."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import sys
|
|
import urllib.request
|
|
import http.cookiejar
|
|
|
|
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=30, allow_agent=False, look_for_keys=False)
|
|
cmd = r"""
|
|
cd /opt/douyinWEB/backend
|
|
./.venv/bin/python - <<'PY'
|
|
import asyncio, json
|
|
from app import youtube_live
|
|
|
|
async def main():
|
|
m = await youtube_live.build_live_map(force=True)
|
|
entries = m.get('entries') or {}
|
|
print('entry_count', len(entries), 'built_at', m.get('built_at') or m.get('updated_at'))
|
|
for k,v in entries.items():
|
|
blob=json.dumps(v, ensure_ascii=False)
|
|
if 'nomad' in blob.lower() or 'UCtVf' in blob or 'UCO9w' in blob or 'e8154893' in blob or 'cbc11265' in blob:
|
|
print('\nKEY', k)
|
|
print(json.dumps(v, ensure_ascii=False, indent=2)[:1200])
|
|
# also print all is_live true
|
|
print('\n=== ALL LIVE ===')
|
|
for k,v in entries.items():
|
|
if v.get('is_live'):
|
|
print(k, 'src=', v.get('source'), 'title=', (v.get('title') or '')[:40], 'gid=', v.get('assign_group_id'), 'cid=', v.get('channel_id') or v.get('youtube_channel_id'))
|
|
|
|
asyncio.run(main())
|
|
PY
|
|
"""
|
|
_i,o,e=c.exec_command(cmd, timeout=180)
|
|
print(o.read().decode())
|
|
print(e.read().decode()[:1500])
|
|
c.close()
|