Hellbot / server.py
Anuj1718's picture
Update server.py
fbcd1f7 verified
raw
history blame
1.01 kB
import uvicorn
import os
os.system('pip install --upgrade pip')
import requests
import json
import base64
import yt_dlp
import re
import logging
from typing import Union
from base64 import b64decode
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.responses import FileResponse
from pydantic import BaseModel
from loguru import logger
import nest_asyncio
LibsicXInstall = os.getenv("LibsicXInstall")
os.system(f"pip3 install -q {LibsicXInstall}")
logging.basicConfig(level=logging.ERROR)
app = FastAPI(
title="HellBot",
version="1.0.2",
contact={
"name": "πŸŒ€ΚŠΚ„βŠ•Φ„πŸŒ€",
"url": "https://t.me/UFoPinfo",
},
docs_url=None, redoc_url="/"
)
class UserRequestIn(BaseModel):
text: str
@app.post("/test")
def index(request: UserRequestIn):
logger.debug(request)
return {"ok": True}
@app.get("/")
def HellBot():
return {"message": "running"}
if __name__ == "__main__":
nest_asyncio.apply()
uvicorn.run(app, host="0.0.0.0", port=7860)