Spaces:
Paused
Paused
Update app.py
Browse files1 unmodified line23456789101157 unmodified lines6970717273747528 unmodified lines10410510610710810911013 unmodified lines1241251261271281291309 unmodified lines14014114214314414514617 unmodified lines16416516616716816917030 unmodified lines2012022032042052062071 unmodified linefrom fastapi.responses import JSONResponsefrom fastapi import Request, Responsefrom fastapi.templating import Jinja2Templatesimport jsonimport requestsimport canaisimport osfrom dotenv import load_dotenvload_dotenv()57 unmodified lines"idPrefixes": ["skyflix", "tt"]}@app_.get("/")async def home(request: Request):name = MANIFEST['name']28 unmodified linesexcept requests.exceptions.RequestException as e:return JSONResponse(content={"error": f"Erro ao buscar a imagem: {str(e)}"}, status_code=500)@app_.get("/manifest.json")async def manifest():return JSONResponse(content=MANIFEST)13 unmodified linesreturn JSONResponse(content={"metas": canais_})@app_.get("/catalog/{type}/{id}.json")async def catalog_route(request: Request, type: str, id: str):host = request.client.host9 unmodified lineselse:return JSONResponse(content={"metas": []})@app_.get("/catalog/{type}/skyflix/search={query}.json")async def search(type: str, query: str):catalog = catalog_search(query)17 unmodified linesreturn JSONResponse(content={"meta": {}})@app_.get("/stream/{type}/{id}.json")async def stream(request: Request, type: str, id: str):host = request.client.host30 unmodified linesreturn JSONResponse(content={"streams": scrape_})@app_.options("/{path:path}")async def options_handler(path: str):response = Response()1 unmodified line2345678957 unmodified lines67686970717228 unmodified lines10110210310410510613 unmodified lines1201211221231241259 unmodified lines13513613713813914017 unmodified lines15815916016116216330 unmodified lines1941951961971981991 unmodified linefrom fastapi.responses import JSONResponsefrom fastapi import Request, Responsefrom fastapi.templating import Jinja2Templatesimport requestsimport canaisfrom dotenv import load_dotenvload_dotenv()57 unmodified lines"idPrefixes": ["skyflix", "tt"]}@app_.get("/")async def home(request: Request):name = MANIFEST['name']28 unmodified linesexcept requests.exceptions.RequestException as e:return JSONResponse(content={"error": f"Erro ao buscar a imagem: {str(e)}"}, status_code=500)@app_.get("/manifest.json")async def manifest():return JSONResponse(content=MANIFEST)13 unmodified linesreturn JSONResponse(content={"metas": canais_})@app_.get("/catalog/{type}/{id}.json")async def catalog_route(request: Request, type: str, id: str):host = request.client.host9 unmodified lineselse:return JSONResponse(content={"metas": []})@app_.get("/catalog/{type}/skyflix/search={query}.json")async def search(type: str, query: str):catalog = catalog_search(query)17 unmodified linesreturn JSONResponse(content={"meta": {}})@app_.get("/stream/{type}/{id}.json")async def stream(request: Request, type: str, id: str):host = request.client.host30 unmodified linesreturn JSONResponse(content={"streams": scrape_})@app_.options("/{path:path}")async def options_handler(path: str):response = Response()
app.py-8