-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig_example.js
80 lines (75 loc) · 2.33 KB
/
config_example.js
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
import checkConfig from './util/checkConfig.js'
// const ruleList = [
// /(FAMILY|Love.Live|Kaguya|Tarumono)/i,
// /(Rendering|aharen|式守|Shikimori)/i,
// /(Jitsuryoku|至上|OVERLORD|Made.in.Abyss)/i,
// ]
// matcherFunction: (title) => ruleList.some((regex) => regex.test(title))
const ruleMap = new Map([
[/FAMILY/i, '间谍过家家'],
[/Love.Live/i, 'Love Live! Superstar!! 第二季'],
[/Kaguya/i, '辉夜大小姐想让我告白'],
[/Nariagari/i, '盾之勇者成名录'],
[/Rendering/i, '夏日重现'],
[/Shikimori/i, '式守同学不只可爱而已'],
[/Jitsuryoku/i, '欢迎来到实力至上主义教室 2nd Season'],
[/OVERLORD/i, 'OVERLORD IV'],
[/Made.in.Abyss/i, '来自深渊 烈日的黄金乡'],
])
const myMatcherFunction = (title) => {
for (const [regex, folder] of ruleMap) {
if (regex.test(title)) return folder
}
}
const config = {
feedConfigs: [
{
name: 'Lilith Raws', // 不可重复
link: 'https://api.lilithraws.org/v1/rss/latest/file',
interval: 30 * 1000,
matcherFunction: (title) => myMatcherFunction(title), // 需返回 'folder name' || true || false
},
{
name: 'Bangumi.moe',
link: 'https://bangumi.moe/rss/latest',
interval: 30 * 1000,
matcherFunction: (title) => /(NC-Raws|Lilith-Raws).*Baha/i.test(title) && myMatcherFunction(title),
},
{
name: 'Mikan Project',
link: 'https://mikanani.me/RSS/MyBangumi?token=xxx',
interval: 60 * 1000,
matcherFunction: (title) => {
const regex1 = /(动漫国|桜都|千夏|幻樱|喵萌|诸神|极影).*1080.*(简|CHS|GB)/i
const regex2 = /(外挂)/i
if (regex1.test(title) && !regex2.test(title)) {
return myMatcherFunction(title) || true
}
},
},
],
aria2Configs: [
{
host: 'localhost',
port: 6800,
secure: false,
secret: '',
path: '/jsonrpc',
downloadDir: '', // 只有填写下载路径时, matcherFunction 返回的 folder name 才有效
},
{
host: 'localhost',
port: 16800,
},
],
// defaultInterval: 60 * 1000,
// isFirstDownload: false,
// telegramToken: '',
// telegramChatID: '',
// proxy: 'socks5://localhost:7890',
// log: './error.log',
// exportFile: './download.log',
// debug: false,
}
checkConfig(config)
export default config