the code below saves the audio file from google translate text to speech engine. It used to work (in 2014) but now the robot/human verification picture-text stops it. Is there a way to solve it?
import urllib2
url = "http://translate.google.com/translate_tts?tl=en&q=hello"
request = urlib2.Request(url)
request.add_header('User-agent','Mozilla/5.0')
opener = urllib2.build_opener()
f = open('out.mp3',"wb")
f.write(opener.open(request).read())
When I enter the link directly in the internet browser, I face the picture verification. One time verification doesn't bring it anymore. But still the python code brings up error message
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 503: Service Unavailable
http error 302 was also there before.