Update On Mon Mar 10 19:34:34 CET 2025

This commit is contained in:
github-action[bot]
2025-03-10 19:34:34 +01:00
parent 12122af014
commit 4f7c5733b4
69 changed files with 1390 additions and 828 deletions

View File

@@ -68,7 +68,7 @@ internal static class BBDownDownloadUtil
throw new Exception("Retry...");
}
public static async Task DownloadFile(string url, string path, DownloadConfig config)
public static async Task DownloadFileAsync(string url, string path, DownloadConfig config)
{
if (string.IsNullOrEmpty(url)) return;
if (config.ForceHttp) url = ReplaceUrl(url);

View File

@@ -512,7 +512,7 @@ internal partial class Program
LogWarn("检测到cmcc域名cdn, 已经禁用多线程");
downloadConfig.ForceHttp = false;
}
await DownloadFile(url, destPath, downloadConfig);
await DownloadFileAsync(url, destPath, downloadConfig);
}
}

View File

@@ -417,7 +417,7 @@ partial class Program
}
if (!myOption.SkipCover && !myOption.SubOnly && !File.Exists(coverPath) && !myOption.DanmakuOnly && !myOption.CoverOnly)
{
await DownloadFile((pic == "" ? p.cover! : pic), coverPath, new DownloadConfig());
await DownloadFileAsync((pic == "" ? p.cover! : pic), coverPath, new DownloadConfig());
}
if (!myOption.SkipSubtitle && !myOption.DanmakuOnly && !myOption.CoverOnly)
@@ -557,8 +557,8 @@ partial class Program
var danmakuXmlPath = Path.ChangeExtension(savePath, ".xml");
var danmakuAssPath = Path.ChangeExtension(savePath, ".ass");
Log("正在下载弹幕Xml文件");
string danmakuUrl = $"https://comment.bilibili.com/{p.cid}.xml";
await DownloadFile(danmakuUrl, danmakuXmlPath, downloadConfig);
var danmakuUrl = $"https://comment.bilibili.com/{p.cid}.xml";
await DownloadFileAsync(danmakuUrl, danmakuXmlPath, downloadConfig);
var danmakus = DanmakuUtil.ParseXml(danmakuXmlPath);
if (danmakus == null)
{
@@ -596,7 +596,7 @@ partial class Program
{
var coverUrl = pic == "" ? p.cover! : pic;
var newCoverPath = Path.ChangeExtension(savePath, Path.GetExtension(coverUrl));
await DownloadFile(coverUrl, newCoverPath, downloadConfig);
await DownloadFileAsync(coverUrl, newCoverPath, downloadConfig);
if (Directory.Exists(p.aid) && Directory.GetFiles(p.aid).Length == 0) Directory.Delete(p.aid, true);
return;
}