forked from iczrac/Parsers-for-clash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparsers.yml
485 lines (435 loc) · 16.5 KB
/
parsers.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
parsers: # array
- reg: ^.*$
# - reg: ^.*$ 匹配所有订阅,或 - url: https://example.com/profile.yaml 指定订阅
# 下面是删除服务商自带的策略组和规则
code: |
module.exports.parse = (raw, { yaml }) => {
const rawObj = yaml.parse(raw)
const groups = []
const rules = []
return yaml.stringify({ ...rawObj, 'proxy-groups': groups, rules })
}
# 建立自己的配置
yaml:
prepend-proxy-groups: # 建立策略组
- name: 🥷PROXY
type: select
url: http://www.google.com/generate_204
interval: 300
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 👆SELECT
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- ⏳YouTube-Url-Test
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🚀URL-TEST
type: url-test
url: http://www.google.com/generate_204
interval: 120
lazy: true
tolerance: 100
- name: 🎛LOAD-BALANCE
type: load-balance
url: http://www.gstatic.com/generate_204
interval: 600
- name: 🕹Fallback
type: fallback
url: http://www.gstatic.com/generate_204
interval: 60
lazy: true
tolerance: 30
- name: 🎎YouTube
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- ⏳YouTube-Url-Test
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: ⏳YouTube-Url-Test
type: url-test
url: https://www.youtube.com/
interval: 120
lazy: true
tolerance: 100
proxies:
- REJECT
- DIRECT
- name: 📽Netflix
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🤖OpenAI
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🔍Bing
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🚅Google
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🛀Bilibiliintl
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🦤Twitter
type: select
proxies:
- 🚀URL-TEST
- 🎛LOAD-BALANCE
- 🕹Fallback
- 👆SELECT
- DIRECT
- 🇭🇰香港
- 🐳台湾
- 🇯🇵日本
- 🇸🇬新加坡
- 🇰🇷韩国
- 🇺🇸美国
- 👨🎤其他
- name: 🚦AD
type: select
proxies:
- REJECT
- DIRECT
- 🥷PROXY
- name: 🇭🇰香港
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 🐳台湾
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 🇯🇵日本
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 🇸🇬新加坡
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 🇰🇷韩国
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 🇺🇸美国
type: url-test
url: http://www.google.com/generate_204
interval: 300
- name: 👨🎤其他
type: url-test
url: http://www.google.com/generate_204
interval: 300
# 策略组示例
# - name: 分组名
# type: select # 手动选点
# url-test # 自动选择延迟最低的节点
# fallback # 节点故障时自动切换下一个
# laod-balance # 均衡使用分组内的节点
# url: http://www.gstatic.com/generate_204 # 测试地址 非select类型分组必要
# interval: 300 # 自动测试间隔时间,单位秒 非select类型分组必要
# tolerance: 50 # 允许的偏差,节点之间延迟差小于该值不切换 非必要
# proxies:
# - 节点名称或其他分组套娃
commands:
- proxy-groups.(🚀URL-TEST).proxies=[]proxyNames
- proxy-groups.(🎛LOAD-BALANCE).proxies=[]proxyNames
- proxy-groups.(🕹Fallback).proxies=[]proxyNames
- proxy-groups.(⏳YouTube-Url-Test).proxies=[]proxyNames
- proxy-groups.🇭🇰香港.proxies=[]proxyNames|港|香港|🇭🇰|HK|Hong Kong # 向指定策略组添加订阅中的节点名,可使用正则过滤
- proxy-groups.🐳台湾.proxies=[]proxyNames|台|台湾|新北|彰化|TW|Taiwan
- proxy-groups.🇯🇵日本.proxies=[]proxyNames|日|日本|🇯🇵|川日|东京|大阪|泉日|埼玉|沪日|深日|[^-]日|JP|Japan
- proxy-groups.🇰🇷韩国.proxies=[]proxyNames|韩|韓|韩国|🇰🇷|KR|Korea|KOR|首尔
- proxy-groups.🇸🇬新加坡.proxies=[]proxyNames|新加坡|🇸🇬|坡|狮城|SG|Singapore
- proxy-groups.🇺🇸美国.proxies=[]proxyNames|美|美国|🇺🇸|波特兰|达拉斯|俄勒冈|凤凰城|费利蒙|硅谷|拉斯维加斯|洛杉矶|圣何塞|圣克拉拉|西雅图|芝加哥|US|United States
- proxy-groups.👨🎤其他.proxies=[]proxyNames|^[^香日台新韩美]*$ # 这个可以自定义,这个正则的意思是排除节点名字有“香日台新韩美”的节点。
- mixed-port=7890
# 为各个策略组添加一个DIRECT,避免机场节点无法匹配上面的正则筛选而导致配置出错。应该有其他办法避免,但是我不会。
- proxy-groups.🇭🇰香港.proxies.0+REJECT
- proxy-groups.🐳台湾.proxies.0+REJECT
- proxy-groups.🇯🇵日本.proxies.0+REJECT
- proxy-groups.🇰🇷韩国.proxies.0+REJECT
- proxy-groups.🇸🇬新加坡.proxies.0+REJECT
- proxy-groups.🇺🇸美国.proxies.0+REJECT
- proxy-groups.👨🎤其他.proxies.0+REJECT
# - proxy-groups.节点名字.proxies.0+DIRECT # 向指定分组第一个位置添加一个 DIRECT 节点名
# 一些可能用到的正则过滤节点示例,使分组更细致
# []proxyNames|a # 包含a
# []proxyNames|^(.*)(a|b)+(.*)$ # 包含a或b
# []proxyNames|^(?=.*a)(?=.*b).*$ # 包含a和b
# []proxyNames|^((?!b).)*a((?!b).)*$ # 包含a且不包含b
# []proxyNames|^((?!b|c).)*a((?!b|c).)*$ # 包含a且不包含b或c
# 更多正则教程,请看这里:https://deerchao.cn/tutorials/regex/regex.htm#top
# 添加规则
prepend-rules: # 规则由上往下遍历,如上面规则已经命中,则不再往下处理
- DOMAIN-SUFFIX,jdev.tw,🥷PROXY
- DOMAIN-SUFFIX,omnivore.app,🥷PROXY
- RULE-SET,youtube,🎎YouTube
- RULE-SET,netflix,📽Netflix
- RULE-SET,openai,🤖OpenAI
- RULE-SET,bing,🔍Bing
- RULE-SET,bilibiliintl,🛀Bilibiliintl
- RULE-SET,twitter,🦤Twitter
- RULE-SET,github,🥷PROXY
- RULE-SET,applications,DIRECT
- DOMAIN,clash.razord.top,DIRECT
- DOMAIN,yacd.haishan.me,DIRECT
- RULE-SET,private,DIRECT
- RULE-SET,reject,🚦AD
- RULE-SET,icloud,DIRECT #
- RULE-SET,apple,DIRECT # 这三个为国内可直连地址,如果希望走代理改为🥷PROXY
- RULE-SET,google,🚅Google #
- RULE-SET,googledrive,🚅Google #
- RULE-SET,googlesearch,🚅Google #
- RULE-SET,tld-not-cn,🥷PROXY
- RULE-SET,gfw,🥷PROXY
- RULE-SET,greatfire,🥷PROXY
- RULE-SET,telegramcidr,🥷PROXY
- RULE-SET,lancidr,DIRECT
- RULE-SET,cncidr,DIRECT
- GEOIP,,DIRECT
- GEOIP,CN,DIRECT
- RULE-SET,direct,DIRECT
- RULE-SET,proxy,🥷PROXY
- MATCH,👆SELECT # ⭐️⭐️规则之外的,在这里来修改是白名单模式还是黑名单模式,具体在“👆SELECT”选择代理或直连。
# 添加规则集
# DOMAIN-SUFFIX:域名后缀匹配
# DOMAIN:域名匹配
# DOMAIN-KEYWORD:域名关键字匹配
# IP-CIDR:IP段匹配
# SRC-IP-CIDR:源IP段匹配
# GEOIP:GEOIP数据库(国家代码)匹配
# DST-PORT:目标端口匹配
# SRC-PORT:源端口匹配
# PROCESS-NAME:源进程名匹配
# RULE-SET:Rule Provider规则匹配
# MATCH:全匹配
# 添加规则集
mix-rule-providers:
reject: # 广告域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/reject.txt"
path: ./ruleset/reject.yaml
interval: 86400
icloud: # iCloud 域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/icloud.txt"
path: ./ruleset/icloud.yaml
interval: 86400
apple: # Apple 在中国大陆可直连的域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/apple.txt"
path: ./ruleset/apple.yaml
interval: 86400
google: # Google 在中国大陆可直连的域名列表
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Google/Google.yaml"
path: ./ruleset/google.yaml
interval: 86400
googledrive: #
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/GoogleDrive/GoogleDrive.yaml"
path: ./ruleset/googledrive.yaml
interval: 86400
googlesearch: #
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/GoogleSearch/GoogleSearch.yaml"
path: ./ruleset/googlesearch.yaml
interval: 86400
proxy: # 代理域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/proxy.txt"
path: ./ruleset/proxy.yaml
interval: 86400
direct: # 直连域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/direct.txt"
path: ./ruleset/direct.yaml
interval: 86400
private: # 私有网络专用域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/private.txt"
path: ./ruleset/private.yaml
interval: 86400
gfw: # GFWList 域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/gfw.txt"
path: ./ruleset/gfw.yaml
interval: 86400
greatfire: # GreatFire 域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/greatfire.txt"
path: ./ruleset/greatfire.yaml
interval: 86400
tld-not-cn: # 非中国大陆使用的顶级域名列表
type: http
behavior: domain
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/tld-not-cn.txt"
path: ./ruleset/tld-not-cn.yaml
interval: 86400
telegramcidr: # Telegram 使用的 IP 地址列表
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/telegramcidr.txt"
path: ./ruleset/telegramcidr.yaml
interval: 86400
cncidr: # 中国大陆 IP 地址列表
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/cncidr.txt"
path: ./ruleset/cncidr.yaml
interval: 86400
lancidr: # 局域网 IP 及保留 IP 地址列表
type: http
behavior: ipcidr
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/lancidr.txt"
path: ./ruleset/lancidr.yaml
interval: 86400
applications: # 需要直连的常见软件列表
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/Loyalsoldier/clash-rules@release/applications.txt"
path: ./ruleset/applications.yaml
interval: 86400
netflix: # 奈飞的分流规则
type: http
behavior: classical
url: "https://raw.githubusercontent.com/blackmatrix7/ios_rule_script/release/rule/Clash/Netflix/Netflix.yaml"
path: ./ruleset/netflix.yaml
interval: 86400
bing: # Bing的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Bing/Bing.yaml"
path: ./ruleset/bing.yaml
interval: 86400
openai: # OpenAI的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/OpenAI/OpenAI.yaml"
path: ./ruleset/openai.yaml
interval: 86400
youtube: # YouTube的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/YouTube/YouTube.yaml"
path: ./ruleset/youtube.yaml
interval: 86400
bilibiliintl: # BiliBiliIntl的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/BiliBiliIntl/BiliBiliIntl.yaml"
path: ./ruleset/bilibiliintl.yaml
interval: 86400
twitter: # twitter的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/Twitter/Twitter.yaml"
path: ./ruleset/twitter.yaml
interval: 86400
github: # github的分流规则
type: http
behavior: classical
url: "https://cdn.jsdelivr.net/gh/blackmatrix7/ios_rule_script@master/rule/Clash/GitHub/GitHub.yaml"
path: ./ruleset/github.yaml
interval: 86400