mirror of
https://github.com/yaobiao131/downkyicore.git
synced 2025-08-10 00:52:31 +00:00
fix: 修复字幕下载 Fixes: #254
This commit is contained in:
@@ -30,7 +30,8 @@ public static class VideoStream
|
||||
{
|
||||
parameters.Add("avid", avid);
|
||||
}
|
||||
else if (cid > 0)
|
||||
|
||||
if (cid > 0)
|
||||
{
|
||||
parameters.Add("cid", cid);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user