From 196bbeee4d5459732ec69dec72e56515b8eaa766 Mon Sep 17 00:00:00 2001 From: Sim0nW0lf <31454341+Sim0nW0lf@users.noreply.github.com> Date: Thu, 6 Apr 2023 06:05:42 +0200 Subject: [PATCH] allow multiple ssh users Different users on multiple servers were not possible because you had to set a specific user. I changed that so that setting no user in rffmpeg.yml and configuring the ssh config with a user works instead. If you have configured a specific user, this won't break your setup and disables the feature. --- rffmpeg | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rffmpeg b/rffmpeg index 43e9af5..88070b7 100755 --- a/rffmpeg +++ b/rffmpeg @@ -183,7 +183,7 @@ def load_config(): config["dir_group"] = config_directories.get("group", "sudo") # Parse the keys from the remote group - config["remote_user"] = config_remote.get("user", "jellyfin") + config["remote_user"] = config_remote.get("user", "") config["remote_args"] = config_remote.get( "args", ["-i", "/var/lib/jellyfin/.ssh/id_rsa"] ) @@ -360,6 +360,7 @@ def get_target_host(config): log.debug("Running SSH test") test_ssh_command = generate_ssh_command(config, host["hostname"]) test_ssh_command.remove("-q") + test_ssh_command = [arg.replace('@', '', 1) if arg.startswith('@') else arg for arg in test_ssh_command] test_ffmpeg_command = [config["ffmpeg_command"], "-version"] ret = run_command(test_ssh_command + test_ffmpeg_command, PIPE, PIPE, PIPE) if ret.returncode != 0: @@ -451,6 +452,7 @@ def run_remote_ffmpeg( Run ffmpeg against the remote target_hostname. """ rffmpeg_ssh_command = generate_ssh_command(config, target_hostname) + rffmpeg_ssh_command = [arg.replace('@', '', 1) if arg.startswith('@') else arg for arg in rffmpeg_ssh_command] rffmpeg_ffmpeg_command = list() # Add any pre commands