Spaces:
Paused
Paused
Update app.py
Browse files1234567112 unmodified lines1201211221231241251269 unmodified lines13613713813914014114227 unmodified lines17017117217317417517617717 unmodified lines195196197198199200201from fastapi import FastAPIfrom fastapi.responses import JSONResponsefrom fastapi import Request, Responsefrom fastapi.templating import Jinja2Templates # Added for rendering HTML templatesimport jsonimport requestsimport canais112 unmodified linesfor canal in list_canais:canal.pop('streams')if id in canal['genres']:canais_.append(canal)return JSONResponse(content={"metas": canais_})9 unmodified linesfor canal in list_canais:canal.pop('streams')canais_.append(canal)return JSONResponse(content={"metas": canais_})else:return JSONResponse(content={"metas": []})27 unmodified lineshost = request.client.hostserver = f'https://{host}/logo?url=' if not ('localhost' in host or '127.0.0.1' in host) else f'http://{host}/logo?url='if type == 'tv':scrape_ = []list_canais = canais.canais_list(server)for canal in list_canais:if canal['id'] == id:17 unmodified lines}}}]except:scrape_ = []return JSONResponse(content={"streams": scrape_})1234567112 unmodified lines1201211221231241251269 unmodified lines13613713813914014114227 unmodified lines17017117217317417517617717817 unmodified lines196197198199200201202from fastapi import FastAPIfrom fastapi.responses import JSONResponsefrom fastapi import Request, Responsefrom fastapi.templating import Jinja2Templatesimport jsonimport requestsimport canais112 unmodified linesfor canal in list_canais:canal.pop('streams')if id in canal['genres']:canais_.append(canal)return JSONResponse(content={"metas": canais_})9 unmodified linesfor canal in list_canais:canal.pop('streams')canais_.append(canal)return JSONResponse(content={"metas": canais_})else:return JSONResponse(content={"metas": []})27 unmodified lineshost = request.client.hostserver = f'https://{host}/logo?url=' if not ('localhost' in host or '127.0.0.1' in host) else f'http://{host}/logo?url='scrape_ = []if type == 'tv':list_canais = canais.canais_list(server)for canal in list_canais:if canal['id'] == id:17 unmodified lines}}}]except Exception as e:scrape_ = []return JSONResponse(content={"streams": scrape_})
app.py+6-5