Spaces:
Paused
Paused
| from fastapi import FastAPI, Query, HTTPException | |
| from app.utils import bypass_shinigami | |
| app = FastAPI() | |
| async def root(): | |
| return {"message": "API Aktif"} | |
| 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 | |