mirror of
https://github.com/bolucat/Archive.git
synced 2025-12-24 13:28:37 +08:00
Update On Mon Mar 10 19:34:34 CET 2025
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -512,7 +512,7 @@ internal partial class Program
|
||||
LogWarn("检测到cmcc域名cdn, 已经禁用多线程");
|
||||
downloadConfig.ForceHttp = false;
|
||||
}
|
||||
await DownloadFile(url, destPath, downloadConfig);
|
||||
await DownloadFileAsync(url, destPath, downloadConfig);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user