From 29376c59a6e7c13f69d5b1184349ad0d8a5bcab3 Mon Sep 17 00:00:00 2001 From: Elwador <75888166+Elwador@users.noreply.github.com> Date: Tue, 13 Aug 2024 16:03:39 +0200 Subject: [PATCH] Fix - Issue with description when the mp4 option is enabled https://github.com/Crunchy-DL/Crunchy-Downloader/issues/73 --- CRD/Utils/Muxing/Merger.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/CRD/Utils/Muxing/Merger.cs b/CRD/Utils/Muxing/Merger.cs index 4b4a021..cd36f00 100644 --- a/CRD/Utils/Muxing/Merger.cs +++ b/CRD/Utils/Muxing/Merger.cs @@ -61,6 +61,7 @@ public class Merger{ } else{ metaData.Add($"-disposition:a:{audioIndex} 0"); } + index++; audioIndex++; } @@ -86,9 +87,10 @@ public class Merger{ } else{ metaData.Add($"-disposition:s:{sub.i} 0"); } + index++; } - + args.AddRange(metaData); // args.AddRange(options.Subtitles.Select((sub, subIndex) => $"-map {subIndex + index}")); args.Add("-c:v copy"); @@ -106,7 +108,11 @@ public class Merger{ XmlDocument doc = new XmlDocument(); doc.Load(options.Description[0].Path); XmlNode? node = doc.SelectSingleNode("//Tag/Simple[Name='DESCRIPTION']/String"); - args.Add($"-metadata comment=\"{node?.InnerText ?? string.Empty}\""); + string description = node?.InnerText + .Replace("\\", "\\\\") // Escape backslashes + .Replace("\"", "\\\"") // Escape double quotes + ?? string.Empty; + args.Add($"-metadata comment=\"{description}\""); } if (options.Options.ffmpeg?.Count > 0){