Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requests.exceptions.HTTPError: 403 Client Error: #32

Closed
arsanious opened this issue May 10, 2016 · 19 comments
Closed

requests.exceptions.HTTPError: 403 Client Error: #32

arsanious opened this issue May 10, 2016 · 19 comments

Comments

@arsanious
Copy link

This used to work, but started failing all of a sudden.

Traceback (most recent call last):
  File "simple.py", line 29, in <module>
    tts.save(CLIP_NAME)
  File "/usr/lib/python2.7/site-packages/gtts/tts.py", line 94, in save
    self.write_to_fp(f)
  File "/usr/lib/python2.7/site-packages/gtts/tts.py", line 118, in write_to_fp
    r.raise_for_status()
  File "/usr/lib/python2.7/site-packages/requests/models.py", line 840, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden for url: https://translate.google.com/translate_tts?q=hello&tl=en&client=t&textlen=5&idx=0&total=1&ie=UTF-8&tk=295461.176510
@nihal111
Copy link

Found the same issue. When I ran this today.

@jakejdavis
Copy link

Me too

@ignalex
Copy link

ignalex commented May 11, 2016

same

@emanuelioanmuraru
Copy link

Same, what did Google change now

@mbusy
Copy link

mbusy commented May 11, 2016

Same here

@rogsme
Copy link

rogsme commented May 12, 2016

I also have this problem. No fixes to this yet?

@lewisling
Copy link

Yes, I have the same problem. Tests are working fine 12 hours ago.

@rhsu0268
Copy link

Same problem here. I love this module very much. Hopefully we will get a resolution soon.

@jakejdavis
Copy link

if anyone needs anything urgent here is an online tts service that uses google translate that i think still works, the url is http://soundoftext.com, to get a sound use this http://soundoftext.com/static/sounds/en/hello_my_name_is.mp3

@pndurette
Copy link
Owner

Seems Google changed something.. Sigh. Will have to look at it. Hopefully
we can recover from this one.

On Wed, May 11, 2016 at 8:47 PM, Azita MIND Service <
notifications@github.com> wrote:

Yes, I have the same problem. Tests are working fine 12 hours ago.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#32 (comment)

Pierre Nicolas Durette
(647) 871-3274 | pndurette@gmail.com
http://www.pierre-nick.com

@arsanious
Copy link
Author

so this works
http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-gb

this (from the gTTS api) doesn't
https://translate.google.com/translate_tts?q=hello&tl=en&client=t&textlen=5&idx=0&total=1&ie=UTF-8&tk=295461.176510

@ignalex
Copy link

ignalex commented May 12, 2016

thanks arsanious for the links.
if replacing

client=t

in the gTTS link with

client=tw-ob

it works (for me).
btw strange thing = the voice is slightly different .

On 13 May 2016 at 02:48, arsanious notifications@github.com wrote:

so this works

http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-gb

this (from the gTTS api) doesn't

https://translate.google.com/translate_tts?q=hello&tl=en&client=t&textlen=5&idx=0&total=1&ie=UTF-8&tk=295461.176510


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#32 (comment)

@ignalex
Copy link

ignalex commented May 12, 2016

this fixed it:
in tts.py
line 105
change to
'client' : 'tw-ob',

and sexy google voice is back.
although don't know if the solution would work for everybody and / or
permanent.
looks google guys monitor IPs from which requests been sent (maybe
considering client?) and block (for a client?)

On 13 May 2016 at 06:17, Alexander Ignatov ignalex@gmail.com wrote:

thanks arsanious for the links.
if replacing

client=t

in the gTTS link with

client=tw-ob

it works (for me).
btw strange thing = the voice is slightly different .

On 13 May 2016 at 02:48, arsanious notifications@github.com wrote:

so this works

http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-gb

this (from the gTTS api) doesn't

https://translate.google.com/translate_tts?q=hello&tl=en&client=t&textlen=5&idx=0&total=1&ie=UTF-8&tk=295461.176510


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#32 (comment)

@pndurette
Copy link
Owner

I had to do that in the past, I remember. Thanks so much for finding this!
Will made and test the change shortly.

On Thu, May 12, 2016 at 5:05 PM, Alex notifications@github.com wrote:

this fixed it:
in gtts.py
line 105
change to
'client' : 'tw-ob',

and sexy google voice is back.
although don't know if the solution would work for everybody and / or
permanent.
looks google guys monitor IPs from which requests been sent (maybe
considering client?) and block (for a client?)

On 13 May 2016 at 06:17, Alexander Ignatov ignalex@gmail.com wrote:

thanks arsanious for the links.
if replacing

client=t

in the gTTS link with

client=tw-ob

it works (for me).
btw strange thing = the voice is slightly different .

On 13 May 2016 at 02:48, arsanious notifications@github.com wrote:

so this works

http://translate.google.com/translate_tts?ie=UTF-8&total=1&idx=0&textlen=32&client=tw-ob&q=hello&tl=En-gb

this (from the gTTS api) doesn't

https://translate.google.com/translate_tts?q=hello&tl=en&client=t&textlen=5&idx=0&total=1&ie=UTF-8&tk=295461.176510


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#32 (comment)


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#32 (comment)

Pierre Nicolas Durette
(647) 871-3274 | pndurette@gmail.com
http://www.pierre-nick.com

@nihal111
Copy link

nihal111 commented May 12, 2016

@pndurette Why did you revert to client=t from client=tw-ob ? Does google keep this link changing?

@pndurette
Copy link
Owner

As I remember it that argument had to be equal to something else before.

Pierre Nick Durette
Sent from mobile

On May 12, 2016, at 5:47 PM, Nihal Singh notifications@github.com wrote:

@pndurette Why did you revert to client=t from `client=tw-ob'? Does google keep this link changing?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@BrunoKruz
Copy link

I made the change in the client parameter and now are working again.

@pndurette
Copy link
Owner

Thanks @arsanious, @ignalex and everyone for reporting and especially finding the solution so quickly. Releasing a new version with the fix. Will report once it's out.

@pndurette
Copy link
Owner

gtts 1.1.5 was released to PyPi! Changelog 😄

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests