@@ -107,6 +107,7 @@ async function downloadSubscription(req, res) {
107107 noCache,
108108 _fakeNode,
109109 } = req . query ;
110+ const prettyYaml = req . query . prettyYaml ?? req . query [ 'pretty-yaml' ] ;
110111
111112 let $options = {
112113 _req : {
@@ -169,6 +170,9 @@ async function downloadSubscription(req, res) {
169170 `包含官方/商店版/未续费订阅不支持的协议: ${ includeUnsupportedProxy } ` ,
170171 ) ;
171172 }
173+ if ( prettyYaml ) {
174+ $ . info ( `指定输出易读 YAML: ${ prettyYaml } ` ) ;
175+ }
172176
173177 if ( useMihomoExternal ) {
174178 $ . info ( `手动指定了 target 为 SurgeMac, 将使用 Mihomo External` ) ;
@@ -208,6 +212,7 @@ async function downloadSubscription(req, res) {
208212 produceOpts : {
209213 'include-unsupported-proxy' : includeUnsupportedProxy ,
210214 useMihomoExternal,
215+ prettyYaml,
211216 } ,
212217 $options,
213218 proxy,
@@ -415,6 +420,7 @@ async function downloadCollection(req, res) {
415420 proxy,
416421 noCache,
417422 } = req . query ;
423+ const prettyYaml = req . query . prettyYaml ?? req . query [ 'pretty-yaml' ] ;
418424
419425 let $options = {
420426 _req : {
@@ -463,6 +469,9 @@ async function downloadCollection(req, res) {
463469 `包含官方/商店版/未续费订阅不支持的协议: ${ includeUnsupportedProxy } ` ,
464470 ) ;
465471 }
472+ if ( prettyYaml ) {
473+ $ . info ( `指定输出易读 YAML: ${ prettyYaml } ` ) ;
474+ }
466475
467476 if ( useMihomoExternal ) {
468477 $ . info ( `手动指定了 target 为 SurgeMac, 将使用 Mihomo External` ) ;
@@ -482,6 +491,7 @@ async function downloadCollection(req, res) {
482491 produceOpts : {
483492 'include-unsupported-proxy' : includeUnsupportedProxy ,
484493 useMihomoExternal,
494+ prettyYaml,
485495 } ,
486496 $options,
487497 proxy,
0 commit comments