Update main.py

This commit is contained in:
Aira Catapang
2026-03-18 11:50:57 +00:00
committed by system
parent c8e677c025
commit c8f6631287

11
main.py
View File

@@ -717,6 +717,17 @@ async def hls_proxy(url: str, request: Request):
return StreamingResponse(stream_generator(), media_type="video/MP2T")
# 🔥 YOUR PRIVATE PROXY ROUTE 🔥
@app.get("/proxy-mapper")
async def proxy_mapper(url: str):
"""Proxies requests to the mapper API to bypass CORS"""
try:
async with httpx.AsyncClient(timeout=15, follow_redirects=True) as client:
resp = await client.get(url)
return resp.json()
except Exception as e:
return {"error": str(e)}
if __name__ == "__main__":
import uvicorn