Skip to content

Commit

Permalink
Workaround 'unable to find token seed' exception
Browse files Browse the repository at this point in the history
  • Loading branch information
3ter committed Nov 5, 2020
1 parent 435bbdc commit b005552
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion chinese/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,15 @@ def download(self):

def get_google(self):
tts = gTTS(self.text, lang=self.lang)
tts.save(self.path)
# Code inserted from https://github.com/pndurette/gTTS/issues/232
count=1
while True:
try:
tts.save(self.path)
break
except:
print('got the issue from https://github.com/luoliyan/chinese-support-redux/issues/161 '+str(count) + ' times.')
count+=1

def get_baidu(self):
query = {
Expand Down

0 comments on commit b005552

Please sign in to comment.