mirror of
https://github.com/joshuaboniface/rffmpeg.git
synced 2026-07-18 00:45:53 +00:00
Merge pull request #12 from dannytech/ssh-persist
This commit is contained in:
commit
de99bc6c32
2 changed files with 15 additions and 8 deletions
20
rffmpeg.py
20
rffmpeg.py
|
|
@ -84,6 +84,7 @@ except Exception as e:
|
|||
|
||||
# Handle the fallback configuration using get() to avoid failing
|
||||
config["ssh_command"] = o_config["rffmpeg"]["commands"].get("ssh", "ssh")
|
||||
config["remote_persist"] = int(o_config["rffmpeg"]["remote"].get("persist", 0))
|
||||
config["fallback_ffmpeg_command"] = o_config["rffmpeg"]["commands"].get("fallback_ffmpeg", config["ffmpeg_command"])
|
||||
config["fallback_ffprobe_command"] = o_config["rffmpeg"]["commands"].get("fallback_ffprobe", config["ffprobe_command"])
|
||||
|
||||
|
|
@ -213,14 +214,17 @@ def setup_remote_command(target_host):
|
|||
rffmpeg_ssh_command.append("-q")
|
||||
|
||||
# Set our connection timeouts, in case one of several remote machines is offline
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("ConnectTimeout=1")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("ConnectionAttempts=1")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("StrictHostKeyChecking=no")
|
||||
rffmpeg_ssh_command.append("-o")
|
||||
rffmpeg_ssh_command.append("UserKnownHostsFile=/dev/null")
|
||||
rffmpeg_ssh_command.extend([ "-o", "ConnectTimeout=1" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ConnectionAttempts=1" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "StrictHostKeyChecking=no" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "UserKnownHostsFile=/dev/null" ])
|
||||
|
||||
# Use SSH control persistence to keep sessions alive for subsequent commands
|
||||
persist = config["remote_persist"]
|
||||
if persist > 0:
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlMaster=auto" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlPath=/run/shm/ssh-%r@%h:%p" ])
|
||||
rffmpeg_ssh_command.extend([ "-o", "ControlPersist={}".format(persist) ])
|
||||
|
||||
for arg in config["remote_args"]:
|
||||
if arg:
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ rffmpeg:
|
|||
# The remote SSH user to connect as
|
||||
user: jellyfin
|
||||
|
||||
# How long to persist SSH sessions (0 to disable)
|
||||
persist: 300
|
||||
|
||||
# A YAML list of additional SSH arguments (e.g. private keys),
|
||||
# one line per space-separated argument element.
|
||||
args:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue