SPACERUNNER99 commited on
Commit
4d6cec9
·
verified ·
1 Parent(s): a9e5f93

Update dub.py

Browse files
Files changed (1) hide show
  1. dub.py +4 -1
dub.py CHANGED
@@ -16,6 +16,9 @@ API_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeXN0ZW0iOiJzYWhhYiIsImNyZWF0
16
 
17
  def generate_tts_audio(persian_text, output_file):
18
  api_url = "https://partai.gw.isahab.ir/TextToSpeech/v1/speech-synthesys"
 
 
 
19
  headers = {
20
  'Content-Type': 'application/json',
21
  'gateway-token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeXN0ZW0iOiJzYWhhYiIsImNyZWF0ZVRpbWUiOiIxNDAzMTIwNTE0MTgzMDM2MyIsInVuaXF1ZUZpZWxkcyI6eyJ1c2VybmFtZSI6IjFlZDZjN2M1LWVjNTktNGI4Yi1iYThkLTk1NTk1ZWQ0MmNhMCJ9LCJkYXRhIjp7InNlcnZpY2VJRCI6ImRmNTNhNzgwLTIxNTgtNDUyNC05MjQ3LWM2ZjBiYWQzZTc3MCIsInJhbmRvbVRleHQiOiJvYlNXciJ9LCJncm91cE5hbWUiOiIwMmYzMWRmM2IyMjczMmJkMDNmYjBlYjU2ZjE1MGEzZCJ9.QakcV3rPn7bji7ur0VPmCzHLWiOs2NXEGw9ILyhpgOw'
@@ -27,7 +30,7 @@ def generate_tts_audio(persian_text, output_file):
27
  "checksum": "1",
28
  "speaker": "2"
29
  })
30
- response = requests.request("POST", api_url, headers=headers, data=payload)
31
  link = response.text.split('"')[11]
32
  link = "https://"+link
33
  print(link)
 
16
 
17
  def generate_tts_audio(persian_text, output_file):
18
  api_url = "https://partai.gw.isahab.ir/TextToSpeech/v1/speech-synthesys"
19
+ proxies = {
20
+ "http" : "http://45.131.4.222"
21
+ }
22
  headers = {
23
  'Content-Type': 'application/json',
24
  'gateway-token': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzeXN0ZW0iOiJzYWhhYiIsImNyZWF0ZVRpbWUiOiIxNDAzMTIwNTE0MTgzMDM2MyIsInVuaXF1ZUZpZWxkcyI6eyJ1c2VybmFtZSI6IjFlZDZjN2M1LWVjNTktNGI4Yi1iYThkLTk1NTk1ZWQ0MmNhMCJ9LCJkYXRhIjp7InNlcnZpY2VJRCI6ImRmNTNhNzgwLTIxNTgtNDUyNC05MjQ3LWM2ZjBiYWQzZTc3MCIsInJhbmRvbVRleHQiOiJvYlNXciJ9LCJncm91cE5hbWUiOiIwMmYzMWRmM2IyMjczMmJkMDNmYjBlYjU2ZjE1MGEzZCJ9.QakcV3rPn7bji7ur0VPmCzHLWiOs2NXEGw9ILyhpgOw'
 
30
  "checksum": "1",
31
  "speaker": "2"
32
  })
33
+ response = requests.request("POST", api_url, headers=headers, data=payload, proxies=proxies)
34
  link = response.text.split('"')[11]
35
  link = "https://"+link
36
  print(link)