【问题标题】:Why might there be this error in my OBS websocket?为什么我的 OBS websocket 会出现这个错误?
【发布时间】:2022-10-15 02:34:11
【问题描述】:

只是做我发现的基本 obs WebSocket 示例。在 OBS 客户端中,它看起来像是短暂连接,但最终都出现此错误:

Exception has occurred: KeyError
'status'
  File "obswebsocket_tests.py", line 3, in <module>
    client.connect()

这是我的代码:

import obswebsocket, obswebsocket.requests
client = obswebsocket.obsws("localhost", 4444)
client.connect()
v = client.call(obswebsocket.requests.GetVersion()).getObsWebsocketVersion()

print(v)

client.disconnect()

这是我的 OBS 客户端视图:

【问题讨论】:

    标签: python websocket obs


    【解决方案1】:

    the obs-websocket-py library (0.5.3) 的最新版本是 2020 年 12 月 20 日。
    OBS 28 版于 2022 年 8 月 3 日发布,附带新的 WebSocket 插件版本 5。

    来自their blog post

    许多现有工具将需要以前版本的 obs-websocket 4.9.1-compat 才能继续工作,直到这些工具更新为止。此版本可以与 v5 一起安装并且不会发生冲突,并且可以在您可能使用的任何工具更新到新版本后安全地在以后删除。该版本可以在发布页面上的 5.0.1 下载链接旁边找到。

    您将需要从他们的release page 单独安装 WebSocket 插件的第 4 版。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-04
      • 2020-02-03
      • 1970-01-01
      • 1970-01-01
      • 2020-02-16
      • 2013-12-30
      • 1970-01-01
      相关资源
      最近更新 更多