mirror of
https://github.com/onyx-and-iris/simple-recorder.git
synced 2025-08-07 03:21:46 +00:00
Compare commits
No commits in common. "b7c25525a1fba790032c729ef945067a28105b5a" and "6035e09e4392c73ffeeaa86670d3dd9de9975f3f" have entirely different histories.
b7c25525a1
...
6035e09e43
21
README.md
21
README.md
@ -28,18 +28,7 @@ pipx install simple-recorder
|
|||||||
|
|
||||||
*with pyz*
|
*with pyz*
|
||||||
|
|
||||||
- Download the pyz file in [Releases](https://github.com/onyx-and-iris/simple-recorder/releases)
|
An executable pyz has been included in [Releases](https://github.com/onyx-and-iris/simple-recorder/releases) which you can run in Windows. Follow the steps in this [Setting up Windows for Zipapps](https://jhermann.github.io/blog/python/deployment/2020/02/29/python_zippapps_on_windows.html#Setting-Up-Windows-10-for-Zipapps) guide.
|
||||||
- Optional step: for automatic discovery of the pyz file follow this guide on [Setting Up Windows for Zippapps](https://jhermann.github.io/blog/python/deployment/2020/02/29/python_zippapps_on_windows.html#Setting-Up-Windows-10-for-Zipapps)
|
|
||||||
|
|
||||||
Finally run the pyz with python (CLI)/pythonw (GUI):
|
|
||||||
|
|
||||||
```console
|
|
||||||
python simple-recorder.pyz <subcommand>
|
|
||||||
|
|
||||||
pythonw simple-recorder.pyz
|
|
||||||
```
|
|
||||||
|
|
||||||
note, the pyz extension won't be required if you followed the optional step and made it discoverable.
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@ -62,7 +51,7 @@ OBS_THEME=Reds
|
|||||||
|
|
||||||
### CLI
|
### CLI
|
||||||
|
|
||||||
To launch the CLI:
|
To launch the CLI pass any subcommand, for example:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
simple-recorder start "File Name"
|
simple-recorder start "File Name"
|
||||||
@ -94,10 +83,10 @@ Usage: simple-recorder [OPTIONS] COMMAND
|
|||||||
|
|
||||||
### GUI
|
### GUI
|
||||||
|
|
||||||
To launch the GUI:
|
To launch the GUI run the root command without any subcommands:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
simple-recorder-gui
|
simple-recorder
|
||||||
```
|
```
|
||||||
|
|
||||||

|

|
||||||
@ -109,7 +98,7 @@ Just enter the filename and click *Start*.
|
|||||||
You can change the colour theme with the --theme option:
|
You can change the colour theme with the --theme option:
|
||||||
|
|
||||||
```console
|
```console
|
||||||
simple-recorder-gui --theme="Light Purple"
|
simple-recorder --theme="Light Purple"
|
||||||
```
|
```
|
||||||
|
|
||||||
[obs-studio]: https://obsproject.com/
|
[obs-studio]: https://obsproject.com/
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "simple-recorder"
|
name = "simple-recorder"
|
||||||
version = "0.3.5"
|
version = "0.3.1"
|
||||||
description = "A simple OBS recorder"
|
description = "A simple OBS recorder"
|
||||||
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
authors = [{ name = "onyx-and-iris", email = "code@onyxandiris.online" }]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
@ -15,9 +15,6 @@ license = { text = "MIT" }
|
|||||||
[project.scripts]
|
[project.scripts]
|
||||||
simple-recorder = "simple_recorder:run"
|
simple-recorder = "simple_recorder:run"
|
||||||
|
|
||||||
[project.gui-scripts]
|
|
||||||
simple-recorder-gui = "simple_recorder:run"
|
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["pdm-backend"]
|
requires = ["pdm-backend"]
|
||||||
build-backend = "pdm.backend"
|
build-backend = "pdm.backend"
|
||||||
@ -31,4 +28,6 @@ compile = "shiv -c simple-recorder -o bin/simple-recorder.pyz ."
|
|||||||
|
|
||||||
|
|
||||||
[dependency-groups]
|
[dependency-groups]
|
||||||
build = ["shiv>=1.0.8"]
|
build = [
|
||||||
|
"shiv>=1.0.8",
|
||||||
|
]
|
||||||
|
@ -21,7 +21,7 @@ class Directory(Command):
|
|||||||
async def run(self):
|
async def run(self):
|
||||||
try:
|
try:
|
||||||
with obsws.ReqClient(
|
with obsws.ReqClient(
|
||||||
host=self.host, port=self.port, password=self.password, timeout=3
|
host=self.host, port=self.port, password=self.password
|
||||||
) as client:
|
) as client:
|
||||||
if self.directory:
|
if self.directory:
|
||||||
client.set_record_directory(self.directory)
|
client.set_record_directory(self.directory)
|
||||||
@ -32,5 +32,5 @@ class Directory(Command):
|
|||||||
f"Current recording directory: {highlight(resp.record_directory)}"
|
f"Current recording directory: {highlight(resp.record_directory)}"
|
||||||
)
|
)
|
||||||
return resp.record_directory
|
return resp.record_directory
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except TimeoutError:
|
||||||
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
||||||
|
@ -31,7 +31,6 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
current_directory = resp.record_directory
|
current_directory = resp.record_directory
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except (ConnectionRefusedError, TimeoutError):
|
||||||
status_message = "Failed to connect to OBS. Is it running?"
|
status_message = "Failed to connect to OBS. Is it running?"
|
||||||
current_directory = ""
|
|
||||||
|
|
||||||
recorder_layout = [
|
recorder_layout = [
|
||||||
[fsg.Text("Enter recording filename:", key="-PROMPT-")],
|
[fsg.Text("Enter recording filename:", key="-PROMPT-")],
|
||||||
@ -103,9 +102,6 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
self["Add Chapter"].bind("<Leave>", " || LEAVE")
|
self["Add Chapter"].bind("<Leave>", " || LEAVE")
|
||||||
self["Add Chapter"].bind("<Button-3>", " || RIGHT_CLICK")
|
self["Add Chapter"].bind("<Button-3>", " || RIGHT_CLICK")
|
||||||
|
|
||||||
self["-GET-CURRENT-"].bind("<Return>", " || RETURN")
|
|
||||||
self["-UPDATE-"].bind("<Return>", " || RETURN")
|
|
||||||
|
|
||||||
async def run(self):
|
async def run(self):
|
||||||
while True:
|
while True:
|
||||||
event, values = self.read()
|
event, values = self.read()
|
||||||
@ -189,7 +185,7 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
"This feature is not implemented yet", text_color="orange"
|
"This feature is not implemented yet", text_color="orange"
|
||||||
)
|
)
|
||||||
|
|
||||||
case ["-GET-CURRENT-"] | ["-GET-CURRENT-", "RETURN"]:
|
case ["-GET-CURRENT-"]:
|
||||||
try:
|
try:
|
||||||
current_directory = await Directory(
|
current_directory = await Directory(
|
||||||
host=self.host, port=self.port, password=self.password
|
host=self.host, port=self.port, password=self.password
|
||||||
@ -200,7 +196,7 @@ class SimpleRecorderWindow(fsg.Window):
|
|||||||
f"Error: {e.raw_message}", text_color="red"
|
f"Error: {e.raw_message}", text_color="red"
|
||||||
)
|
)
|
||||||
|
|
||||||
case ["-UPDATE-"] | ["-UPDATE-", "RETURN"]:
|
case ["-UPDATE-"]:
|
||||||
filepath = values["-FILEPATH-"]
|
filepath = values["-FILEPATH-"]
|
||||||
if not filepath:
|
if not filepath:
|
||||||
self["-OUTPUT-SETTINGS-"].update(
|
self["-OUTPUT-SETTINGS-"].update(
|
||||||
|
@ -26,5 +26,5 @@ class Pause(Command):
|
|||||||
|
|
||||||
client.pause_record()
|
client.pause_record()
|
||||||
print("Recording paused successfully.")
|
print("Recording paused successfully.")
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except TimeoutError:
|
||||||
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
||||||
|
@ -26,5 +26,5 @@ class Resume(Command):
|
|||||||
|
|
||||||
client.resume_record()
|
client.resume_record()
|
||||||
print("Recording resumed successfully.")
|
print("Recording resumed successfully.")
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except TimeoutError:
|
||||||
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
||||||
|
@ -45,5 +45,5 @@ class Start(Command):
|
|||||||
)
|
)
|
||||||
client.start_record()
|
client.start_record()
|
||||||
print(f"Recording started with filename: {highlight(filename)}")
|
print(f"Recording started with filename: {highlight(filename)}")
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except TimeoutError:
|
||||||
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
||||||
|
@ -25,5 +25,5 @@ class Stop(Command):
|
|||||||
|
|
||||||
client.stop_record()
|
client.stop_record()
|
||||||
print(highlight("Recording stopped successfully."))
|
print(highlight("Recording stopped successfully."))
|
||||||
except (ConnectionRefusedError, TimeoutError):
|
except TimeoutError:
|
||||||
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
raise SimpleRecorderError("Failed to connect to OBS. Is it running?")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user