File size: 697 Bytes
6b4cdc0
 
 
 
96aaa55
 
 
 
 
 
 
6b4cdc0
 
 
 
 
 
 
 
 
 
9719550
 
 
96aaa55
ddcaf67
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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"