import httplib import sys import time # USE THIS EXACT KEY, NOT YOUR OWN key = 'AIzaSyCnl6MRydhw_5fLXIdASxkLJzcJh5iX0M4' # from http://www.debasish.in/2014/04/attacking-audio-recaptcha-using-googles.html print '[+] Sending clean file to Google voice API' f = open('hello_44100.flac') data = f.read() f.close() url = '/speech-api/v2/recognize?output=json&lang=en-US&key='+key print "\n\n=================================" print "Trying "+url google_speech = httplib.HTTPConnection('www.google.com') google_speech.request('POST',url,data,{'Content-type': 'audio/x-flac; rate=44100'}) print google_speech.getresponse().read() google_speech.close()