kenanEkici / pepper-google-assistant

Customized SDK Google Assistant sample for the Pepper humanoid robot with Flask and PYNAOqi
Apache License 2.0
12 stars 3 forks source link

Speech Recognition and Synthesis - Customer Demo Proxy to Google Cloud APIs - How are you using/doing it? #7

Open ochen1 opened 3 years ago

ochen1 commented 3 years ago

Hello! I'd be interested in how you can perform the speech recognition for the bot.

I see you used the endpoint https://cxl-services.appspot.com/proxy?url=https%3A%2F%2Fspeech.googleapis.com%2Fv1p1beta1%2Fspeech%3Arecognize

How does this work? Is Google Cloud basically offering their features for free through this proxy?

I also found this proxy, and Googling the link lead me to this line in your file: https://github.com/kenanEkici/pepper-google-assistant/blob/master/webserver.py#L92

I found out that Google uses that proxy for a demo, but that demo requires the completion of a captcha, after which grants your IP to a ≈4h whitelist for using the proxy. Is this consistent with your results?

How are you doing this without completing captchas every 4 hours?

In addition, does this mean that we can create another proxy where there is a Selenium webscraping bot that uses a Buster-like technique to automatically complete the captcha every four hours (I can make that happen)? This means the IP of the proxy will always be whitelisted, so we can allow the entire world to synthesize text through the proxy, without paying for Google Cloud services.

Any contact would be greatly appreciated!

kenanEkici commented 3 years ago

Hi, thank you for your interest in the repository!

At the time of development I found out that you could use the proxy for free (without captcha to my recollection). I had similar intentions, that is using the TTS service for free without having to pay for the Google Cloud services. Certainly when I was not using it for commercial reasons. On Google bug report I had asked whether or not this was a bug and whether it was allowed to use the service this way. I cannot remember exactly what the response was but they certainly said it was allowed. I do remember though that there was a request/size limit (+-20-30 requests per hour). Your workaround for the captcha seems fine. Just be careful though when you want to distribute the service because there might be legal consequences of doing so. I would recommend you to check with Google support.

If there are any other questions feel free to ask.

ochen1 commented 3 years ago

Hello! I have another update.

I've found that Google IP-tempbans you for the rest of the day whenever you send more requests than a certain threshold over the course of a day.

I guess they don't want to ban peoples' IP addresses forever just because of someone having control over their network (eg. via an IP-sharing protocol).

It's pretty cool though before you get banned! I made a bot that speaks the Google Meet chat and feeds audio into the Meet.

Thank you for your knowledge.