glutanimate / simple-google-tts

Use Google text-to-speech on your Linux desktop
GNU General Public License v3.0
119 stars 32 forks source link

Script not working due to Google rate limitation ("unusual traffic" message) #4

Closed introlinux closed 8 years ago

introlinux commented 8 years ago

It stopped working suddenly, this is the output: simple_google_tts es /tmp/file.txt Reading from text file. Using Google for TTS synthesis. Synthesizing virtual speech. Processing 1 out of 2 paragraphs

And that's all, no more messages and no sounds and continues running indefinitely.

glutanimate commented 8 years ago

Does this only happen when reading from a file? Have you tried passing a string to the script directly (e.g. simple_google_tts en "hello world")

If none of that works edit the script and remove the following expression in line 240:

> /dev/null 2>&1

If speak.pl produces any error messages you will be able to see them thereafter.

introlinux commented 8 years ago

Ok, it is a Google problem. This is the out of speak.pl:

line: hola qué tal sentence[0]: hola qué tal URL: http://translate.google.com/translate_tts?tl=es&q=+hola+qué+tal&total=1&idx=0&client=t Wide character in print at /usr/local/bin/speak.pl line 386, line 1. HTML response: http://www.google.com/ Our systems have detected unusual traffic from your computer network. Please try your request again later. Why did this happen? This page appears when Google automatically detects requests coming from your computer network which appear to be in violation of the Terms of Service. The block will expire shortly after those requests stop.This traffic may have been sent by malicious software, a browser plug-in, or a script that sends automated requests. If you share your network connection, ask your administrator for help — a different computer using the same IP address may be responsible. Learn moreSometimes you may see this page if you are using advanced terms that robots are known to use, or sending requests very quickly. IP address: 88.12.74.198Time: 2015-10-22T15:21:31ZURL: http://www.google.com/ We have to wait

I can use the script once a day. It's a shame, because it worked very well and I was using for a child who can not learn to read. I will use pico option, although it sounds worse :-/

glutanimate commented 8 years ago

Thanks for making me aware of the problem. I've run a few tests and I think I think I might've found a solution (53f0217aa3dd44bca3da8645a69e96be3b9b69ca). Please give the latest version a try and see if it works for you.

glutanimate commented 8 years ago

Nevermind, please disregard my last message. I thought I had fixed the problem, but it turns out my router just performed a random IP reset while I was working on the script (thus lifting the rate limitation for a brief moment). It looks like this one won't be easy to solve. I'll be keeping a look-out for a possible solution, but at the moment I can't promise I'll be able to find one. I wonder if this also affects all the other projects that are based on Google translate. In theory it should, but maybe it's worth giving these a try anyway?

introlinux commented 8 years ago

Would it be possible to add an exception and if Google rejects the translation automatically jump to pico tts?

glutanimate commented 8 years ago

Probably, but I don't think it would be worth the effort. With current limitations in place the script can perform 3 or 4 requests at most before it gets timed out by Google. That's about 1 or 2 sentences.

For the time being I think I'll just update the README with a recommendation to use the pico back-end while I figure something out about the issue with Google translate.

glutanimate commented 8 years ago

Ok, please give the latest version a try. I think I might have found a solution (be4f187c5382c34fc38ef2d110e97639bfec26b5). Seems to work fine for me so far (though I haven't performed any extensive tests, yet).

introlinux commented 8 years ago

It seems to work ok even with long texts, many many thanks. :-)

glutanimate commented 8 years ago

Awesome, great to hear that. I'll mark this issue as closed now.