mirror of
https://huggingface.co/spaces/Catapang1989/aniscrap
synced 2026-04-17 15:51:46 +00:00
Update main.py
This commit is contained in:
11
main.py
11
main.py
@@ -717,6 +717,17 @@ async def hls_proxy(url: str, request: Request):
|
|||||||
return StreamingResponse(stream_generator(), media_type="video/MP2T")
|
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__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user