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.

requests.exceptions.HTTPError: 403 Client Error:

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ignalexcommented, 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 https://github.com/pndurette/gTTS/issues/32#issuecomment-218817052

1reaction
pndurettecommented, May 13, 2016

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

"requests.exceptions.HTTPError: 403 Client Error: Forbidden ...
I want to implement a system using Method #1. I'm just wondering what to do differently to make that happen. The fact that...
Read more >
HTTP Error 403 Forbidden: What It Means and How to Fix It
The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it...If authentication credentials ...
Read more >
HTTPError: 403 Client Error: · Issue #738 - GitHub
I get a request error and I do not know why. ... of the following error: HTTPError('403 Client Error: Forbidden for ... requests.exceptions....
Read more >
403 Client Error-- access to pexternal payment provider raise ...
HTTPError : 403 Client Error-- access to pexternal payment provider raise errors. In my current project i use a payment provider that use...
Read more >
Getting requests.exceptions.HTTPError ... - Infura Community
The error seems to point to the python package's requests.models. The same test was passed once on goerli, but it keeps getting HTTPError...
Read more >

github_iconTop Related Medium Post

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