A robot that scrapes MP3s from a website, and transcribes them using the Google Text-to-Speech API.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
649 B

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()