From 3f7af9ab022d04ebc45d96b56b58cd67e90fe90d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E6=B5=B7?= Date: Thu, 19 Nov 2026 01:24:54 +0000 Subject: [PATCH] fix(media-unlock): avoid misleading region for Muse AI in Rule mode (#8685) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(media-unlock): avoid misleading region from cloudflare trace for Muse AI Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> * chore(changelog): append missing statements - Simply express what has changed in `Changelog.md` Assisted-by: MAI Code 2 (high) Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --------- Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com> --- Changelog.md | 1 + crates/clash-verge-media-unlock/src/muse.rs | 17 ++++++----------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Changelog.md b/Changelog.md index 45468e082..51c123c80 100644 --- a/Changelog.md +++ b/Changelog.md @@ -38,6 +38,7 @@ - 修复「连接」页表格排序时表头换行、标题位置跳动 - 修复「TUN 设置」未手动保存时,界面显示的默认 MTU 1500 未生效 - 修复「链式代理」节点列表按名称排序,未保持订阅中的节点顺序 +- 修复规则模式下 Muse AI 解锁检测显示错误的出口地区 **🍎 macOS** diff --git a/crates/clash-verge-media-unlock/src/muse.rs b/crates/clash-verge-media-unlock/src/muse.rs index c9dc23cbc..254cb5cf2 100644 --- a/crates/clash-verge-media-unlock/src/muse.rs +++ b/crates/clash-verge-media-unlock/src/muse.rs @@ -1,28 +1,23 @@ use reqwest::Client; -use crate::utils::{classify_restricted_status, get_trace_location}; +use crate::utils::classify_restricted_status; use super::UnlockItem; pub(crate) const MUSE_AI_NAME: &str = "Muse AI"; const MUSE_URL: &str = "https://muse.ai"; -const CLOUDFLARE_TRACE_URL: &str = "https://www.cloudflare.com/cdn-cgi/trace"; // The aymh ("Are You a Human") gateway answers plain HTTP requests with a // generic Meta error page that always contains the Facebook logo asset. const AYMH_ERROR_MARKERS: &[&str] = &["Sorry, something went wrong", "static.facebook.com/images/logos"]; pub(super) async fn check_muse_ai(client: &Client) -> UnlockItem { - // muse.ai itself is served by Vercel, so resolve the exit region through - // the generic Cloudflare trace endpoint instead of a service-specific one. - let region = get_trace_location(client, CLOUDFLARE_TRACE_URL) - .await - .map(|code| code.trim().to_ascii_uppercase()) - .map(|code| UnlockItem::region_label(&code)); - + // muse.ai is served by Vercel and does not expose a service-specific region trace endpoint. + // Querying a generic third-party domain (e.g. www.cloudflare.com/cdn-cgi/trace) would report + // that domain's proxy group rather than muse.ai's actual exit in Rule mode, so leave region as None. let Ok(response) = client.get(MUSE_URL).send().await else { - return UnlockItem::checked(MUSE_AI_NAME, "Failed (Network Connection)", region); + return UnlockItem::checked(MUSE_AI_NAME, "Failed (Network Connection)", None); }; let status = response.status(); @@ -44,5 +39,5 @@ pub(super) async fn check_muse_ai(client: &Client) -> UnlockItem { classify_restricted_status(status).unwrap_or("Failed") }; - UnlockItem::checked(MUSE_AI_NAME, result, region) + UnlockItem::checked(MUSE_AI_NAME, result, None) }