question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ValueError: Unable to find token seed! Did https://translate.google.com change?

See original GitHub issue

After 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:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:58 (14 by maintainers)

github_iconTop GitHub Comments

7reactions
Boudewijn26commented, Nov 11, 2020

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.

5reactions
Boudewijn26commented, Nov 10, 2020

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).

Read more comments on GitHub >

github_iconTop 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 >
gTTS-token - PyPI
Calculates a token to run the Google Translate text to speech.
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found