fix: 修复字幕下载 Fixes: #254

This commit is contained in:
yaobiao131
2025-04-15 22:03:34 +08:00
parent 97a030aef3
commit 6479794f99
2 changed files with 11 additions and 2 deletions

View File

@@ -30,7 +30,8 @@ public static class VideoStream
{
parameters.Add("avid", avid);
}
else if (cid > 0)
if (cid > 0)
{
parameters.Add("cid", cid);
}

View File

@@ -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;
}