forked from RayWangQvQ/BiliBiliToolPro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConstants.cs
115 lines (95 loc) · 4.45 KB
/
Constants.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Ray.BiliBiliTool.Config
{
public static class Constants
{
/// <summary>
/// 每天的最大投币数,优先级最高,默认每天最多投5个币(包含已投过的数量)
/// </summary>
public static int MaxNumberOfDonateCoins = 5;
/// <summary>
/// 每天可获取的满额经验值
/// </summary>
public static int EveryDayExp = 65;
/// <summary>
/// 开源地址
/// </summary>
public static string SourceCodeUrl = "https://github.com/RayWangQvQ/BiliBiliToolPro";
public static class OptionsNames
{
public static string ExpDictionaryName = "ExpDictionary";
public static string DonateCoinCanContinueStatusDictionaryName = "DonateCoinCanContinueStatusDictionary";
}
/// <summary>
/// 每日任务exp
/// </summary>
/// <returns></returns>
public static Dictionary<string, string> GetExpDic()
{
Dictionary<string, string> dic = new()
{
{"每日登录", "5"},
{"每日观看视频", "5"},
{"每日分享视频", "5"},
{"每日投币", "10"}
};
string buildKey(string key) => $"{OptionsNames.ExpDictionaryName}:{key}";
return dic.Select(x =>
new KeyValuePair<string, string>(buildKey(x.Key), x.Value))
.ToDictionary(k => k.Key, v => v.Value);
}
/// <summary>
/// 投币接口的data.code返回以下这些状态码,则可以继续尝试投币<para></para>
/// 如返回除这些之外的状态码,则终止投币流程,不进行无意义的尝试<para></para>
/// (比如返回-101:账号未登录;-102:账号被封停;-111:csrf校验失败等)
/// </summary>
/// <returns></returns>
public static Dictionary<string, string> GetDonateCoinCanContinueStatusDic()
{
Dictionary<string, string> dic = new()
{
{"0", "成功"},
{"-400", "请求错误"},
{"10003", "不存在该稿件"},
{"34002", "不能给自己投币"},
{"34003", "非法的投币数量"},
{"34004", "投币间隔太短"},
{"34005", "超过投币上限"}
};
string buildKey(string key) => $"{OptionsNames.DonateCoinCanContinueStatusDictionaryName}:{key}";
return dic.Select(x =>
new KeyValuePair<string, string>(buildKey(x.Key), x.Value))
.ToDictionary(k => k.Key, v => v.Value)
;
}
public static Dictionary<string, string> GetCommandLineMappingsDic()
{
return new Dictionary<string, string>()
{
{"--cookieStr1", "BiliBiliCookies:1"},
{"--runTasks", "RunTasks"},
{"--randomSleep","Security:RandomSleepMaxMin"},
{"--numberOfCoins", "DailyTaskConfig:NumberOfCoins"},
{"--numberOfProtectedCoins", "DailyTaskConfig:NumberOfProtectedCoins"},
{"--saveCoinsWhenLv6", "DailyTaskConfig:SaveCoinsWhenLv6"},
{"--selectLike", "DailyTaskConfig:SelectLike"},
{"--supportUpIds", "DailyTaskConfig:SupportUpIds"},
{"--dayOfAutoCharge", "DailyTaskConfig:DayOfAutoCharge"},
{"--autoChargeUpId", "DailyTaskConfig:AutoChargeUpId"},
{"--dayOfReceiveVipPrivilege", "DailyTaskConfig:DayOfReceiveVipPrivilege"},
{"--isExchangeSilver2Coin", "DailyTaskConfig:IsExchangeSilver2Coin"},
{"--devicePlatform", "DailyTaskConfig:DevicePlatform"},
{"--excludeAwardNames", "LiveLotteryTaskConfig:ExcludeAwardNames"},
{"--includeAwardNames", "LiveLotteryTaskConfig:INCLUDEAWARDNAMES"},
{"--unfollowGroup", "UnfollowBatchedTaskConfig:GroupName"},
{"--unfollowCount", "UnfollowBatchedTaskConfig:Count"},
{"--intervalSecondsBetweenRequestApi", "Security:IntervalSecondsBetweenRequestApi"},
{"--intervalMethodTypes", "Security:IntervalMethodTypes"},
{"--pushScKey", "Serilog:WriteTo:6:Args:scKey"},
{"--proxy", "WebProxy"}
};
}
}
}