123456789101112131415161718192021222324252627282930313233343536 |
- from fastapi import FastAPI
- from fastapi import Request
- from fastapi import Form
- import urllib
- import sys
- import os
- import codecs
- import html
- app = FastAPI()
- @app.post("/items")
- async def read_item(search_query: str = Form(...)):
- unq=html.unescape(search_query)
- # unq=search_query.decode("utf-8")
- print(unq)
- fw=codecs.open('/tmp/script.txt','w','utf-8')
- fw.write(unq)
- fw.close()
- print(search_query)
- os.chdir('/home/jared/gitlab/spokesgirl_tests/apis')
- os.system('python3.7 proc_video.py &')
- return {"item_id": "Please use Telegram to get notifications. "}
- @app.post("/tts")
- async def tts(search_query: str = Form(...)):
- return {"item_id": "Please use Telegram to get notifications. "}
- @app.get("/")
- async def root():
- return {"message": "Hello World"}
|