irltoolkit / simpleobsws Goto Github PK
View Code? Open in Web Editor NEWA simple obs-websocket library in async Python for people who just want JSON output.
License: MIT License
A simple obs-websocket library in async Python for people who just want JSON output.
License: MIT License
I plan to develop a patch for streamdeck-ui to use Python library for obs-websocket to directly communicate with OBS. streamdeck-ui is licensed under MIT.
The other Python obs-websocket libraries are licensed under MIT. Your library uses GPL which will enforce all application using your library to be under GPL as well. Please consider changing the license to LGPL or even better MIT. Then changes to the library need to be published under LGPL, but applications using the library can use whatever they like.
Docker-compose is not executing correctly because the Dockerfile is not referencing the requirements.txt file.
I have fixed to make this work and will submit a PR. @tt2468 can you label the repo with hacktoberfest
topic?
I installed the module via pip install simpleobsws
.
When I try to run the samples from https://github.com/IRLToolkit/simpleobsws/tree/master/samples it fails right away with AttributeError: module 'simpleobsws' has no attribute 'IdentificationParameters'
simpleobsws==0.0.7
with conda
on Windows x86_64.
Getting a response is incredibly unreliable for messages higher than ~2MB in size. Something relating to the incoming messages queue
Hey, it's been a while since a new release was tagged, and the license of the software has also changed in the meantime.
Please consider tagging a new release.
thanks!
This problem exists in version 1.4.0, but not in 1.3.1
Hi !,
i would like to use your software to run a certain scene in obs;
these are the scenes currently loaded in my obs:
request = simpleobsws.Request( "GetSceneList" )
"scenes": [
{
"sceneIndex": 0,
"sceneName": "Scene 5"
},
{
"sceneIndex": 1,
"sceneName": "Scene 4"
},
{
"sceneIndex": 2,
"sceneName": "Scene 3"
},
{
"sceneIndex": 3,
"sceneName": "Scene 2"
},
{
"sceneIndex": 4,
"sceneName": "Scene"
}
]
I would like to use the "set Scene Name" (or another) function to execute, for example, "Scene 5", but I don't understand the syntax of the command itself.
Can you please give me a correct example to run, through your script "sample_request.py", the execution of a certain scene, among those present in obs studio
Many thanks !
Not sure as of this exact moment the best way to handle this going forward but asyncio.get_event_loop
is deprecated starting in python 3.10.
your best bet may be to either not store self.loop in the object and use asyncio.get_running_loop
or in something like connect which seems to be the first thing one may call asyncio.get_running_loop
or better yet replace loop.create_task with asyncio.create_task
as functionally for what you are doing these are in fact the same
Hello, I'm trying to run sample_request.py
from the samples, but I can't seem to get a connection to my obs websocket.
When I run sample_request.py
this is what I see in the obs logs:
00:55:04.121: ------------------------------------------------
00:55:04.404: [obs-websocket] WSServer::start: Not locked to IPv4 bindings
00:55:04.407: [obs-websocket] server started successfully on port 4444
00:55:04.407: [obs-websocket] IO thread started.
00:55:11.581: [obs-websocket] new client connection from [::ffff:127.0.0.1]:57954
00:56:51.609: [obs-websocket] Websocket connection with client 'Unknown' closed (disconnected). Code is 1006, reason is: 'End of File'
I tried increasing the timeout
parameter to wait_until_identified
but that only caused a delay before repeating the same behavior.
Any pointers on how to debug this?
System info:
Ubuntu 20.04, using obs-websocket-4.9.1 and simpleobsws installed via pip install
which gave me version 1.3.1
In
Lines 48 to 51 in d17028a
lines 48 and 49, the var is called authResult
, but in line 51 it's referred to as authresult
(lowercase r
)
I've made this sort of mistake/typo more times than I can remember. If it helps, python's style guide suggests[1] (in large part to set a "standard" so it's easy to remember) that variables be named all lowercase, and use _
separators. In this specific case, that might be auth_result
HTH
[1] https://www.python.org/dev/peps/pep-0008/#function-and-variable-names
I am attempting to utilize this to make a batch update of text sources and am trying to make a proper change to a single TextGDI and when attempting to do so I am running into this errror.
not sure what I am doing wwrong, I've tried multiple ways and other 'things' and i keep getting "your request type is not valid"
I've tried other requests which are not in the samples and they wont work either?
like GetSourcesList for example
eq = simpleobsws.Request('SetTextGDIPlusProperties', {'source': "Test Text GDI", 'text': "Test Text GDI"})
ret = await ws.call(req)
requests.append(simpleobsws.Request('GetVersion')) # Build a Request object, then append it to the batch
requests.append(simpleobsws.Request('GetStats')) # Build another request object, and append it
requests.append(simpleobsws.Request('SetTextGDIPlusProperties', {'source': "TEST TEXT GDI", 'text': "Miracle?"}))
ret = await ws.call_batch(requests, halt_on_failure = False) # Perform the request batch
print(ret)
text = "Testtting"
data = {"sourceName": "Test Text GDI", "text": text}
result = await ws.call('SetTextGDIPlusProperties', data) # Make a request with the given data
print(result)
yuan = simpleobsws.Request('TakeSourceScreenshot', {'sourceName':"main", 'saveToFilePath':"D:\\images\\" , 'fileFormat':'png', 'compressionQuality':"-1", 'width':"1920", 'height':"1080"})
ret2 = await ws.call(yuan)
if ret2.ok():
print("Request succeeded! Response data: {}".format(ret2.responseData))
My code is like this. Is there any problem? Why are errors always displayed. obs-version 27.2.4, obs-websocket version 5, simpleobsws version 1.3.1. thanks!
So I am working on this thingy where I use my MIDI Keyboard with drumpads as a kind of streamdeck but than different.
I need to use a:
async def mainloop():
running = True
while running:
for msg in midi_in.iter_pending():
# do stuff here with msg
What ever I try, it doesn't want to run both at the same time
Here is a list with things I tried:
loop.create_task(mainloop())
loop.run_forever
and running asyncio.run_coroutine_threadsafe(mainloop(), loop)
But yeah I just need to listen on the CurrentProgramSceneChanged
and CurrentSceneCollectionChanged
events and the events from my midi input.
Please help me out!
P.s. There is some kind of pressure on this, cause it is needed pretty soon!
Hi! Sorry to report a bug to ask help how to change scene, may you please share with me an example? Thank you a lot
I've just figured out (after more than one hour) that OBS doesn't support sendkeys ((((( it was very easy to suppose a simple keystroke can solve my problem..
Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.