-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to google API when using recognize_google() #830
Comments
I searched the repositories of SpeechRecognition and yt-dlp with the error message "Unable to connect Google API", but I couldn't find it @Unknownuserfrommars Try except Exception as e:
- st.error(f"Error reading video: {str(e)}")
+ st.error(f"Error reading video: {repr(e)}") Also please paste the entire stacktrace. |
It worked? Video URL: https://www.youtube.com/watch?v=zm6F0vo2E64 ![]() |
Okay thanks for your reply @ftnext I will take a look at it shortly. (And yes |
Also, that URL did not work for me. Actually, NO URL works for me (both Youtube and Bilibili URLs (which i hope china's video platform might give me a result but no). I don't actually know why. Because I'm hosting this app so it fails only on me? |
Steps to reproduce
My code
I used yt-dlp and some processessing and let SR recognize the text, but when i tried to call recognize_google(), an errored occured:
Error reading video: Unable to connect Google API
Specifically, in this line of code.
Somehow, this error passed my try...except block for sr.UnknownValueError and sr.RequestError. Instead, it went to the end of the major try-except block starting from L277.
Was it my connection? But i double and triple-checked everything. Network no issue for me
Btw, as a reference, the link to my project is: https://lightningroute-fe.streamlit.app/
Expected behaviour
Recognize the audio and turn into text
Actual behaviour
Error
(This is hosted by streamlit, so i used a st.error() to display the error message instead of in the terminal)
System information
(Delete all the statements that don't apply.)
My system is Windows 11 24H2 (x64).
My Python version is 3.12.9 (In Streamlit Cloud).
My Pip version is Don't know, Streamlit Cloud doesn't have a interactive shell. (You can check this by running
pip -V
.)My SpeechRecognition library version is 3.14.1.
My PyAudio library version is I don't have PyAudio installed.
The text was updated successfully, but these errors were encountered: