Code Monkey home page Code Monkey logo

Comments (9)

zlargon avatar zlargon commented on August 22, 2024 8

Google might change the way to store the key. I will take a look. Thanks.

from google-tts.

zlargon avatar zlargon commented on August 22, 2024 4

The original way the library get the secret token key from the google website cannot 100% guarantee success now.
After doing some testing, I decided to add a retry mechanism into the code. The latest version 0.0.5 should work fine.

I plan to re-write the project to handle this issue in another efficient way: caching the token key so that we don't have to fetch the token key every time. I also plan to add some new features, such as supporting long text input. It will be expected to have some breaking changes.

Thanks.

from google-tts.

horihiro avatar horihiro commented on August 22, 2024 2

There are two patterns for Google Translate page URL ( https//translate.google.com ) contents and the contents sometime doesn't contain TKK parameter. This is why Error: get key failed from google happens.

Google might is introducing new process about TTS into Google Translate
# In my short investigation, the pattern which doesn't contain the parameter offers base64 encoded mp3 data, not URL.

But @timothydillan found that we can play TTS mp3 URL without the TKK parameter like a following mp3 URL currently.
https://translate.google.com/translate_tts?ie=UTF-8&client=something&tl=en&q=Hello

horihiro/esp8266-google-tts#10 (comment)

from google-tts.

horihiro avatar horihiro commented on August 22, 2024 2

Please try client=tw-ob in query parameters.
# This API also might be blocked :(

from google-tts.

zlargon avatar zlargon commented on August 22, 2024 1

The approach #33 (comment) by @horihiro has been implemented in PR #37 by @freddiefujiwara.
It has been released in version 0.0.6.

Thank you all. 🎉

from google-tts.

gavwin avatar gavwin commented on August 22, 2024

I've also been using this package for a while now and am experiencing the same error.

from google-tts.

zlargon avatar zlargon commented on August 22, 2024

@horihiro Wow, it's really cool that we can access the URL without a token key! Thank you for your investigation. It's really informative.
I also notice that google translate is changing the website recently, and they are adding some new mechanism to prevent someone from abusing the APIs. Not very sure what will happen next, but we will see, haha.

Our systems have detected unusual traffic from your computer network. Please try your request again later.
Why did this happen?

IP address: xxx.xxx.xxx.xxx
Time: 2020-11-08T09:12:16Z
URL: https://translate.google.com/translate_tts?ie=UTF-8&client=something&tl=en&q=Hello

from google-tts.

solyarisoftware avatar solyarisoftware commented on August 22, 2024

@horihiro thanks, even if I fair this is dangerous:
https://stackoverflow.com/questions/32053442/google-translate-tts-api-blocked

This answer no longer works consistently. Your ip address will be blocked by google temporarily if you abuse this too much.

from google-tts.

horihiro avatar horihiro commented on August 22, 2024

Hmm, In my environment, the following url can be downloaded.
https://translate.google.com/translate_tts?ie=UTF-8&q=mi%20chiamo%20Giorgio&tl=it&client=tw-ob

from google-tts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.