from fastapi import FastAPI, Query, HTTPException from app.utils import bypass_shinigami app = FastAPI() @app.get("/") async def root(): return {"message": "API Aktif"} @app.get("/bypass") async def bypass( url: str = Query( ..., description="URL Shinigami yang mau dibypass", example="https://shinigami.link/xxxx" ) ): url = url.strip() if not url or not url.startswith("http"): raise HTTPException(status_code=400, detail="URL tidak valid") result = bypass_shinigami(url) if result.get("status") != "success": raise HTTPException(status_code=502, detail=result.get("message", "Unknown error")) return result