Skip to content

Commit 6dbf4bc

Browse files
author
nfc666
committed
更新了一些注释错误
1 parent 8698357 commit 6dbf4bc

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

SenTooliKit.Common/Helpers/BilibiliWbiHelper.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public static class BilibiliWbiHelper
1717
6, 63, 57, 62, 11, 36, 20, 34, 44, 52
1818
};
1919

20-
public static string GetMixinKey(string orig)
20+
private static string GetMixinKey(string orig)
2121
{
2222
return MixinKeyEncTab.Aggregate("", (s, i) => s + orig[i])[..32];
2323
}
@@ -35,9 +35,12 @@ public static Dictionary<string, string> EncWbi(Dictionary<string, string> param
3535
string mixinKey = GetMixinKey(imgKey + subKey);
3636
string currTime = DateTimeOffset.Now.ToUnixTimeSeconds().ToString();
3737
//添加 wts 字段
38-
parameters["wts"] = "1758973738";
38+
// parameters["wts"] = "1758973738";
39+
parameters["wts"] = currTime;
3940
// 按照 key 重排参数
40-
parameters = parameters.OrderBy(p => p.Key).ToDictionary(p => p.Key, p => p.Value);
41+
parameters = parameters
42+
.OrderBy(p => p.Key)
43+
.ToDictionary(p => p.Key, p => p.Value);
4144
//过滤 value 中的 "!'()*" 字符
4245
parameters = parameters.ToDictionary(
4346
kvp => kvp.Key,
@@ -50,7 +53,6 @@ public static Dictionary<string, string> EncWbi(Dictionary<string, string> param
5053
byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(query + mixinKey));
5154
string wbiSign = BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
5255
parameters["w_rid"] = wbiSign;
53-
5456
return parameters;
5557
}
5658

SenTooliKit.Services/Services/BiliCommentsService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class BiliCommentsService : IBiliCommentsService
1414
private readonly IBilibiliInfoService _bilibiliInfoService = new BilibiliInfoService();
1515

1616
/// <summary>
17-
/// 获取视频的弹幕
17+
/// 获取视频的评论
1818
/// </summary>
1919
/// <param name="bvid"></param>
2020
/// <returns></returns>
@@ -32,7 +32,7 @@ public async Task<List<Reply>> GetCommentsAsync(string bvid)
3232

3333

3434
/// <summary>
35-
/// 获取视频的所有基本弹幕
35+
/// 获取视频的所有基本评论
3636
/// </summary>
3737
/// <param name="bvid"></param>
3838
/// <returns></returns>
@@ -76,14 +76,15 @@ public async Task<List<Reply>> GetBaseAllCommentsAsync(string bvid)
7676
{
7777
// 获取下一页 offset
7878
nextOffset =
79-
JsonValueHelper.GetJsonValue<string>(resp, "$.data.cursor.pagination_reply.next_offset");
79+
JsonValueHelper
80+
.GetJsonValue<string>(resp, "$.data.cursor.pagination_reply.next_offset");
8081
}
8182
catch (Exception)
8283
{
8384
nextOffset = null;
8485
}
8586

86-
// 随机延迟 1-3 秒
87+
// 随机延迟 ,避免风控
8788
await Task.Delay(random.Next(500, 1000));
8889
} while (!string.IsNullOrEmpty(nextOffset));
8990

SenTooliKit/Manager/WindowManager.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ public T ShowChromeWindow<T>() where T : Window
3434

3535
// 应用无标题栏设置
3636
ApplyWindowChromeSettings(window);
37-
38-
// 注册事件:窗口初始化后播放动画
39-
window.SourceInitialized += (_, _) => PlayOpenAnimation(window);
37+
4038

4139
window.Closed += (_, _) => _windows.Remove(type);
4240
_windows[type] = window;

0 commit comments

Comments
 (0)