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

28 lines
767 B
Python

# -*- coding: utf-8 -*-
import json
import subprocess
def main():
for idx in range(1, 8):
name = f"douyinweb-neko-{idx}"
py = (
"import json,urllib.request\n"
"tabs=json.loads(urllib.request.urlopen('http://127.0.0.1:9222/json/list',timeout=4).read().decode())\n"
"for t in tabs:\n"
" if t.get('type')=='page':\n"
" print((t.get('url') or '')[:140])\n"
)
p = subprocess.run(
["docker", "exec", name, "python3", "-c", py],
capture_output=True,
text=True,
timeout=20,
)
print("===", name, "===")
print((p.stdout or p.stderr or "").strip() or "(no tabs)")
if __name__ == "__main__":
main()