ValueError: Unable to find token seed! Did https://translate.google.com change?
See original GitHub issueAfter I send 10-15 requests, I get the following error:
Traceback (most recent call last):
File "text_to_speech.py", line 25, in <module>
text_to_speech(data)
File "text_to_speech.py", line 17, in text_to_speech
tts.save(f'audio/{key}/def-{i + 1}.mp3')
File "/home/shoaib/anaconda3/lib/python3.7/site-packages/gtts/tts.py", line 111, in save
self.write_to_fp(f)
File "/home/shoaib/anaconda3/lib/python3.7/site-packages/gtts/tts.py", line 124, in write_to_fp
'tk' : self.token.calculate_token(part)}
File "/home/shoaib/anaconda3/lib/python3.7/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
seed = self._get_token_key()
File "/home/shoaib/anaconda3/lib/python3.7/site-packages/gtts_token/gtts_token.py", line 59, in _get_token_key
"Unable to find token seed! Did https://translate.google.com change?"
ValueError: Unable to find token seed! Did https://translate.google.com change?
I thought this might be a bug in the latest release, i.e., 2.1.1 so I tried 1.2.0 and I still get the same error.
I also thought it could be that my IP address is being blocked. I read up on the Quotas & limits and I don’t think that should be an issue as well.
- Characters per request: 67 (on average), never more than the allowed 5000
- Requests per minute: never exceeds 15 since I get the error, allowed 300
System information:
- Operating System: Manjaro Linux
- Kernel: Linux 5.8.11-1-MANJARO
- Architecture: x86-64
Thank you for your timely help. ☺️ ✨
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:58 (14 by maintainers)
Top Results From Across the Web
Unable to find token seed! Did https://translate.google.com ...
I am making an assistant that uses gTTS and Google Speech but this error appears. It is fine with speech recognition ...
Read more >HA 117: Unable to find token seed! Did https://translate.google ...
Unexpected error for call_service at pos 1: Unable to find token seed! Did https://translate.google.com change?
Read more >Unable to find token seed! Did https://translate.google.com ...
Did https://translate.google.com change?" ValueError: Unable to find token seed! Did https://translate.google.com change?
Read more >Picroft using Google TTS - Mycroft Community Forum
TTS execution failed (ValueError('Unable to find token seed! Did https://translate.google.com change?')) Does mycroft try to translate the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, that pull request has now been merged, so the url is https://github.com/Boudewijn26/gTTS-token/blob/master/docs/november-2020-translate-changes.md#ladies-and-gentlemen-weve-got-him. What’s perhaps more interesting is what’s going on in https://github.com/Boudewijn26/gTTS. Apart from the lookup of locales, I’ve pretty much gotten it working. I think you can expect a pull request by tomorrow. All in all this wasn’t as bad as I was expecting, so I’m pretty relieved.
To add to this discussion: I, as maintainer of gTTS-token, also intent to look into this further in order to, if possible, ensure compatibility with the new changes Google is rolling out. This has been complicated by the simple fact I haven’t received the new Google Translate yet. It’s not at all uncommon for larger corporations to roll out changes gradually and that indeed appears to be happening here. We don’t have any insight into which regions get this new “feature” first, so we’ll just have to wait for now.
That being said, this is an undocumented API, so we really can’t blame Google for changing this without notice. For what I gather Google has turned a blind eye towards this whole thing. It wouldn’t be too difficult for them to obfuscate the API to such an amount it’d be tremendously difficult to reverse engineer, which is something they haven’t done (yet?) in the many years these projects exist.
As stated, should this problem persist, everyone is free to comment on https://github.com/Boudewijn26/gTTS-token/issues/20 or raise a new issue there (or continue the discussion here, I suppose).