Google Colab • lncrawl • port 7860

📚 LightNovel Crawler — Colab Server

Paste the cell below into Colab and run. Default login admin / admin.

0. Install first (one-time cell)

!pip -q install lncrawl

1. Start server cell

# @markdown <font size=5 color="yellow"> ⬅️ Click Here to start the server</font>
import subprocess, threading, time, socket

PORT = 7860

proc = subprocess.Popen(
    ["python", "-m", "lncrawl", "-ll", "server", "--host", "0.0.0.0", "--port", str(PORT)],
    stdout=subprocess.PIPE,
    stderr=subprocess.STDOUT,
)

def consume_logs():
    for _ in proc.stdout:
        pass
threading.Thread(target=consume_logs, daemon=True).start()

def is_port_open(port, host="127.0.0.1"):
    try:
        with socket.create_connection((host, port), timeout=1):
            return True
    except OSError:
        return False

# Wait until port is actually open (max 60s)
steps = ["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]
i = 0
for _ in range(120):
    print(f"\r{steps[i % len(steps)]} Starting lncrawl server...", end="", flush=True)
    if is_port_open(PORT):
        break
    time.sleep(0.5)
    i += 1
else:
    print("\r❌ Server failed to start. Check if port is in use.")
    proc.kill()
    raise SystemExit

from google.colab.output import eval_js
url = eval_js(f"google.colab.kernel.proxyPort({PORT})")

print("\r" + " " * 40)
print("━" * 50)
print("  📚  LightNovel Crawler — Server Ready")
print("━" * 50)
print(f"  🌐  URL   : {url}")
print(f"  👤  User  : admin")
print(f"  🔑  Pass  : admin")
print("━" * 50)
print("  ⚠️  Session ends when Colab disconnects. KEEP THIS TAB OPEN UNTIL YOU FINISH!!")
print("━" * 50)
⚠️ Keep the Colab tab open — closing it kills the server. Change admin/admin if exposed publicly.