Elektordi / obs-websocket-py

Python library to communicate with an obs-websocket server (for OBS Studio)
MIT License
237 stars 59 forks source link

Samples do not work after install. #59

Closed LinuxIsCool closed 3 years ago

LinuxIsCool commented 3 years ago

pip install obs-websocket-py python samples/events.py

Traceback (most recent call last):
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/obswebsocket/core.py", line 68, in connect
    self.ws.connect("ws://{}:{}".format(self.host, self.port))
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/websocket/_core.py", line 222, in connect
    self.sock, addrs = connect(url, self.sock_opt, proxy_info(**options),
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/websocket/_http.py", line 121, in connect
    sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/websocket/_http.py", line 201, in _open_socket
    raise err
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/websocket/_http.py", line 176, in _open_socket
    sock.connect(address)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "events.py", line 29, in <module>
    ws.connect()
  File "/home/shawn/.virtualenvs/TEC/lib/python3.8/site-packages/obswebsocket/core.py", line 73, in connect
    raise exceptions.ConnectionFailure(str(e))
obswebsocket.exceptions.ConnectionFailure: [Errno 111] Connection refused

I'm on Pop!_OS 20.10 python3.8 as you can see.

OBS 26.1.1 which is running and recording as I run the script.

Thank you! It will be awesome to have ws access to OBS.

Elektordi commented 3 years ago

Hello, it seems you have not enabled the websocket server in your OBS. Did you installed the plugin?

If yes, you should find the "Websocket" options in the "Tools" menu. If you have it, check that the server is enabled.

If not, you can download it there: https://github.com/Palakis/obs-websocket/releases Or there: https://obsproject.com/forum/resources/obs-websocket-remote-control-obs-studio-from-websockets.466/

Elektordi commented 3 years ago

No answer, closing the issue. Feel free to open it again if the problem persists.