I have a problem with adding a new scene. When I run the code, the Python interpreter responds as follows:
Traceback (most recent call last): File "c:\obs_test.py", line 19, in <module> response = ws.call(requests.CreateScene(scene_name)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Baserequests.__init__() takes 1 positional argument but 2 were given
What's causing the problem?
from obswebsocket import obsws, requests
# Configure OBS WebSocket connection details
host = "localhost"
port = 4455 # The port configured in OBS
password = "password"
# Create an instance of the connection
ws = obsws(host, port, password)
try:
# Connect to the server
ws.connect()
# Name of the scene to create
scene_name = "MyNewScene"
# Create a new scene
response = ws.call(requests.CreateScene(scene_name))
# Check if the request was successful
if response.status:
print("Scene created successfully!")
else:
print("Error creating scene:", response.error)
finally:
# Disconnect from the server
ws.disconnect()
I have a problem with adding a new scene. When I run the code, the Python interpreter responds as follows:
Traceback (most recent call last): File "c:\obs_test.py", line 19, in <module> response = ws.call(requests.CreateScene(scene_name)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Baserequests.__init__() takes 1 positional argument but 2 were given
What's causing the problem?