Skip to content

Commit

Permalink
简单整理格式
Browse files Browse the repository at this point in the history
  • Loading branch information
lc6464 committed Aug 13, 2024
1 parent 6f5eaf7 commit 0371475
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion BBDown/BBDownUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public static async Task<string> GetAvIdAsync(string input)
{
avid = input.ToLower()[2..];
}
else if (input.StartsWith("cheese/")) // cheese/(ep|ss)\d+ 格式
else if (input.StartsWith("cheese/")) // ^cheese/(ep|ss)\d+ 格式
{
string epId = "";
if (input.Contains("/ep"))
Expand Down
25 changes: 13 additions & 12 deletions BBDown/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,21 @@ public static (Dictionary<string, byte> encodingPriority, Dictionary<string, int

public static async Task<(string fetchedAid, VInfo vInfo, string apiType)> GetVideoInfoAsync(MyOption myOption, string aidOri, string input)
{
Log("检测账号登录...");
Log("检测账号登录...");

// 加载认证信息
LoadCredentials(myOption);

// 检测是否登录了账号
bool is_login = await CheckLogin(Config.COOKIE);
// 检测是否登录了账号
bool is_login = await CheckLogin(Config.COOKIE);
if (!myOption.UseIntlApi && !myOption.UseTvApi && Config.AREA == "")
{
if (!is_login)
{
LogWarn("你尚未登录B站账号, 解析可能受到限制");
}
}

Log("获取aid...");
aidOri = await GetAvIdAsync(input);
Log("获取aid结束: " + aidOri);
Expand All @@ -267,16 +267,17 @@ public static (Dictionary<string, byte> encodingPriority, Dictionary<string, int
LogWarn("未找到此 EP/SS 对应番剧信息, 正在尝试按课程查找。");

aidOri = aidOri.Replace("ep", "cheese");
Log("新的 aid: " + aidOri);
Log("新的 aid: " + aidOri);

if (string.IsNullOrEmpty(aidOri)) {
throw new Exception("输入有误");
}
if (string.IsNullOrEmpty(aidOri))
{
throw new Exception("输入有误");
}

Log("获取视频信息...");
fetcher = FetcherFactory.CreateFetcher(aidOri, myOption.UseIntlApi);
vInfo = await fetcher.FetchAsync(aidOri);
}
Log("获取视频信息...");
fetcher = FetcherFactory.CreateFetcher(aidOri, myOption.UseIntlApi);
vInfo = await fetcher.FetchAsync(aidOri);
}

string title = vInfo.Title;
long pubTime = vInfo.PubTime;
Expand Down

0 comments on commit 0371475

Please sign in to comment.