Open REDS1736 opened 1 year ago
Same here!
SetFilenameFormatting gets me a "takes 1 positional argument but 2 were given" and GetFilenameFormatting gets me a "request call failed"
Here is my code:
from obswebsocket import obsws, requests
client = obsws("localhost", 4455)
client.connect()
print(client.call(requests.GetFilenameFormatting()))
client.call(requests.SetFilenameFormatting("TESTNAME"))
print(client.call(requests.GetFilenameFormatting()))
client.call(requests.StartRecording())
client.disconnect()
Edit: Looking at the Requests Protocol sheet I managed to find the new way (v5) of formatting the request for the recording part (StartRecording -> StartRecord). Unfortunately I did not find the new way of manipulating the filename formatting. I will continue to search.
Also getting similar when using SetSceneItemRender (in legacy v4 mode)...
Baserequests.__init__() takes 1 positional argument but 3 were given
With the new version of obs-websocket-py you need to explicitly name parameters, e.g.:
requests.SetFilenameFormatting(**{'filename-formatting': 'TESTNAME'})
(yes, you need to use dictionary unpacking, since the key contains -
)
And looks like the V5 doesn't have a way to set filename formatting
SetSceneItemRender
See keywords here: https://github.com/obsproject/obs-websocket/blob/4.x-compat/docs/generated/protocol.md#setsceneitemrender, and use the same dictionary unpacking trick.
SetSceneItemRender
See keywords here: https://github.com/obsproject/obs-websocket/blob/4.x-compat/docs/generated/protocol.md#setsceneitemrender, and use the same dictionary unpacking trick.
Ah, thanks. I did think a bit after commenting and some reading that it might be the parameter names... but didn't know about dictionary unpacking, so thanks for that :)
@Elektordi would it be possible to restore the old behavior, when kwargs with _
were converted to dashed ones?
Executing
requests.SetRecordDirectory('C:/Users/REDS1736/Desktop')
results in the following error:I already tried giving the desired path as a keyword (
requests.SetRecordDirectory(recordDirectory='C:/Users/REDS1736/Desktop')
; i guessed the name of the keyword using this official piece of OBS docs: https://github.com/obsproject/obs-websocket/blob/master/docs/generated/protocol.md#setrecorddirectory), but that just gives me a new error:I suppose, the keyword i use is wrong but i can't find the right one.