forked from peter123456789/SS-SSR-TG-iptables-bt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Subconverter.vue
933 lines (931 loc) · 36.9 KB
/
Subconverter.vue
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
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
<template>
<div>
<el-row style="margin-top: 10px">
<el-col>
<el-card>
<div slot="header">
<svg-icon class="gayhub" icon-class="github" style="float:left" @click="goToProject" />
<svg-icon class="dianbao" icon-class="telegram" style="float:left;margin-left: 10px" @click="gotoTgChannel" />
<svg-icon class="bilibili" icon-class="bilibili" style="float:right;margin-left:10px" @click="gotoBiliBili" />
<svg-icon class="youguan" icon-class="youtube" style="float:right;margin-left:10px" @click="gotoYouTuBe" />
<div style="text-align:center;font-size:15px">
订 阅 转 换
</div>
</div>
<el-container>
<el-form :model="form" label-width="80px" label-position="left" style="width: 100%">
<el-form-item label="订阅链接:">
<el-input v-model="form.sourceSubUrl" type="textarea" rows="3" placeholder="支持各种订阅链接或单节点链接,多个链接每行一个或用 | 分隔" />
</el-form-item>
<el-form-item label="生成类型:">
<el-select v-model="form.clientType" style="width: 100%">
<el-option v-for="(v, k) in options.clientTypes" :key="k" :label="k" :value="v"></el-option>
</el-select>
</el-form-item>
<el-form-item label="选择配置:">
<el-select v-model="form.remoteConfig" allow-create="" filterable="" placeholder="请选择" style="width: 100%">
<el-option-group v-for="group in options.remoteConfig" :key="group.label" :label="group.label">
<el-option v-for="item in group.options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-option-group>
<el-button slot="append" @click="gotoRemoteConfig" icon="el-icon-link">
配置示例
</el-button>
</el-select>
</el-form-item>
<el-form-item label-width="0px">
<el-collapse>
<el-collapse-item>
<template slot="title">
<el-form-item label="高级功能:" style="width: 100%;">
<el-button type="limr" style="width: 100%;">
点击显示/隐藏
</el-button>
</el-form-item>
</template>
<el-form-item label="包含节点:">
<el-input v-model="form.includeRemarks" placeholder="要保留的节点,支持正则" />
</el-form-item>
<el-form-item label="排除节点:">
<el-input v-model="form.excludeRemarks" placeholder="要排除的节点,支持正则" />
</el-form-item>
<el-form-item label="节点命名:">
<el-input v-model="form.rename" placeholder="举例:`香港@菲律宾``美国@巴西``台湾@俄罗斯`..." />
</el-form-item>
<el-form-item label="订阅命名:">
<el-input v-model="form.filename" placeholder="返回的订阅文件名" />
</el-form-item>
<el-form-item class="eldiy" label-width="0px">
<el-row type="flex">
<el-col>
<el-checkbox v-model="form.nodeList" label="仅输出节点信息" border=""></el-checkbox>
</el-col>
<el-popover placement="bottom" v-model="form.extraset">
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.emoji" label="Emoji"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.insert" label="网易云"></el-checkbox>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.udp" label="启用 UDP"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.sort" label="排序节点"></el-checkbox>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.tfo" label="启用 TFO"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.tpl.surge.doh" label="Surge.DoH"></el-checkbox>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.appendType" label="插入节点类型"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.tpl.clash.doh" label="Clash.DoH"></el-checkbox>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.expand" label="展开规则全文"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.new_name" label="Clash新字段名"></el-checkbox>
</el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-checkbox v-model="form.scv" label="跳过证书验证"></el-checkbox>
</el-col>
<el-col :span="12">
<el-checkbox v-model="form.fdn" label="过滤不支持节点"></el-checkbox>
</el-col>
</el-row>
<el-button slot="reference">
更多选项
</el-button>
</el-popover>
</el-row>
</el-form-item>
</el-collapse-item>
</el-collapse>
</el-form-item>
<div style="margin-top: 30px"></div>
<el-divider content-position="center">
<el-button type="zhuti" @click="change">
<i id="rijian" class="el-icon-sunny"></i>
<i id="yejian" class="el-icon-moon"></i>
</el-button>
</el-divider>
<el-form-item label="定制订阅:">
<el-input class="copy-content" disabled="" v-model="customSubUrl">
<el-button slot="append" v-clipboard:copy="customSubUrl" v-clipboard:success="onCopy" ref="copy-btn" icon="el-icon-document-copy">
复制
</el-button>
</el-input>
</el-form-item>
<el-form-item label-width="0px" style="margin-top: 40px; text-align: center">
<el-button style="width: 140px" type="danger" @click="makeUrl" :disabled="form.sourceSubUrl.length === 0">
生成订阅链接
</el-form-item>
</el-form>
</el-container>
</el-card>
</el-col>
</el-row>
<el-dialog :visible.sync="dialogUploadConfigVisible" :show-close="false" :close-on-click-modal="false" :close-on-press-escape="false" width="80%">
<div slot="title">
Remote config upload
<el-popover trigger="hover" placement="right" style="margin-left: 10px">
<el-link type="primary" :href="sampleConfig" target="_blank" icon="el-icon-info">
参考配置
</el-link>
<i class="el-icon-question" slot="reference"></i>
</el-popover>
</div>
<el-form label-position="left">
<el-form-item prop="uploadConfig">
<el-input v-model="uploadConfig" type="textarea" :autosize="{ minRows: 15, maxRows: 15}" maxlength="10000" show-word-limit=""></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="uploadConfig = ''; dialogUploadConfigVisible = false">
取 消
</el-button>
<el-button type="primary" @click="confirmUploadConfig" :disabled="uploadConfig.length === 0">
确 定
</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
const project = process.env.VUE_APP_PROJECT
const remoteConfigSample = process.env.VUE_APP_SUBCONVERTER_REMOTE_CONFIG
const gayhubRelease = process.env.VUE_APP_BACKEND_RELEASE
const defaultBackend = process.env.VUE_APP_SUBCONVERTER_DEFAULT_BACKEND + '/sub?'
const shortUrlBackend = process.env.VUE_APP_MYURLS_DEFAULT_BACKEND + '/short'
const configUploadBackend = process.env.VUE_APP_CONFIG_UPLOAD_BACKEND + '/config/upload'
const tgBotLink = process.env.VUE_APP_BOT_LINK
const yglink = process.env.VUE_APP_YOUTUBE_LINK
const bzlink = process.env.VUE_APP_BILIBILI_LINK
const downld = process.env.VUE_APP_CFA
const bmvideo = process.env.VUE_APP_VIDEO
export default {
data() {
return {
backendVersion: "",
advanced: "2",
// 是否为 PC 端
isPC: true,
options: {
clientTypes: {
Clash: "clash",
Surge2: "surge&ver=2",
Surge3: "surge&ver=3",
Surge4: "surge&ver=4",
V2Ray: "v2ray",
Trojan: "trojan",
ShadowsocksR: "ssr",
"混合订阅(mixed)": "mixed",
Surfboard: "surfboard",
Quantumult: "quan",
"Quantumult X": "quanx",
Loon: "loon",
Mellow: "mellow",
ClashR: "clashr",
"Shadowsocks(SIP002)": "ss",
"Shadowsocks Android(SIP008)": "sssub",
ShadowsocksD: "ssd",
"自动判断客户端": "auto",
},
shortTypes: {
"dl.danshui.life":"http://127.0.0.2:25500/short",
},
customBackend: {
"本地增强型后端": "http://127.0.0.1:25500/sub?",
},
backendOptions: [
{ value: "http://127.0.0.1:25500/sub?" },
],
remoteConfig: [
{
label: "通用",
options: [
{
label: "默认(负载均衡)",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini"
}
]
},
{
label: "ACL规则",
options: [
{
label: "Clash默认规则",
value: ""
},
{
label: "索尼电视专用",
value: "https://raw.githubusercontent.com/youshandefeiyang/webcdn/main/SONY.ini"
},
{
label: "附带用于 Clash 的 AdGuard DNS",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/default_with_clash_adg.yml"
},
{
label: "ACL_默认版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online.ini"
},
{
label: "ACL_无测速版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoAuto.ini"
},
{
label: "ACL_去广告版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_AdblockPlus.ini"
},
{
label: "ACL_多国家版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_MultiCountry.ini"
},
{
label: "ACL_无Reject版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_NoReject.ini"
},
{
label: "ACL_无测速精简版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_NoAuto.ini"
},
{
label: "ACL_全分组版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full.ini"
},
{
label: "ACL_全分组谷歌版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Google.ini"
},
{
label: "ACL_全分组多模式版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_MultiMode.ini"
},
{
label: "ACL_全分组奈飞版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Netflix.ini"
},
{
label: "ACL_全分组无测速版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_NoAuto.ini"
},
{
label: "Online_Mini_精简版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini.ini"
},
{
label: "ACL_去广告精简版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_AdblockPlus.ini"
},
{
label: "Online_Mini_Fallback",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_Fallback.ini"
},
{
label: "Online_Mini_MultiCountry",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiCountry.ini"
},
{
label: "Online_Mini_MultiMode版",
value: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Mini_MultiMode.ini"
}
]
},
{
label: "全网搜集规则",
options: [
{
label: "常规规则",
value: "https://raw.githubusercontent.com/flyhigherpi/merlinclash_clash_related/master/Rule_config/ZHANG.ini"
},
{
label: "分区域故障转移",
value: "https://raw.githubusercontent.com/flyhigherpi/merlinclash_clash_related/master/Rule_config/ZHANG_Area_Fallback.ini"
},
{
label: "分区域自动测速",
value: "https://raw.githubusercontent.com/flyhigherpi/merlinclash_clash_related/master/Rule_config/ZHANG_Area_Urltest.ini"
},
{
label: "分区域无自动测速",
value: "https://raw.githubusercontent.com/flyhigherpi/merlinclash_clash_related/master/Rule_config/ZHANG_Area_NoAuto.ini"
},
{
label: "OoHHHHHHH",
value: "https://raw.githubusercontent.com/OoHHHHHHH/ini/master/config.ini"
},
{
label: "CFW-TAP",
value: "https://raw.githubusercontent.com/OoHHHHHHH/ini/master/cfw-tap.ini"
},
{
label: "lhl77全分组(定期更新)",
value: "https://raw.githubusercontent.com/lhl77/sub-ini/main/tsutsu-full.ini"
},
{
label: "lhl77简易版(定期更新)",
value: "https://raw.githubusercontent.com/lhl77/sub-ini/main/tsutsu-mini-gfw.ini"
},
{
label: "ConnersHua 神机规则 Outbound",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_new.ini"
},
{
label: "ConnersHua 神机规则 Inbound 回国专用",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/connershua_backtocn.ini"
},
{
label: "lhie1 洞主规则(使用 Clash 分组规则)",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_clash.ini"
},
{
label: "lhie1 洞主规则完整版",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/lhie1_dler.ini"
},
{
label: "eHpo1 规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/ehpo1_main.ini"
},
{
label: "多策略组默认白名单模式",
value: "https://raw.nameless13.com/api/public/dl/ROzQqi2S/white.ini"
},
{
label: "多策略组可以有效减少审计触发",
value: "https://raw.nameless13.com/api/public/dl/ptLeiO3S/mayinggfw.ini"
},
{
label: "精简策略默认白名单",
value: "https://raw.nameless13.com/api/public/dl/FWSh3dXz/easy3.ini"
},
{
label: "多策略增加SMTP策略",
value: "https://raw.nameless13.com/api/public/dl/L_-vxO7I/youtube.ini"
},
{
label: "无策略入门推荐",
value: "https://raw.nameless13.com/api/public/dl/zKF9vFbb/easy.ini"
},
{
label: "无策略入门推荐国家分组",
value: "https://raw.nameless13.com/api/public/dl/E69bzCaE/easy2.ini"
},
{
label: "无策略仅IPIP CN + Final",
value: "https://raw.nameless13.com/api/public/dl/XHr0miMg/ipip.ini"
},
{
label: "无策略魅影vip分组",
value: "https://raw.nameless13.com/api/public/dl/BBnfb5lD/MAYINGVIP.ini"
},
{
label: "品云专属配置(仅香港区域分组)",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/Examine.ini"
},
{
label: "品云专属配置(全地域分组)",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/Examine_Full.ini"
},
{
label: "nzw9314 规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/nzw9314_custom.ini"
},
{
label: "maicoo-l 规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/maicoo-l_custom.ini"
},
{
label: "DlerCloud Platinum 李哥定制规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/dlercloud_lige_platinum.ini"
},
{
label: "DlerCloud Gold 李哥定制规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/dlercloud_lige_gold.ini"
},
{
label: "DlerCloud Silver 李哥定制规则",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/dlercloud_lige_silver.ini"
},
{
label: "ProxyStorage自用",
value: "https://raw.githubusercontent.com/ProxyStorage/For-Own-Use/master/Clash/clash.ini"
},
{
label: "ACL_全分组 Dream修改版",
value: "https://raw.githubusercontent.com/WC-Dream/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_Dream.ini"
}
]
},
{
label: "各大机场规则",
options: [
{
label: "EXFLUX",
value:
"https://gist.github.com/jklolixxs/16964c46bad1821c70fa97109fd6faa2/raw/EXFLUX.ini"
},
{
label: "NaNoport",
value:
"https://gist.github.com/jklolixxs/32d4e9a1a5d18a92beccf3be434f7966/raw/NaNoport.ini"
},
{
label: "CordCloud",
value:
"https://gist.github.com/jklolixxs/dfbe0cf71ffc547557395c772836d9a8/raw/CordCloud.ini"
},
{
label: "BigAirport",
value:
"https://gist.github.com/jklolixxs/e2b0105c8be6023f3941816509a4c453/raw/BigAirport.ini"
},
{
label: "跑路云",
value:
"https://gist.github.com/jklolixxs/9f6989137a2cfcc138c6da4bd4e4cbfc/raw/PaoLuCloud.ini"
},
{
label: "WaveCloud",
value:
"https://gist.github.com/jklolixxs/fccb74b6c0018b3ad7b9ed6d327035b3/raw/WaveCloud.ini"
},
{
label: "几鸡",
value:
"https://gist.github.com/jklolixxs/bfd5061dceeef85e84401482f5c92e42/raw/JiJi.ini"
},
{
label: "四季加速",
value:
"https://gist.github.com/jklolixxs/6ff6e7658033e9b535e24ade072cf374/raw/SJ.ini"
},
{
label: "ImmTelecom",
value:
"https://gist.github.com/jklolixxs/24f4f58bb646ee2c625803eb916fe36d/raw/ImmTelecom.ini"
},
{
label: "AmyTelecom",
value:
"https://gist.github.com/jklolixxs/b53d315cd1cede23af83322c26ce34ec/raw/AmyTelecom.ini"
},
{
label: "Miaona",
value:
"https://gist.github.com/jklolixxs/ff8ddbf2526cafa568d064006a7008e7/raw/Miaona.ini"
},
{
label: "Foo&Friends",
value:
"https://gist.github.com/jklolixxs/df8fda1aa225db44e70c8ac0978a3da4/raw/Foo&Friends.ini"
},
{
label: "ABCloud",
value:
"https://gist.github.com/jklolixxs/b1f91606165b1df82e5481b08fd02e00/raw/ABCloud.ini"
},
{
label: "咸鱼",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/xianyu.ini"
},
{
label: "便利店",
value: "https://subweb.oss-cn-hongkong.aliyuncs.com/RemoteConfig/customized/convenience.ini"
},
{
label: "CNIX",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/SSRcloud.ini"
},
{
label: "Nirvana",
value: "https://raw.githubusercontent.com/Mazetsz/ACL4SSR/master/Clash/config/V2rayPro.ini"
},
{
label: "V2Pro",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/V2Pro.ini"
},
{
label: "史迪仔-自动测速",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/Stitch.ini"
},
{
label: "史迪仔-负载均衡",
value: "https://raw.githubusercontent.com/Mazeorz/airports/master/Clash/Stitch-Balance.ini"
},
{
label: "Maying",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/maying.ini"
},
{
label: "Ytoo",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/ytoo.ini"
},
{
label: "w8ves",
value: "https://raw.nameless13.com/api/public/dl/M-We_Fn7/w8ves.ini"
},
{
label: "NyanCAT",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/nyancat.ini"
},
{
label: "Nexitally",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/nexitally.ini"
},
{
label: "SoCloud",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/socloud.ini"
},
{
label: "ARK",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/ark.ini"
},
{
label: "N3RO",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/n3ro_optimized.ini"
},
{
label: "Scholar",
value: "https://gist.githubusercontent.com/tindy2013/1fa08640a9088ac8652dbd40c5d2715b/raw/scholar_optimized.ini"
},
{
label: "Flowercloud",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/customized/flowercloud.ini"
}
]
},
{
label: "特殊",
options: [
{
label: "NeteaseUnblock",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/special/netease.ini"
},
{
label: "Basic",
value: "https://raw.githubusercontent.com/SleepyHeeead/subconverter-config/master/remote-config/special/basic.ini"
}
]
}
]
},
form: {
sourceSubUrl: "",
clientType: "",
customBackend: "http://127.0.0.1:25500/sub?",
shortType: "http://127.0.0.2:25500/short",
remoteConfig: "https://raw.githubusercontent.com/ACL4SSR/ACL4SSR/master/Clash/config/ACL4SSR_Online_Full_AdblockPlus.ini",
excludeRemarks: "",
includeRemarks: "",
filename: "",
rename: "",
emoji: true,
nodeList: false,
extraset: false,
sort: false,
udp: false,
tfo: false,
expand: true,
scv: false,
fdn: false,
appendType: false,
insert: false, // 是否插入默认订阅的节点,对应配置项 insert_url
new_name: true, // 是否使用 Clash 新字段
// tpl 定制功能
tpl: {
surge: {
doh: false // dns 查询是否使用 DoH
},
clash: {
doh: false
}
}
},
loading: false,
customSubUrl: "",
curtomShortSubUrl: "",
dialogUploadConfigVisible: false,
uploadConfig: "",
uploadPassword: "",
myBot: tgBotLink,
sampleConfig: remoteConfigSample
};
},
created() {
document.title = "在线订阅转换工具";
this.isPC = this.$getOS().isPc;
},
mounted() {
this.tanchuang();
this.form.clientType = "clash";
this.getBackendVersion();
this.anhei();
let lightMedia = window.matchMedia('(prefers-color-scheme: light)');
let darkMedia = window.matchMedia('(prefers-color-scheme: dark)');
let callback = (e) => {
if (e.matches) {
this.anhei();
}
};
if (typeof darkMedia.addEventListener === 'function'|| typeof lightMedia.addEventListener === 'function') {
lightMedia.addEventListener('change', callback);
darkMedia.addEventListener('change', callback);
} //监听系统主题,自动切换!
},
methods: {
selectChanged() {
this.getBackendVersion();
},
selectChanged2() {
if (this.form.shortType.indexOf("nfdy.top") !== -1 ) {
this.$message.success("该短链接为隐藏福利!")
}
},
anhei() {
const getLocalTheme = window.localStorage.getItem("localTheme");
const lightMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)');
const darkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)');
if (getLocalTheme) {
document.getElementsByTagName('body')[0].className = getLocalTheme;
} //读取localstorage,优先级最高!
else if (getLocalTheme == null || getLocalTheme == "undefined" || getLocalTheme == "") {
if (new Date().getHours() >= 19 || new Date().getHours() < 7) {
document.getElementsByTagName('body')[0].setAttribute('class', 'dark-mode');
}
else {
document.getElementsByTagName('body')[0].setAttribute('class', 'light-mode');
} //根据当前时间来判断,用来对付QQ等不支持媒体变量查询的浏览器
if (lightMode && lightMode.matches) {
document.getElementsByTagName('body')[0].setAttribute('class', 'light-mode');
}
if (darkMode && darkMode.matches) {
document.getElementsByTagName('body')[0].setAttribute('class', 'dark-mode');
} //根据窗口主题来判断当前主题!
}
},
change() {
var zhuti = document.getElementsByTagName('body')[0].className;
if (zhuti === 'light-mode'){
document.getElementsByTagName('body')[0].setAttribute('class', 'dark-mode');
window.localStorage.setItem('localTheme','dark-mode');
}
if (zhuti === 'dark-mode'){
document.getElementsByTagName('body')[0].setAttribute('class', 'light-mode');
window.localStorage.setItem('localTheme','light-mode');
}
},
tanchuang() {
},
onCopy() {
this.$message.success("短链已复制!");
},
goToProject() {
window.open(project);
},
gotoTgChannel() {
window.open(tgBotLink);
},
gotoGayhub() {
window.open(gayhubRelease);
},
gotoBiliBili() {
window.open(bzlink);
},
gotoYouTuBe() {
window.open(yglink);
},
cldown() {
window.open(downld);
},
gotoRemoteConfig() {
window.open(remoteConfigSample);
},
clashInstall() {
if (this.customSubUrl === "") {
this.$message.error("请先填写必填项,生成订阅链接");
return false;
}
const url = "clash://install-config?url=";
window.open(
url +
encodeURIComponent(
this.curtomShortSubUrl !== ""
? this.curtomShortSubUrl
: this.customSubUrl
)
);
},
surgeInstall() {
if (this.customSubUrl === "") {
this.$message.error("请先填写必填项,生成订阅链接");
return false;
}
const url = "surge://install-config?url=";
window.open(url + this.customSubUrl);
},
gotovideo() {
this.$alert("想说爱你好难!",{
type: "warning",
confirmButtonText: '确定',
customClass: 'msgbox',
showClose: false ,
})
.then(() => {
window.open(bmvideo);
});
},
makeUrl() {
if (this.form.sourceSubUrl === "" || this.form.clientType === "") {
this.$message.error("订阅链接与客户端为必填项");
return false;
}
if (this.form.sourceSubUrl.indexOf("losadhwse") !== -1 && (this.form.customBackend.indexOf("api.wcc.best") !== -1)) {
this.$alert("该后端屏蔽,请更换其他后端进行转换!",{
type: "warning",
confirmButtonText: '确定',
customClass: 'msgbox',
showClose: false ,
});
return false;
}
let backend =
this.form.customBackend === ""
? defaultBackend
: this.form.customBackend;
let sourceSub = this.form.sourceSubUrl;
sourceSub = sourceSub.replace(/(\n|\r|\n\r)/g, "|");
this.customSubUrl =
backend +
"target=" +
this.form.clientType +
"&url=" +
encodeURIComponent(sourceSub) +
"&insert=" +
this.form.insert;
if (this.advanced === "2") {
if (this.form.remoteConfig !== "") {
this.customSubUrl +=
"&config=" + encodeURIComponent(this.form.remoteConfig);
}
if (this.form.excludeRemarks !== "") {
this.customSubUrl +=
"&exclude=" + encodeURIComponent(this.form.excludeRemarks);
}
if (this.form.includeRemarks !== "") {
this.customSubUrl +=
"&include=" + encodeURIComponent(this.form.includeRemarks);
}
if (this.form.filename !== "") {
this.customSubUrl +=
"&filename=" + encodeURIComponent(this.form.filename);
}
if (this.form.rename !== "") {
this.customSubUrl +=
"&rename=" + encodeURIComponent(this.form.rename);
}
if (this.form.appendType) {
this.customSubUrl +=
"&append_type=" + this.form.appendType.toString();
}
this.customSubUrl +=
"&emoji=" +
this.form.emoji.toString() +
"&list=" +
this.form.nodeList.toString() +
"&udp=" +
this.form.udp.toString() +
"&tfo=" +
this.form.tfo.toString() +
"&expand=" +
this.form.expand.toString() +
"&scv=" +
this.form.scv.toString() +
"&fdn=" +
this.form.fdn.toString() +
"&sort=" +
this.form.sort.toString();
if (this.form.tpl.surge.doh === true) {
this.customSubUrl += "&surge.doh=true";
}
if (this.form.clientType === "clash") {
if (this.form.tpl.clash.doh === true) {
this.customSubUrl += "&clash.doh=true";
}
this.customSubUrl += "&new_name=" + this.form.new_name.toString();
}
}
this.$copyText(this.customSubUrl);
this.$message.success("定制订阅已复制到剪贴板");
},
makeShortUrl() {
if (this.customSubUrl === "") {
this.$message.warning("请先生成订阅链接,再获取对应短链接");
return false;
}
let duan =
this.form.shortType === ""
? shortUrlBackend
: this.form.shortType;
this.loading = true;
let data = new FormData();
data.append("longUrl", btoa(this.customSubUrl));
this.$axios
.post(duan, data, {
header: {
"Content-Type": "application/form-data; charset=utf-8"
}
})
.then(res => {
if (res.data.Code === 1 && res.data.ShortUrl !== "") {
this.curtomShortSubUrl = res.data.ShortUrl;
this.$copyText(res.data.ShortUrl);
this.$message.success("短链接已复制到剪贴板");
} else {
this.$message.error("短链接获取失败:" + res.data.Message);
}
})
.catch(() => {
this.$message.error("短链接获取失败");
})
.finally(() => {
this.loading = false;
});
},
confirmUploadConfig() {
if (this.uploadConfig === "") {
this.$message.warning("远程配置不能为空");
return false;
}
this.loading = true;
let data = new FormData();
data.append("password", this.uploadPassword);
data.append("config", this.uploadConfig);
this.$axios
.post(configUploadBackend, data, {
header: {
"Content-Type": "application/form-data; charset=utf-8"
}
})
.then(res => {
if (res.data.code === 0 && res.data.data.url !== "") {
this.$message.success(
"远程配置上传成功,配置链接已复制到剪贴板,有效期三个月望知悉"
);
// 自动填充至『表单-远程配置』
this.form.remoteConfig = res.data.data.url;
this.$copyText(this.form.remoteConfig);
this.dialogUploadConfigVisible = false;
} else {
this.$message.error("远程配置上传失败: " + res.data.msg);
}
})
.catch(() => {
this.$message.error("远程配置上传失败");
})
.finally(() => {
this.loading = false;
});
},
backendSearch(queryString, cb) {
let backends = this.options.backendOptions;
let results = queryString
? backends.filter(this.createFilter(queryString))
: backends;
// 调用 callback 返回建议列表的数据
cb(results);
},
createFilter(queryString) {
return candidate => {
return (
candidate.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
);
};
},
getBackendVersion() {
this.$axios
.get(
this.form.customBackend.substring(0, this.form.customBackend.length - 5) + "/version"
)
.then(res => {
this.backendVersion = res.data.replace(/backend\n$/gm, "");
this.backendVersion = this.backendVersion.replace("subconverter", "SubConverter");
})
}
}
};
</script>