From 6479794f99879aabea3b6ae7edf8536deef67fa8 Mon Sep 17 00:00:00 2001 From: yaobiao131 <28655758+yaobiao131@users.noreply.github.com> Date: Tue, 15 Apr 2025 22:03:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=97=E5=B9=95?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=20Fixes:=20#254?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DownKyi.Core/BiliApi/VideoStream/VideoStream.cs | 3 ++- DownKyi/Services/Download/DownloadService.cs | 10 +++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs b/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs index ab09e76..6e1081e 100644 --- a/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs +++ b/DownKyi.Core/BiliApi/VideoStream/VideoStream.cs @@ -30,7 +30,8 @@ public static class VideoStream { parameters.Add("avid", avid); } - else if (cid > 0) + + if (cid > 0) { parameters.Add("cid", cid); } diff --git a/DownKyi/Services/Download/DownloadService.cs b/DownKyi/Services/Download/DownloadService.cs index 857b41f..0c01d84 100644 --- a/DownKyi/Services/Download/DownloadService.cs +++ b/DownKyi/Services/Download/DownloadService.cs @@ -261,7 +261,7 @@ public abstract class DownloadService foreach (var subRip in subRipTexts) { - var srtFile = $"{downloading.DownloadBase.FilePath}.srt"; + var srtFile = $"{downloading.DownloadBase.FilePath}_{subRip.LanDoc}.srt"; try { File.WriteAllText(srtFile, subRip.SrtString); @@ -278,6 +278,14 @@ public abstract class DownloadService } } + // subRipTexts中第一个复制为不带后缀的字幕,保证能自动匹配到字幕 + if (srtFiles.Count > 0) + { + var srtFile = $"{downloading.DownloadBase.FilePath}.srt"; + File.Copy(srtFiles[0], srtFile); + srtFiles.Add(srtFile); + } + return srtFiles; }