Compare commits

...
Author SHA1 Message Date
488f022c05 feat(media-unlock): add Muse AI (muse.ai) detection (#8411)
* feat(media-unlock): add Muse AI detection

muse.ai redirects every region to Meta's aymh anti-bot gateway before the app loads, and a plain HTTP client cannot finish the JavaScript challenge. Report the result as a new Risky status (exit reachable, availability unverifiable) together with the exit region instead of a misleading Yes/No.

Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>

* style(media-unlock): apply rustfmt and biome formatting

Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>

* docs(changelog): Update changelog

Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>

---------

Signed-off-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>
Co-authored-by: susu-Sugar <214122492+susu-Sugar@users.noreply.github.com>
Co-authored-by: ❤是纱雾酱哟~ <49941141+Dragon1573@users.noreply.github.com>
2026-10-26 17:17:09 +00:00
Ekko82 eefd025806 feat(home): add an IP auto-refresh toggle (#8403) 2026-10-26 02:04:55 +00:00
19 changed files with 110 additions and 11 deletions
+2
View File
@@ -18,6 +18,8 @@
<summary><strong> ✨ 新增功能 </strong></summary>
- 新增虚拟网卡设置的「DNS 模式」选项,支持配置 mihomo 系统 DNS 行为
- 新增「IP 信息」自动刷新开关,关闭后仍可手动刷新
- 新增 Muse AI 解锁检测,针对 Muse AI 特有的 Cloudflare 人机验证增加「Risky」状态标记
</details>
@@ -11,6 +11,7 @@ mod chatgpt;
mod claude;
mod disney_plus;
mod gemini;
mod muse;
mod netflix;
mod prime_video;
mod spotify;
@@ -30,6 +31,7 @@ enum UnlockCheck {
ChatGptWeb,
Claude,
Gemini,
MuseAi,
YouTubePremium,
BahamutAnime,
Netflix,
@@ -46,6 +48,7 @@ impl UnlockCheck {
Self::ChatGptWeb,
Self::Claude,
Self::Gemini,
Self::MuseAi,
Self::YouTubePremium,
Self::BahamutAnime,
Self::Netflix,
@@ -66,6 +69,7 @@ impl UnlockCheck {
Self::ChatGptWeb => chatgpt::CHATGPT_WEB_NAME,
Self::Claude => claude::CLAUDE_NAME,
Self::Gemini => gemini::GEMINI_NAME,
Self::MuseAi => muse::MUSE_AI_NAME,
Self::YouTubePremium => youtube::YOUTUBE_PREMIUM_NAME,
Self::BahamutAnime => bahamut::BAHAMUT_ANIME_NAME,
Self::Netflix => netflix::NETFLIX_NAME,
@@ -83,6 +87,7 @@ impl UnlockCheck {
Self::ChatGptWeb => chatgpt::check_chatgpt(client).await,
Self::Claude => claude::check_claude(client).await,
Self::Gemini => gemini::check_gemini(client).await,
Self::MuseAi => muse::check_muse_ai(client).await,
Self::YouTubePremium => youtube::check_youtube_premium(client).await,
Self::BahamutAnime => bahamut::check_bahamut_anime(client).await,
Self::Netflix => netflix::check_netflix(client).await,
@@ -0,0 +1,48 @@
use reqwest::Client;
use crate::utils::{classify_restricted_status, get_trace_location};
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));
let Ok(response) = client.get(MUSE_URL).send().await else {
return UnlockItem::checked(MUSE_AI_NAME, "Failed (Network Connection)", region);
};
let status = response.status();
let landed_on_aymh = response.url().host_str() == Some("auth.muse.ai");
let body = response.text().await.unwrap_or_default();
// Every region is redirected to the aymh anti-bot gateway before the app
// loads, and a non-browser HTTP client cannot finish the JavaScript
// challenge. It returns the Meta error page, so reaching this point only
// proves the exit can connect to Muse's auth infrastructure; availability
// cannot be verified over plain HTTP and is reported as `Risky`.
let behind_anti_bot = landed_on_aymh || AYMH_ERROR_MARKERS.iter().any(|marker| body.contains(marker));
let result = if behind_anti_bot {
"Risky"
} else if status.is_success() {
"Yes"
} else {
classify_restricted_status(status).unwrap_or("Failed")
};
UnlockItem::checked(MUSE_AI_NAME, result, region)
}
+37 -9
View File
@@ -4,10 +4,19 @@ import {
VisibilityOffOutlined,
VisibilityOutlined,
} from '@mui/icons-material'
import { Box, Button, IconButton, Skeleton, Typography } from '@mui/material'
import {
Box,
Button,
FormControlLabel,
IconButton,
Skeleton,
Switch,
Typography,
} from '@mui/material'
import { getCurrentWebviewWindow } from '@tauri-apps/api/webviewWindow'
import { useEffect } from 'foxact/use-abortable-effect'
import { useIntersection } from 'foxact/use-intersection'
import { useLocalStorage } from 'foxact/use-local-storage'
import type { XOR } from 'foxts/ts-xor'
import {
forwardRef,
@@ -99,9 +108,13 @@ const IPInfoCardContainer = forwardRef<HTMLElement, React.PropsWithChildren>(
export const IpInfoCard = () => {
const { t } = useTranslation()
const [showIp, setShowIp] = useState(false)
const [autoRefresh, setAutoRefresh] = useLocalStorage(
'ip-info-auto-refresh',
true,
)
const appWindow = useMemo(() => getCurrentWebviewWindow(), [])
// Once intersected, refreshes stay enabled until unmount.
// Once intersected, the card stays eligible for refresh until unmount.
const [containerRef, hasIntersected, _resetIntersected] = useIntersection({
rootMargin: '0px',
})
@@ -151,6 +164,8 @@ export const IpInfoCard = () => {
})
useEffect(() => {
if (!autoRefresh) return
let timer: number | null = null
// Prefer DOM intersection state; Tauri visibility is unreliable on some platforms.
@@ -190,7 +205,7 @@ export const IpInfoCard = () => {
if (timer != null) clearInterval(timer)
document.removeEventListener('visibilitychange', onVisibilityChange)
}
}, [hasIntersected])
}, [autoRefresh, hasIntersected])
const toggleShowIp = useCallback(() => {
setShowIp((prev) => !prev)
@@ -364,12 +379,25 @@ export const IpInfoCard = () => {
fontSize: '0.7rem',
}}
>
<Typography variant="caption">
{t('home.components.ipInfo.labels.autoRefresh')}
{countdown.type === 'countdown'
? `: ${countdown.remainingSeconds}s`
: '...'}
</Typography>
<FormControlLabel
sx={{ m: 0 }}
control={
<Switch
size="small"
checked={autoRefresh}
onChange={(_, checked) => setAutoRefresh(checked)}
/>
}
label={
<Typography variant="caption">
{t('home.components.ipInfo.labels.autoRefresh')}
{autoRefresh &&
(countdown.type === 'countdown'
? `: ${countdown.remainingSeconds}s`
: '...')}
</Typography>
}
/>
<Typography
variant="caption"
sx={{
+1
View File
@@ -36,6 +36,7 @@
"yes": "Yes",
"no": "No",
"failed": "Failed",
"risky": "غير مؤكد",
"completed": "Completed",
"disallowedIsp": "Disallowed ISP",
"originalsOnly": "Originals Only",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Unterstützt",
"no": "Nicht unterstützt",
"failed": "Test fehlgeschlagen",
"risky": "Ungewiss",
"completed": "Prüfung abgeschlossen",
"disallowedIsp": "Nicht zugelassener Internetdienstanbieter",
"originalsOnly": "Nur Original",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Yes",
"no": "No",
"failed": "Failed",
"risky": "Risky",
"completed": "Completed",
"disallowedIsp": "Disallowed ISP",
"originalsOnly": "Originals Only",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Soportado",
"no": "No soportado",
"failed": "Prueba fallida",
"risky": "Dudoso",
"completed": "Detección completada",
"disallowedIsp": "Proveedor de servicios de Internet no permitido",
"originalsOnly": "Solo originales",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Yes",
"no": "No",
"failed": "Failed",
"risky": "نامشخص",
"completed": "Completed",
"disallowedIsp": "Disallowed ISP",
"originalsOnly": "Originals Only",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Yes",
"no": "No",
"failed": "Failed",
"risky": "Tidak pasti",
"completed": "Completed",
"disallowedIsp": "Disallowed ISP",
"originalsOnly": "Originals Only",
+1
View File
@@ -36,6 +36,7 @@
"yes": "サポートする",
"no": "サポートしない",
"failed": "テストに失敗しました。",
"risky": "要確認",
"completed": "検査完了",
"disallowedIsp": "許可されていないインターネットサービスプロバイダー",
"originalsOnly": "オリジナルのみ",
+1
View File
@@ -36,6 +36,7 @@
"yes": "예",
"no": "아니오",
"failed": "실패",
"risky": "확인 필요",
"completed": "완료",
"disallowedIsp": "허용되지 않는 ISP",
"originalsOnly": "오리지널만",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Sim",
"no": "Não",
"failed": "Falhou",
"risky": "Incerto",
"completed": "Concluído",
"disallowedIsp": "ISP não permitido",
"originalsOnly": "Somente originais",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Да",
"no": "Нет",
"failed": "Ошибка",
"risky": "Неясно",
"completed": "Завершено",
"disallowedIsp": "Провайдер заблокирован",
"originalsOnly": "Только Originals",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Evet",
"no": "Hayır",
"failed": "Başarısız",
"risky": "Belirsiz",
"completed": "Tamamlandı",
"disallowedIsp": "İzin Verilmeyen ISP",
"originalsOnly": "Yalnızca Orijinaller",
+1
View File
@@ -36,6 +36,7 @@
"yes": "Yes",
"no": "No",
"failed": "Failed",
"risky": "Билгесез",
"completed": "Completed",
"disallowedIsp": "Disallowed ISP",
"originalsOnly": "Originals Only",
+1
View File
@@ -36,6 +36,7 @@
"yes": "支持",
"no": "不支持",
"failed": "测试失败",
"risky": "存疑",
"completed": "检测完成",
"disallowedIsp": "不允许的 ISP",
"originalsOnly": "仅限原创",
+1
View File
@@ -36,6 +36,7 @@
"yes": "支援",
"no": "不支援",
"failed": "測試失敗",
"risky": "存疑",
"completed": "檢測完成",
"disallowedIsp": "不允許的網際網路服務供應商",
"originalsOnly": "僅限原創",
+4 -2
View File
@@ -40,6 +40,7 @@ const STATUS_LABEL_KEYS: Record<string, string> = {
Yes: 'tests.statuses.test.yes',
No: 'tests.statuses.test.no',
Failed: 'tests.statuses.test.failed',
Risky: 'tests.statuses.test.risky',
Completed: 'tests.statuses.test.completed',
'Disallowed ISP': 'tests.statuses.test.disallowedIsp',
'Originals Only': 'tests.statuses.test.originalsOnly',
@@ -196,7 +197,7 @@ const UnlockPage = () => {
if (status === 'Pending') return 'default'
if (status === 'Yes') return 'success'
if (status === 'No') return 'error'
if (status === 'Soon') return 'warning'
if (status === 'Soon' || status === 'Risky') return 'warning'
if (status.includes('Failed')) return 'error'
if (status === 'Completed') return 'info'
if (
@@ -222,7 +223,8 @@ const UnlockPage = () => {
const getStatusBorderColor = (status: string) => {
if (status === 'Yes') return theme.palette.success.main
if (status === 'No') return theme.palette.error.main
if (status === 'Soon') return theme.palette.warning.main
if (status === 'Soon' || status === 'Risky')
return theme.palette.warning.main
if (status.includes('Failed')) return theme.palette.error.main
if (status === 'Completed') return theme.palette.info.main
return theme.palette.divider