azuse / youtube-streaming-translator-python

实时翻译油管直播,不知道怎么优化,闲置中
GNU General Public License v3.0
105 stars 16 forks source link

local variable 'responses' referenced before assignment #7

Open Arcelibs opened 1 year ago

Arcelibs commented 1 year ago

第一次使用,串的是Google翻譯的API

image

Arcelibs commented 1 year ago

我嘗試在for response in responses: 上一行加入了responses = 0 雖然能避免錯誤,但又出現了新的問題

172.16.5.66 - - [19/Sep/2022 12:58:50] "GET / HTTP/1.1" 200 - Traceback (most recent call last): File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\gevent\pywsgi.py", line 999, in handle_one_response self.run_application() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\geventwebsocket\handler.py", line 75, in run_application self.run_websocket() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\geventwebsocket\handler.py", line 52, in run_websocket list(self.application(self.environ, lambda s, h, e=None: [])) File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2548, in call return self.wsgi_app(environ, start_response) File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_sockets.py", line 40, in call handler, values = adapter.match() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\werkzeug\routing\map.py", line 622, in match raise WebsocketMismatch() from None werkzeug.routing.exceptions.WebsocketMismatch: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. 2022-09-19T04:58:50Z {'REMOTE_ADDR': '172.16.5.66', 'REMOTE_PORT': '54366', 'HTTP_HOST': '172.16.5.66:5001', (hidden keys: 30)} failed with WebsocketMismatch

Traceback (most recent call last): File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\gevent\pywsgi.py", line 999, in handle_one_response self.run_application() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\geventwebsocket\handler.py", line 75, in run_application self.run_websocket() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\geventwebsocket\handler.py", line 52, in run_websocket list(self.application(self.environ, lambda s, h, e=None: [])) File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\flask\app.py", line 2548, in call return self.wsgi_app(environ, start_response) File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\flask_sockets.py", line 40, in call handler, values = adapter.match() File "C:\Users\user01\AppData\Local\Programs\Python\Python310\lib\site-packages\werkzeug\routing\map.py", line 622, in match raise WebsocketMismatch() from None werkzeug.routing.exceptions.WebsocketMismatch: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand. 2022-09-19T04:58:50Z {'REMOTE_ADDR': '172.16.5.66', 'REMOTE_PORT': '54367', 'HTTP_HOST': '172.16.5.66:5002', (hidden keys: 30)} failed with WebsocketMismatch

azuse commented 1 year ago

上面timeout了吧,确认下全局代理能不能正常连接到谷歌服务