Spaces:
Sleeping
Sleeping
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" |