From 446a5d715039ae9bc3f50153a488c83b83e00bf4 Mon Sep 17 00:00:00 2001 From: mercury Date: Mon, 9 Dec 2024 13:32:25 +0400 Subject: [PATCH] mihomo: rule-providers add format --- app/bot.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/bot.php b/app/bot.php index d47f7a0..50c4626 100644 --- a/app/bot.php +++ b/app/bot.php @@ -6165,15 +6165,17 @@ DNS-over-HTTPS with IP: foreach ($p['rulessetlist'] as $k => $v) { if (!empty($v)) { [$type, $behavior, $time, $url] = explode(':', $k, 4); - if (preg_match('~\.(?:mrs|yaml|yml)$~', $url)) { + if (preg_match('~\.(mrs|yaml|yml)$~', $url, $m)) { $c['rule-providers'][$url] = [ 'type' => 'http', 'url' => $url, 'interval' => (int) $time, 'behavior' => $behavior, + 'format' => $m[1], ]; switch ($type) { case 'reject': + case 'REJECT': array_unshift($c['rules'], [ 'RULE-SET', $url, strtoupper($type) ]);