diff --git a/Services/LiveChatDownloadService.cs b/Services/LiveChatDownloadService.cs index b04fb34..85d7f98 100644 --- a/Services/LiveChatDownloadService.cs +++ b/Services/LiveChatDownloadService.cs @@ -47,10 +47,14 @@ private Task ExecuteAsyncInternal(CancellationToken stoppingToken) IgnoreNoFormatsError = true }; - if (File.Exists("cookies.txt")) + FileInfo cookies = new("cookies.txt"); + if (cookies.Exists) { - live_chatOptionSet.Cookies = "cookies.txt"; - info_jsonOptionSet.Cookies = "cookies.txt"; + _logger.LogInformation("Detected {cookies}, use it for yt-dlp", cookies.FullName); + var bak = cookies.CopyTo("cookies.bak.txt", true); + var bak2 = cookies.CopyTo("cookies.bak2.txt", true); + live_chatOptionSet.Cookies = bak.FullName; + info_jsonOptionSet.Cookies = bak2.FullName; } YoutubeDLProcess ytdlProc = new(Helper.WhereIsYt_dlp());