5 Commits

Author SHA1 Message Date
3bce50701e add v5.4, v5.5 methods
v5.4:
- get_source_filter_kind_list
- get_scene_item_source

v5.5:
- split_record_file
- create_record_chapter

minor bump
2025-06-23 06:25:31 +01:00
8e8062d5c8 Merge pull request #57 from onyx-and-iris/dev
Return response class for toggle_record
2025-05-14 20:19:49 +01:00
6f64e884d8 md fix 2025-05-07 22:00:19 +01:00
90abc4f9ee upd test_get_hot_key_list
- check hotkey list is not empty
- check it has at least one OBSBasic. hotkey.
2025-05-07 19:13:09 +01:00
f564f53c69 return response class for toggle_record()
patch bump
2025-05-07 18:42:29 +01:00
4 changed files with 54 additions and 32 deletions

View File

@@ -171,7 +171,9 @@ logging.basicConfig(level=logging.DEBUG)
Install [hatch][hatch-install] and then:
`hatch test`
```
hatch test
```
### Official Documentation

View File

@@ -1100,6 +1100,14 @@ class ReqClient:
payload = {"position": pos, "release": release}
self.send("SetTBarPosition", payload)
def get_source_filter_kind_list(self):
"""
Gets an array of all available source filter kinds.
"""
return self.send("GetSourceFilterKindList")
def get_source_filter_list(self, name):
"""
Gets a list of all of a source's filters.
@@ -1311,6 +1319,23 @@ class ReqClient:
}
return self.send("GetSceneItemId", payload)
def get_scene_item_source(self, scene_name, scene_item_id):
"""
Gets the source associated with a scene item.
:param scene_item_id: Numeric ID of the scene item (>= 0)
:type scene_item_id: int
:param scene_name: Name of the scene the item is in.
:type scene_name: str
"""
payload = {
"sceneItemId": scene_item_id,
"sceneName": scene_name,
}
return self.send("GetSceneItemSource", payload)
def create_scene_item(self, scene_name, source_name, enabled=None):
"""
Creates a new scene item using a source.
@@ -1784,7 +1809,7 @@ class ReqClient:
"""
self.send("ToggleRecord")
return self.send("ToggleRecord")
def start_record(self):
"""
@@ -1826,6 +1851,28 @@ class ReqClient:
"""
self.send("ResumeRecord")
def split_record_file(self):
"""
Splits the current file being recorded into a new file.
"""
self.send("SplitRecordFile")
def create_record_chapter(self, chapter_name=None):
"""
Adds a new chapter marker to the file currently being recorded.
Note: As of OBS 30.2.0, the only file format supporting this feature is Hybrid MP4.
:param chapter_name: Name of the new chapter
:type chapter_name: str
"""
payload = {"chapterName": chapter_name}
self.send("CreateRecordChapter", payload)
def get_media_input_status(self, name):
"""
Gets the status of a media input.

View File

@@ -1 +1 @@
version = "1.7.1"
version = "1.8.0"

View File

@@ -13,35 +13,8 @@ class TestRequests:
def test_get_hot_key_list(self):
resp = req_cl.get_hot_key_list()
obsbasic_hotkey_list = [
"OBSBasic.SelectScene",
"OBSBasic.QuickTransition.1",
"OBSBasic.QuickTransition.2",
"OBSBasic.QuickTransition.3",
"OBSBasic.StartStreaming",
"OBSBasic.StopStreaming",
"OBSBasic.ForceStopStreaming",
"OBSBasic.StartRecording",
"OBSBasic.StopRecording",
"OBSBasic.PauseRecording",
"OBSBasic.UnpauseRecording",
"OBSBasic.SplitFile",
"OBSBasic.StartReplayBuffer",
"OBSBasic.StopReplayBuffer",
"OBSBasic.StartVirtualCam",
"OBSBasic.StopVirtualCam",
"OBSBasic.EnablePreview",
"OBSBasic.DisablePreview",
"OBSBasic.EnablePreviewProgram",
"OBSBasic.DisablePreviewProgram",
"OBSBasic.ShowContextBar",
"OBSBasic.HideContextBar",
"OBSBasic.Transition",
"OBSBasic.ResetStats",
"OBSBasic.Screenshot",
"OBSBasic.SelectedSourceScreenshot",
]
assert all(x in resp.hotkeys for x in obsbasic_hotkey_list)
assert resp.hotkeys
assert any(x.startswith("OBSBasic.") for x in resp.hotkeys)
@pytest.mark.parametrize(
"name,data",