mirror of
https://github.com/onyx-and-iris/obsws-python.git
synced 2024-11-22 04:40:53 +00:00
auth logger for clients
added RpcVersion in auth loggers for both requests and events clients. removed the check in baseclient auth function and returned the whole response.
This commit is contained in:
parent
24f8487d93
commit
468c63f697
@ -108,7 +108,7 @@ class ObsClient:
|
|||||||
self.ws.send(json.dumps(payload))
|
self.ws.send(json.dumps(payload))
|
||||||
try:
|
try:
|
||||||
response = json.loads(self.ws.recv())
|
response = json.loads(self.ws.recv())
|
||||||
return response["op"] == 2
|
return response
|
||||||
except json.decoder.JSONDecodeError:
|
except json.decoder.JSONDecodeError:
|
||||||
raise OBSSDKError("failed to identify client with the server")
|
raise OBSSDKError("failed to identify client with the server")
|
||||||
|
|
||||||
|
@ -27,8 +27,9 @@ class EventClient:
|
|||||||
defaultkwargs = {"subs": Subs.LOW_VOLUME}
|
defaultkwargs = {"subs": Subs.LOW_VOLUME}
|
||||||
kwargs = defaultkwargs | kwargs
|
kwargs = defaultkwargs | kwargs
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
if self.base_client.authenticate():
|
auth_status = self.base_client.authenticate()
|
||||||
self.logger.info(f"Successfully identified {self} with the server")
|
if auth_status:
|
||||||
|
self.logger.info(f"Successfully identified {self} with the server using rpcVersion:{auth_status['d']['negotiatedRpcVersion']}")
|
||||||
self.callback = Callback()
|
self.callback = Callback()
|
||||||
self.subscribe()
|
self.subscribe()
|
||||||
|
|
||||||
|
@ -17,8 +17,9 @@ class ReqClient:
|
|||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
self.logger = logger.getChild(self.__class__.__name__)
|
self.logger = logger.getChild(self.__class__.__name__)
|
||||||
self.base_client = ObsClient(**kwargs)
|
self.base_client = ObsClient(**kwargs)
|
||||||
if self.base_client.authenticate():
|
auth_status = self.base_client.authenticate()
|
||||||
self.logger.info(f"Successfully identified {self} with the server")
|
if auth_status:
|
||||||
|
self.logger.info(f"Successfully identified {self} with the server using rpcVersion:{auth_status['d']['negotiatedRpcVersion']}")
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
return self
|
return self
|
||||||
|
Loading…
Reference in New Issue
Block a user