vid_verse / app /functions.py
badalsahani's picture
Update app/functions.py
96aaa55
raw
history blame
697 Bytes
import os, json
import requests
API_ENDPOINT = os.environ.get("API_ENDPOINT")
TOKEN = os.environ.get("TOKEN")
headers = {
'accept': 'application/json',
'Content-Type': 'application/json',
'Authorization': f'Bearer {TOKEN}'
}
def handle_url(url, from_lang, to_lang, gender):
data = {
'url': url,
'from_lang': from_lang,
'to_lang': to_lang,
'gender': gender,
}
response = requests.post(f'{API_ENDPOINT}/synthesise_video_url', headers=headers, data=json.dumps(data))
return response.json()
def get_health():
response = requests.get(API_ENDPOINT, headers=headers)
print(response)
print(response.json())
return "TRUE"