From 0b68a64908dab269e501e82d991930593a7face1 Mon Sep 17 00:00:00 2001 From: Charlie Vieth Date: Wed, 1 Jan 2025 18:32:01 -0700 Subject: [PATCH] ffmpeg: enable network reconnects This commit adds the HTTP reconnect* args to the ffmpeg subprocess so that it will attempt to reconnect when a network error occurs. --- scdl/scdl.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scdl/scdl.py b/scdl/scdl.py index f6a4f6d..c9eb1e0 100644 --- a/scdl/scdl.py +++ b/scdl/scdl.py @@ -1310,6 +1310,16 @@ def build_ffmpeg_encoding_args( "0.1", ] + reconnect_args = [ + ["-reconnect", "1"], + ["-reconnect_streamed", "1"], + ["-reconnect_max_retries", "10"], + ["-reconnect_delay_total_max", "60"], + ] + for rargs in reconnect_args: + if rargs[0] in supported: + ffmpeg_args += rargs + ffmpeg_args += [ # User provided arguments *args,