zaf / asterisk-googletts

Asterisk AGI script that uses Google's translate text to speech service.
GNU General Public License v2.0
214 stars 125 forks source link

Command Line. Failed to fetch speech data. at /usr/bin/googletts-cli.pl line 126. #24

Closed jeetzz closed 6 years ago

jeetzz commented 8 years ago

Hi,

Getting an error "Failed to fetch speech data. at /usr/bin/googletts-cli.pl line 126." since few days. Just wondering if there's any update that would be coming in soon?

Thanks for your help.

floresnestor commented 8 years ago

try this:

Initialise User angent

my $ua = LWP::UserAgent->new(ssl_opts => { _verifyhostname => 1 });

Initialise User angent

my $ua = LWP::UserAgent->new(ssl_opts => { _verifyhostname => 0 });

On Tue, Dec 29, 2015 at 5:57 PM, chuckycharms notifications@github.com wrote:

Failed to fetch speech data: 403Forbidden at ./googletts-cli.pl line 134.

— Reply to this email directly or view it on GitHub https://github.com/zaf/asterisk-googletts/issues/24#issuecomment-167876200 .

macw73 commented 8 years ago

same here...

perl /usr/src/asterisk-googletts/cli/googletts-cli.pl -l de -t "HalloHallo" -o test.wav Failed to fetch speech data: 403Forbidden at /usr/src/asterisk-googletts/cli/googletts-cli.pl line 134.

changing to _verifyhostname => 0 didn't help..

thanks Markus

horus-by commented 8 years ago

I have same problem: perl /usr/src/asterisk-googletts/cli/googletts-cli.pl -l en -t "Hello" -o test.wav Failed to fetch speech data: 403Forbidden at /usr/src/asterisk-googletts/cli/googletts-cli.pl line 135.

fail url (from script)

https://translate.google.com/translate_tts?ie=UTF-8&q=Hello.&tl=en&total=1&idx=0&textlen=6&client=t&tk=870144.751337&prev=input

work url (from browser)

https://translate.google.com/translate_tts?ie=UTF-8&q=Hello.&tl=en&total=1&idx=0&textlen=6&tk=885168.766040&client=t&prev=input

locale LANG=en_US.UTF-8 LC_CTYPE="en_US.UTF-8" LC_NUMERIC="en_US.UTF-8" LC_TIME="en_US.UTF-8" LC_COLLATE="en_US.UTF-8" LC_MONETARY="en_US.UTF-8" LC_MESSAGES="en_US.UTF-8" LC_PAPER="en_US.UTF-8" LC_NAME="en_US.UTF-8" LC_ADDRESS="en_US.UTF-8" LC_TELEPHONE="en_US.UTF-8" LC_MEASUREMENT="en_US.UTF-8" LC_IDENTIFICATION="en_US.UTF-8" LC_ALL=en_US.UTF-8

May be google has changed algorithm to generate token?

zaf commented 8 years ago

That is interesting... it works here for the same string ('Hello.') with the following request:

https://translate.google.com/translate_tts?ie=UTF-8&q=Hello.&tl=en&total=1&idx=0&textlen=6&client=t&tk=950041.544499&prev=input

In the browser I get the following token: 962743.557405

3eBoP commented 8 years ago

I managed to get the script working on asterisk for few days, and then on May 11th, it stopped working giving me back the error :

AGI Rx << NOOP " -- googletts.agi: Failed to fetch file: " AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: 403" AGI Tx >> 200 result=0 AGI Rx << NOOP " -- googletts.agi: Forbidden" AGI Tx >> 200 result=0

Did google changed something ? Is there a limit for calling the script ?

zaf commented 8 years ago

Try getting the latest code, there was this fix merged a few days ago: https://github.com/zaf/asterisk-googletts/pull/30

3eBoP commented 8 years ago

Nice thanks ! I didn't noticed this update.

Is there a way to subscribe to updates like this one ?

zaf commented 8 years ago

I guess by pressing 'Watch' in the project page. Either-way when in doubt use 'git pull'

chuckycharms commented 8 years ago

Hello Zaf!

Thanks again for the work on this. The Dreaded Failed to fetch speech data error has re-surfaced. Any options for an update?

zaf commented 8 years ago

Seems to be working here, tested from 2 different hosts on 2 different networks. Does it fail on all requests, or specific ones? Are you sure you are not blocked by Google by sending too many request? Have you tried from different IPs?

chuckycharms commented 8 years ago

Thanks for the reply! This IP has not yet been used to make a request, but can't be sure if the IP is blocked or not. I have not yet tried from another IP. Is there way you have used to test this other than using a different host?

Its good news its just me, it means theres hope.