diff --git a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs index b200b56..2237d02 100644 --- a/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs +++ b/src/N_m3u8DL-RE/CommandLine/CommandInvoker.cs @@ -18,7 +18,7 @@ namespace N_m3u8DL_RE.CommandLine { internal partial class CommandInvoker { - public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20231026"; + public const string VERSION_INFO = "N_m3u8DL-RE (Beta version) 20231113"; [GeneratedRegex("((best|worst)\\d*|all)")] private static partial Regex ForStrRegex(); diff --git a/src/N_m3u8DL-RE/Util/OtherUtil.cs b/src/N_m3u8DL-RE/Util/OtherUtil.cs index cce15b2..1a60ca9 100644 --- a/src/N_m3u8DL-RE/Util/OtherUtil.cs +++ b/src/N_m3u8DL-RE/Util/OtherUtil.cs @@ -160,5 +160,10 @@ namespace N_m3u8DL_RE.Util if (File.Exists(deGzipFile)) File.Delete(deGzipFile); } } + + public static string GetEnvironmentVariable(string key, string defaultValue = "") + { + return Environment.GetEnvironmentVariable(key) ?? defaultValue; + } } } diff --git a/src/N_m3u8DL-RE/Util/PipeUtil.cs b/src/N_m3u8DL-RE/Util/PipeUtil.cs index 0a3fd93..d51df0e 100644 --- a/src/N_m3u8DL-RE/Util/PipeUtil.cs +++ b/src/N_m3u8DL-RE/Util/PipeUtil.cs @@ -54,7 +54,8 @@ namespace N_m3u8DL_RE.Util string dateString = DateTime.Now.ToString("o"); StringBuilder command = new StringBuilder("-y -fflags +genpts -loglevel quiet "); - string? customDest = Environment.GetEnvironmentVariable("RE_LIVE_PIPE_OPTIONS"); + string customDest = OtherUtil.GetEnvironmentVariable("RE_LIVE_PIPE_OPTIONS"); + string pipeDir = OtherUtil.GetEnvironmentVariable("RE_LIVE_PIPE_TMP_DIR", Path.GetTempPath()); if (!string.IsNullOrEmpty(customDest)) { @@ -67,7 +68,7 @@ namespace N_m3u8DL_RE.Util command.Append($" -i \"\\\\.\\pipe\\{item}\" "); else //command.Append($" -i \"unix://{Path.Combine(Path.GetTempPath(), $"CoreFxPipe_{item}")}\" "); - command.Append($" -i \"{Path.Combine(Path.GetTempPath(), item)}\" "); + command.Append($" -i \"{Path.Combine(pipeDir, item)}\" "); } for (int i = 0; i < pipeNames.Length; i++)