Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: ligar o painel de causa raiz e as preferências de acessibilidade ao frontend (#220)

antoniofd5632c41249
diff --git a/scripts/shots.mjs b/scripts/shots.mjs
index 9a493238..3a9b57e4 100644
--- a/scripts/shots.mjs
+++ b/scripts/shots.mjs
@@ -14,7 +14,7 @@ import path from "node:path";
const PHASE = process.argv[2] && !process.argv[2].startsWith("--") ? process.argv[2] : "baseline";
const argOf = (name) => {
const a = process.argv.find((x) => x.startsWith(`--${name}=`));
- return a ? a.split("=")[1] : null;
+ return a ? a.slice(a.indexOf("=") + 1) : null;
};
const BASE = "http://localhost:1420";
@@ -180,6 +180,7 @@ const QUEUE = [
{ id: 1, url: "https://www.youtube.com/watch?v=live1", platform: "youtube", title: "Conference Keynote 2026 — Day 1 (4K)", status: { type: "Downloading" }, percent: 42.5, speed_bytes_per_sec: 11534336, downloaded_bytes: 891289600, total_bytes: 2097152000, file_path: null, file_size_bytes: null, file_count: null, thumbnail_url: null, eta_seconds: 105 },
{ id: 2, url: "https://www.twitch.tv/videos/222", platform: "twitch", title: "Speedrun VOD — GDQ finals", status: { type: "Queued" }, percent: 0, speed_bytes_per_sec: 0, downloaded_bytes: 0, total_bytes: null, file_path: null, file_size_bytes: null, file_count: null, thumbnail_url: null, eta_seconds: null },
{ id: 3, url: "https://www.bilibili.com/video/BV1xx", platform: "bilibili", title: "Lo-fi mix for late nights", status: { type: "Complete" }, percent: 100, speed_bytes_per_sec: 0, downloaded_bytes: 104857600, total_bytes: 104857600, file_path: "/Users/demo/Downloads/OmniGet/Bilibili/lofi.mp4", file_size_bytes: 104857600, file_count: 1, thumbnail_url: null, eta_seconds: null },
+ { id: 4, url: "https://www.youtube.com/watch?v=priv1", platform: "youtube", title: "Members-only masterclass", status: { type: "Error", data: "ERROR: [youtube] priv1: Private video. Sign in if you've been granted access" }, percent: 0, speed_bytes_per_sec: 0, downloaded_bytes: 0, total_bytes: null, file_path: null, file_size_bytes: null, file_count: null, thumbnail_url: null, eta_seconds: null },
];
const REGISTRY = [
@@ -235,6 +236,13 @@ function initScript(theme) {
case "check_plugin_updates": return [];
case "rpc_set_idle_stats": return null;
case "plugin_command": return null;
+ case "diagnose_download_error": {
+ const t = String(args.stderr || "").toLowerCase();
+ if (t.includes("private video") || t.includes("sign in")) {
+ return { cause_key: "error.cause.needs_login", remedy: "import_cookies", detail: null };
+ }
+ return null;
+ }
default: return null;
}
};
@@ -302,7 +310,7 @@ async function main() {
await ctx.addInitScript(initScript(theme));
const page = await ctx.newPage();
for (const route of ROUTES) {
- const slug = route === "/" ? "home" : route.replace(/^\//, "").replace(/\//g, "-");
+ const slug = route === "/" ? "home" : route.replace(/^\//, "").replace(/[\/?=&]/g, "-");
const file = path.join(OUT, `${slug}__${vp.name}__${theme}.png`);
try {
await page.goto(BASE + route, { waitUntil: "domcontentloaded", timeout: 30000 });
diff --git a/src-tauri/omniget-core/src/models/settings.rs b/src-tauri/omniget-core/src/models/settings.rs
index 7d071569..ba37eeb6 100644
--- a/src-tauri/omniget-core/src/models/settings.rs
+++ b/src-tauri/omniget-core/src/models/settings.rs
@@ -31,6 +31,18 @@ pub struct AppSettings {
pub bridge: BridgeSettings,
#[serde(default)]
pub league: LeagueSettings,
+ #[serde(default)]
+ pub accessibility: AccessibilitySettings,
+}
+
+#[derive(Debug, Clone, Default, Serialize, Deserialize)]
+pub struct AccessibilitySettings {
+ #[serde(default)]
+ pub reduce_motion: bool,
+ #[serde(default)]
+ pub reduce_transparency: bool,
+ #[serde(default)]
+ pub disable_haptics: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -603,6 +615,7 @@ impl Default for AppSettings {
rpc: RpcSettings::default(),
bridge: BridgeSettings::default(),
league: LeagueSettings::default(),
+ accessibility: AccessibilitySettings::default(),
}
}
}
diff --git a/src-tauri/src/commands/diagnostics.rs b/src-tauri/src/commands/diagnostics.rs
index 22bcbd0a..ea0f25d4 100644
--- a/src-tauri/src/commands/diagnostics.rs
+++ b/src-tauri/src/commands/diagnostics.rs
@@ -2,3 +2,8 @@
pub async fn get_hwaccel_info() -> omniget_core::core::hwaccel::HwAccelInfo {
omniget_core::core::hwaccel::detect_hwaccel().await
}
+
+#[tauri::command]
+pub fn diagnose_download_error(stderr: String) -> Option<crate::core::root_cause::Diagnosis> {
+ crate::core::root_cause::diagnose(&stderr)
+}
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs
index 91abc6d7..cfcf03f0 100644
--- a/src-tauri/src/lib.rs
+++ b/src-tauri/src/lib.rs
@@ -819,6 +819,7 @@ pub fn run() {
commands::clip::clip_video,
commands::reencode::reencode_video,
commands::diagnostics::get_hwaccel_info,
+ commands::diagnostics::diagnose_download_error,
commands::downloads::detect_platform,
commands::downloads::check_cookie_error,
commands::downloads::validate_output_path,
diff --git a/src/app.css b/src/app.css
index afa135d3..1b5bb58d 100644
--- a/src/app.css
+++ b/src/app.css
@@ -1296,3 +1296,38 @@ video {
outline: none;
}
+/* Acessibilidade por preferência do app (Settings → Appearance), espelhando as
+ media queries do SO para quem não controla a preferência global. Reduz via
+ tokens: os componentes já consomem --duration-*/--material. */
+[data-reduce-motion="true"] {
+ --duration-fast: 0.01ms;
+ --duration-base: 0.01ms;
+ --duration-slow: 0.01ms;
+ --duration-bounce: 0.01ms;
+ --ease-spring: var(--ease-out);
+}
+
+[data-reduce-motion="true"] *,
+[data-reduce-motion="true"] *::before,
+[data-reduce-motion="true"] *::after {
+ animation-duration: 0.01ms !important;
+ animation-iteration-count: 1 !important;
+ transition-duration: 0.01ms !important;
+}
+
+[data-reduce-motion="true"] .spinner,
+[data-reduce-motion="true"] .update-spinner,
+[data-reduce-motion="true"] .dep-spinner,
+[data-reduce-motion="true"] .feedback-spinner {
+ animation: reduce-motion-pulse 1.5s ease-in-out infinite !important;
+}
+
+@keyframes reduce-motion-pulse {
+ 0%, 100% { opacity: 1; }
+ 50% { opacity: 0.45; }
+}
+
+[data-reduce-transparency="true"] {
+ --material: var(--bg);
+ --material-blur: none;
+}
diff --git a/src/components/dialog/TelegramUploadModal.svelte b/src/components/dialog/TelegramUploadModal.svelte
index 851753cf..0a9ac27f 100644
--- a/src/components/dialog/TelegramUploadModal.svelte
+++ b/src/components/dialog/TelegramUploadModal.svelte
@@ -271,8 +271,8 @@
</div>
{/if}
- <div class="field-group">
- <label class="field-label">{$t('telegram.send_as_label')}</label>
+ <div class="field-group" role="radiogroup" aria-label={$t('telegram.send_as_label') as string}>
+ <span class="field-label">{$t('telegram.send_as_label')}</span>
<div class="send-as-pills">
<button
class="send-as-pill"
@@ -333,8 +333,8 @@
></textarea>
</div>
- <div class="field-group">
- <label class="field-label">{$t('telegram.tier_limit_label')}</label>
+ <div class="field-group" role="radiogroup" aria-label={$t('telegram.tier_limit_label') as string}>
+ <span class="field-label">{$t('telegram.tier_limit_label')}</span>
<div class="tier-pills">
<button
class="tier-pill"
diff --git a/src/components/downloads/RootCauseHint.svelte b/src/components/downloads/RootCauseHint.svelte
new file mode 100644
index 00000000..c3a96382
--- /dev/null
+++ b/src/components/downloads/RootCauseHint.svelte
@@ -0,0 +1,98 @@
+<script lang="ts">
+ import { invoke } from "@tauri-apps/api/core";
+ import { goto } from "$app/navigation";
+ import { open as openExternal } from "@tauri-apps/plugin-shell";
+ import { t } from "$lib/i18n";
+
+ type Remedy =
+ | "import_cookies"
+ | "use_impersonation"
+ | "set_up_pot_provider"
+ | "switch_player_client"
+ | "wait_and_retry"
+ | "free_disk_space"
+ | "update_ytdlp"
+ | "none";
+
+ type Diagnosis = { cause_key: string; remedy: Remedy; detail: string | null };
+
+ let { error, onRetry }: { error: string; onRetry?: () => void } = $props();
+
+ let diagnosis = $state<Diagnosis | null>(null);
+ let updating = $state(false);
+ let updated = $state(false);
+
+ const RETRY_REMEDIES: Remedy[] = ["use_impersonation", "switch_player_client", "wait_and_retry"];
+ const POT_GUIDE_URL = "https://github.com/yt-dlp/yt-dlp/wiki/PO-Token-Guide";
+
+ $effect(() => {
+ const stderr = error;
+ if (!stderr) {
+ diagnosis = null;
+ return;
+ }
+ invoke<Diagnosis | null>("diagnose_download_error", { stderr })
+ .then((d) => (diagnosis = d))
+ .catch(() => (diagnosis = null));
+ });
+
+ async function updateYtdlp() {
+ updating = true;
+ try {
+ await invoke("install_dependency", { name: "yt-dlp" });
+ updated = true;
+ } catch {}
+ updating = false;
+ }
+</script>
+
+{#if diagnosis}
+ <div class="root-cause" role="note">
+ <span class="root-cause-text">{$t(diagnosis.cause_key)}</span>
+ {#if diagnosis.remedy === "import_cookies"}
+ <button class="btn btn-secondary btn-sm" onclick={() => goto("/settings?tab=cookies")}>
+ {$t("error.remedy.import_cookies")}
+ </button>
+ {:else if diagnosis.remedy === "set_up_pot_provider"}
+ <button class="btn btn-secondary btn-sm" onclick={() => openExternal(POT_GUIDE_URL)}>
+ {$t("error.remedy.pot_guide")}
+ </button>
+ {:else if diagnosis.remedy === "update_ytdlp"}
+ {#if updated}
+ <span class="root-cause-done">{$t("error.remedy.updated")}</span>
+ {#if onRetry}
+ <button class="btn btn-secondary btn-sm" onclick={onRetry}>{$t("error.remedy.retry")}</button>
+ {/if}
+ {:else}
+ <button class="btn btn-secondary btn-sm" class:loading={updating} onclick={updateYtdlp} disabled={updating}>
+ {#if updating}<span class="spinner"></span>{/if}
+ {$t("error.remedy.update_ytdlp")}
+ </button>
+ {/if}
+ {:else if RETRY_REMEDIES.includes(diagnosis.remedy) && onRetry}
+ <button class="btn btn-secondary btn-sm" onclick={onRetry}>{$t("error.remedy.retry")}</button>
+ {/if}
+ </div>
+{/if}
+
+<style>
+ .root-cause {
+ display: flex;
+ align-items: center;
+ gap: var(--space-2);
+ flex-wrap: wrap;
+ padding: var(--space-1) 0;
+ }
+
+ .root-cause-text {
+ font-size: var(--text-sm);
+ font-weight: 500;
+ color: var(--text-muted);
+ }
+
+ .root-cause-done {
+ font-size: var(--text-sm);
+ font-weight: 500;
+ color: var(--success);
+ }
+</style>
diff --git a/src/components/settings/SettingsAppearance.svelte b/src/components/settings/SettingsAppearance.svelte
index 760fdbea..0be5ca99 100644
--- a/src/components/settings/SettingsAppearance.svelte
+++ b/src/components/settings/SettingsAppearance.svelte
@@ -1,182 +1,221 @@
-<script lang="ts">
- import { t } from "$lib/i18n";
- import { showToast } from "$lib/stores/toast-store.svelte";
- import RichPresencePanel from "./RichPresencePanel.svelte";
- import SettingsDrillBack from "./SettingsDrillBack.svelte";
- import SettingsDrillItem from "./SettingsDrillItem.svelte";
- import {
- getSettings,
- updateSettings,
- changeTheme,
- changeLanguage,
- CORE_THEMES,
- MORE_THEMES,
- MORE_THEME_IDS,
- } from "./settings-helpers";
-
- let { searchActive = false }: { searchActive?: boolean } = $props();
-
- let settings = $derived(getSettings());
- let selectedInMore = $derived(MORE_THEME_IDS.has(settings?.appearance?.theme ?? ""));
- let moreThemesOpen = $state(false);
- let rpcDrillOpen = $state(false);
-
- $effect(() => {
- if (selectedInMore) moreThemesOpen = true;
- });
-
- $effect(() => {
- if (searchActive) rpcDrillOpen = false;
- });
-</script>
-
-{#if settings}
- <section class="section">
- <h5 class="section-title">{$t('settings.general.title')}</h5>
- <div class="card">
- <div class="setting-row">
- <div class="setting-col">
- <span class="setting-label">{$t('settings.general.start_with_system')}</span>
- <span class="setting-path">{$t('settings.general.start_with_system_desc')}</span>
- </div>
- <button
- class="toggle"
- class:on={settings.start_with_system}
- onclick={() => updateSettings({ start_with_system: !settings.start_with_system })}
- role="switch"
- aria-checked={settings.start_with_system}
- aria-label={$t('settings.general.start_with_system') as string}
- >
- <span class="toggle-knob"></span>
- </button>
- </div>
- <div class="divider"></div>
- <div class="setting-row">
- <div class="setting-col">
- <span class="setting-label">{$t('settings.general.start_minimized')}</span>
- <span class="setting-path">{$t('settings.general.start_minimized_desc')}</span>
- </div>
- <button
- class="toggle"
- class:on={settings.start_minimized}
- onclick={() => updateSettings({ start_minimized: !settings.start_minimized })}
- role="switch"
- aria-checked={settings.start_minimized}
- aria-label={$t('settings.general.start_minimized') as string}
- >
- <span class="toggle-knob"></span>
- </button>
- </div>
- </div>
- </section>
-
- <section class="section">
- <h5 class="section-title">{$t('settings.appearance.title')}</h5>
- <div class="card">
- <div class="setting-row">
- <span class="setting-label">{$t('settings.appearance.theme')}</span>
- </div>
- <div class="theme-grid">
- {#each CORE_THEMES as theme (theme.id)}
- <button
- class="theme-card"
- class:active={settings.appearance.theme === theme.id}
- onclick={() => changeTheme(theme.id)}
- >
- {#if theme.colors}
- <div class="theme-preview">
- <div class="preview-bg" style:background="{theme.colors[0]}">
- <div class="preview-text" style:color="{theme.colors[1]}">Aa</div>
- <div class="preview-accent" style:background="{theme.colors[2]}"></div>
- </div>
- </div>
- {:else}
- <div class="theme-preview system-preview">
- <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>
- </div>
- {/if}
- <span class="theme-name">{theme.labelKey ? $t(theme.labelKey) : theme.label}</span>
- </button>
- {/each}
- </div>
- {#if !moreThemesOpen}
- <button type="button" class="more-themes-toggle" onclick={() => { moreThemesOpen = true; }}>
- {$t("settings.appearance.more_themes")}
- </button>
- {:else}
- <div class="more-themes">
- <div class="theme-grid">
- {#each MORE_THEMES as theme (theme.id)}
- <button
- class="theme-card"
- class:active={settings.appearance.theme === theme.id}
- onclick={() => changeTheme(theme.id)}
- >
- <div class="theme-preview">
- <div class="preview-bg" style:background="{theme.colors[0]}">
- <div class="preview-text" style:color="{theme.colors[1]}">Aa</div>
- <div class="preview-accent" style:background="{theme.colors[2]}"></div>
- </div>
- </div>
- <span class="theme-name">{theme.label}</span>
- </button>
- {/each}
- </div>
- </div>
- {/if}
- <div class="divider"></div>
- <div class="setting-row">
- <span class="setting-label">{$t('settings.appearance.language')}</span>
- <select class="select" value={settings.appearance.language} onchange={changeLanguage}>
- <option value="en">{$t('settings.appearance.lang_en')}</option>
- <option value="ru">{$t('settings.appearance.lang_ru')}</option>
- <option value="pt">{$t('settings.appearance.lang_pt')}</option>
- <option value="zh">{$t('settings.appearance.lang_zh')}</option>
- <option value="ja">{$t('settings.appearance.lang_ja')}</option>
- <option value="it">{$t('settings.appearance.lang_it')}</option>
- <option value="fr">{$t('settings.appearance.lang_fr')}</option>
- <option value="es">{$t('settings.appearance.lang_es')}</option>
- <option value="el">{$t('settings.appearance.lang_el')}</option>
- </select>
- </div>
- </div>
- </section>
-
- <section class="section">
- <div class="card">
- <div class="setting-row">
- <div class="setting-col">
- <span class="setting-label">{$t('settings.general.reset_hints')}</span>
- <span class="setting-path">{$t('settings.general.reset_hints_desc')}</span>
- </div>
- <button
- class="button"
- onclick={() => {
- const keys = Object.keys(localStorage).filter((k) => k.startsWith('hint_dismissed_'));
- for (const k of keys) localStorage.removeItem(k);
- showToast('info', $t('settings.general.hints_restored') as string);
- }}
- >{$t('settings.general.restore')}</button>
- </div>
- </div>
- </section>
-
- {#if searchActive || rpcDrillOpen}
- {#if rpcDrillOpen && !searchActive}
- <SettingsDrillBack
- title={$t('settings.rpc.title')}
- hint={$t('settings.rpc.desc')}
- onBack={() => { rpcDrillOpen = false; }}
- />
- {/if}
- <RichPresencePanel />
- {:else}
- <nav class="settings-drill-list">
- <SettingsDrillItem
- title={$t('settings.rpc.title')}
- hint={$t('settings.rpc.desc')}
- onclick={() => { rpcDrillOpen = true; }}
- />
- </nav>
- {/if}
-{/if}
+<script lang="ts">
+ import { t } from "$lib/i18n";
+ import { showToast } from "$lib/stores/toast-store.svelte";
+ import RichPresencePanel from "./RichPresencePanel.svelte";
+ import SettingsDrillBack from "./SettingsDrillBack.svelte";
+ import SettingsDrillItem from "./SettingsDrillItem.svelte";
+ import {
+ getSettings,
+ updateSettings,
+ changeTheme,
+ changeLanguage,
+ CORE_THEMES,
+ MORE_THEMES,
+ MORE_THEME_IDS,
+ } from "./settings-helpers";
+
+ let { searchActive = false }: { searchActive?: boolean } = $props();
+
+ let settings = $derived(getSettings());
+ let selectedInMore = $derived(MORE_THEME_IDS.has(settings?.appearance?.theme ?? ""));
+ let moreThemesOpen = $state(false);
+ let rpcDrillOpen = $state(false);
+
+ $effect(() => {
+ if (selectedInMore) moreThemesOpen = true;
+ });
+
+ $effect(() => {
+ if (searchActive) rpcDrillOpen = false;
+ });
+</script>
+
+{#if settings}
+ <section class="section">
+ <h5 class="section-title">{$t('settings.general.title')}</h5>
+ <div class="card">
+ <div class="setting-row">
+ <div class="setting-col">
+ <span class="setting-label">{$t('settings.general.start_with_system')}</span>
+ <span class="setting-path">{$t('settings.general.start_with_system_desc')}</span>
+ </div>
+ <button
+ class="toggle"
+ class:on={settings.start_with_system}
+ onclick={() => updateSettings({ start_with_system: !settings.start_with_system })}
+ role="switch"
+ aria-checked={settings.start_with_system}
+ aria-label={$t('settings.general.start_with_system') as string}
+ >
+ <span class="toggle-knob"></span>
+ </button>
+ </div>
+ <div class="divider"></div>
+ <div class="setting-row">
+ <div class="setting-col">
+ <span class="setting-label">{$t('settings.general.start_minimized')}</span>
+ <span class="setting-path">{$t('settings.general.start_minimized_desc')}</span>
+ </div>
+ <button
+ class="toggle"
+ class:on={settings.start_minimized}
+ onclick={() => updateSettings({ start_minimized: !settings.start_minimized })}
+ role="switch"
+ aria-checked={settings.start_minimized}
+ aria-label={$t('settings.general.start_minimized') as string}
+ >
+ <span class="toggle-knob"></span>
+ </button>
+ </div>
+ </div>
+ </section>
+
+ <section class="section">
+ <h5 class="section-title">{$t('settings.appearance.accessibility_title')}</h5>
+ <div class="card">
+ <div class="setting-row">
+ <div class="setting-col">
+ <span class="setting-label">{$t('settings.appearance.reduce_motion')}</span>
+ <span class="setting-path">{$t('settings.appearance.reduce_motion_desc')}</span>
+ </div>
+ <button
+ class="toggle"
+ class:on={settings.accessibility?.reduce_motion}
+ onclick={() => updateSettings({ accessibility: { reduce_motion: !settings.accessibility?.reduce_motion } })}
+ role="switch"
+ aria-checked={settings.accessibility?.reduce_motion ?? false}
+ aria-label={$t('settings.appearance.reduce_motion') as string}
+ >
+ <span class="toggle-knob"></span>
+ </button>
+ </div>
+ <div class="divider"></div>
+ <div class="setting-row">
+ <div class="setting-col">
+ <span class="setting-label">{$t('settings.appearance.reduce_transparency')}</span>
+ <span class="setting-path">{$t('settings.appearance.reduce_transparency_desc')}</span>
+ </div>
+ <button
+ class="toggle"
+ class:on={settings.accessibility?.reduce_transparency}
+ onclick={() => updateSettings({ accessibility: { reduce_transparency: !settings.accessibility?.reduce_transparency } })}
+ role="switch"
+ aria-checked={settings.accessibility?.reduce_transparency ?? false}
+ aria-label={$t('settings.appearance.reduce_transparency') as string}
+ >
+ <span class="toggle-knob"></span>
+ </button>
+ </div>
+ </div>
+ </section>
+
+ <section class="section">
+ <h5 class="section-title">{$t('settings.appearance.title')}</h5>
+ <div class="card">
+ <div class="setting-row">
+ <span class="setting-label">{$t('settings.appearance.theme')}</span>
+ </div>
+ <div class="theme-grid">
+ {#each CORE_THEMES as theme (theme.id)}
+ <button
+ class="theme-card"
+ class:active={settings.appearance.theme === theme.id}
+ onclick={() => changeTheme(theme.id)}
+ >
+ {#if theme.colors}
+ <div class="theme-preview">
+ <div class="preview-bg" style:background="{theme.colors[0]}">
+ <div class="preview-text" style:color="{theme.colors[1]}">Aa</div>
+ <div class="preview-accent" style:background="{theme.colors[2]}"></div>
+ </div>
+ </div>
+ {:else}
+ <div class="theme-preview system-preview">
+ <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.5"><circle cx="12" cy="12" r="5"/><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"/></svg>
+ </div>
+ {/if}
+ <span class="theme-name">{theme.labelKey ? $t(theme.labelKey) : theme.label}</span>
+ </button>
+ {/each}
+ </div>
+ {#if !moreThemesOpen}
+ <button type="button" class="more-themes-toggle" onclick={() => { moreThemesOpen = true; }}>
+ {$t("settings.appearance.more_themes")}
+ </button>
+ {:else}
+ <div class="more-themes">
+ <div class="theme-grid">
+ {#each MORE_THEMES as theme (theme.id)}
+ <button
+ class="theme-card"
+ class:active={settings.appearance.theme === theme.id}
+ onclick={() => changeTheme(theme.id)}
+ >
+ <div class="theme-preview">
+ <div class="preview-bg" style:background="{theme.colors[0]}">
+ <div class="preview-text" style:color="{theme.colors[1]}">Aa</div>
+ <div class="preview-accent" style:background="{theme.colors[2]}"></div>
+ </div>
+ </div>
+ <span class="theme-name">{theme.label}</span>
+ </button>
+ {/each}
+ </div>
+ </div>
+ {/if}
+ <div class="divider"></div>
+ <div class="setting-row">
+ <span class="setting-label">{$t('settings.appearance.language')}</span>
+ <select class="select" value={settings.appearance.language} onchange={changeLanguage}>
+ <option value="en">{$t('settings.appearance.lang_en')}</option>
+ <option value="ru">{$t('settings.appearance.lang_ru')}</option>
+ <option value="pt">{$t('settings.appearance.lang_pt')}</option>
+ <option value="zh">{$t('settings.appearance.lang_zh')}</option>
+ <option value="ja">{$t('settings.appearance.lang_ja')}</option>
+ <option value="it">{$t('settings.appearance.lang_it')}</option>
+ <option value="fr">{$t('settings.appearance.lang_fr')}</option>
+ <option value="es">{$t('settings.appearance.lang_es')}</option>
+ <option value="el">{$t('settings.appearance.lang_el')}</option>
+ </select>
+ </div>
+ </div>
+ </section>
+
+ <section class="section">
+ <div class="card">
+ <div class="setting-row">
+ <div class="setting-col">
+ <span class="setting-label">{$t('settings.general.reset_hints')}</span>
+ <span class="setting-path">{$t('settings.general.reset_hints_desc')}</span>
+ </div>
+ <button
+ class="button"
+ onclick={() => {
+ const keys = Object.keys(localStorage).filter((k) => k.startsWith('hint_dismissed_'));
+ for (const k of keys) localStorage.removeItem(k);
+ showToast('info', $t('settings.general.hints_restored') as string);
+ }}
+ >{$t('settings.general.restore')}</button>
+ </div>
+ </div>
+ </section>
+
+ {#if searchActive || rpcDrillOpen}
+ {#if rpcDrillOpen && !searchActive}
+ <SettingsDrillBack
+ title={$t('settings.rpc.title')}
+ hint={$t('settings.rpc.desc')}
+ onBack={() => { rpcDrillOpen = false; }}
+ />
+ {/if}
+ <RichPresencePanel />
+ {:else}
+ <nav class="settings-drill-list">
+ <SettingsDrillItem
+ title={$t('settings.rpc.title')}
+ hint={$t('settings.rpc.desc')}
+ onclick={() => { rpcDrillOpen = true; }}
+ />
+ </nav>
+ {/if}
+{/if}
diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.json
index 47c9008d..f962bc8b 100644
--- a/src/lib/i18n/el.json
+++ b/src/lib/i18n/el.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Εξ'ορισμού φάκελος",
@@ -3895,5 +3900,23 @@
"test_title": "Οι ειδοποιήσεις παρακολούθησης λειτουργούν",
"test_body": "Θα βλέπετε τέτοιες ειδοποιήσεις όταν τα δέματά σας αλλάζουν κατάσταση."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json
index c5aceb8b..a7723203 100644
--- a/src/lib/i18n/en.json
+++ b/src/lib/i18n/en.json
@@ -1,4 +1,22 @@
{
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
+ },
"confirm_close": {
"title": "Downloads in progress",
"message": "You have {{count}} active download(s). Closing now will cancel them.",
@@ -564,6 +582,11 @@
},
"appearance": {
"title": "Appearance",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds.",
"theme": "Theme",
"theme_system": "System",
"more_themes": "More themes",
diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.json
index 2d50d13d..cb8f6b6b 100644
--- a/src/lib/i18n/es.json
+++ b/src/lib/i18n/es.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Carpeta por defecto",
@@ -3895,5 +3900,23 @@
"test_title": "Las notificaciones de seguimiento funcionan",
"test_body": "Verás notificaciones así cuando tus paquetes cambien de estado."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json
index ae0aadf2..f16d7946 100644
--- a/src/lib/i18n/fr.json
+++ b/src/lib/i18n/fr.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Dossier par défaut",
@@ -3895,5 +3900,23 @@
"test_title": "Les notifications de suivi fonctionnent",
"test_body": "Vous verrez ce type de notification lorsque vos colis évoluent."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.json
index 4d71ad25..3861ab5d 100644
--- a/src/lib/i18n/it.json
+++ b/src/lib/i18n/it.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Cartella predefinita",
@@ -3895,5 +3900,23 @@
"test_title": "Le notifiche di tracciamento funzionano",
"test_body": "Vedrai notifiche come questa quando i tuoi pacchi cambiano stato."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.json
index 29c2ff05..8b8b249d 100644
--- a/src/lib/i18n/ja.json
+++ b/src/lib/i18n/ja.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "既定のフォルダ",
@@ -3895,5 +3900,23 @@
"test_title": "追跡通知は有効です",
"test_body": "荷物のステータスが変わると、このような通知が表示されます。"
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.ts
index 874a6df1..4d3ec091 100644
--- a/src/lib/i18n/keys.ts
+++ b/src/lib/i18n/keys.ts
@@ -298,6 +298,19 @@ export type TranslationKeys =
| 'downloads.vop.trim_start'
| 'downloads.vop.voice_boost'
+ | 'error.cause.disk_full'
+ | 'error.cause.extractor_outdated'
+ | 'error.cause.needs_login'
+ | 'error.cause.po_token_required'
+ | 'error.cause.rate_limited'
+ | 'error.cause.sabr_only'
+ | 'error.cause.tls_fingerprint'
+ | 'error.remedy.import_cookies'
+ | 'error.remedy.pot_guide'
+ | 'error.remedy.retry'
+ | 'error.remedy.update_ytdlp'
+ | 'error.remedy.updated'
+
| 'errors.access_denied'
| 'errors.bilibili.api_code'
| 'errors.bilibili.cancelled'
@@ -1013,6 +1026,7 @@ export type TranslationKeys =
| 'settings.ai.test_fail'
| 'settings.ai.test_ok'
| 'settings.ai.title'
+ | 'settings.appearance.accessibility_title'
| 'settings.appearance.lang_el'
| 'settings.appearance.lang_en'
| 'settings.appearance.lang_es'
@@ -1024,6 +1038,10 @@ export type TranslationKeys =
| 'settings.appearance.lang_zh'
| 'settings.appearance.language'
| 'settings.appearance.more_themes'
+ | 'settings.appearance.reduce_motion'
+ | 'settings.appearance.reduce_motion_desc'
+ | 'settings.appearance.reduce_transparency'
+ | 'settings.appearance.reduce_transparency_desc'
| 'settings.appearance.theme'
| 'settings.appearance.theme_system'
| 'settings.appearance.title'
diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.json
index 09261e7a..16ba6532 100644
--- a/src/lib/i18n/pt.json
+++ b/src/lib/i18n/pt.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Pasta padrão",
@@ -3895,5 +3900,23 @@
"test_title": "As notificações de rastreamento estão funcionando",
"test_body": "Você verá notificações assim quando os pacotes mudarem de status."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/ru.json b/src/lib/i18n/ru.json
index af88d423..942c5730 100644
--- a/src/lib/i18n/ru.json
+++ b/src/lib/i18n/ru.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "Папка по умолчанию",
@@ -3895,5 +3900,23 @@
"test_title": "Уведомления отслеживания работают",
"test_body": "Вы будете видеть такие уведомления, когда ваши посылки перемещаются."
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.json
index 37efc4ac..b5572cb1 100644
--- a/src/lib/i18n/zh-TW.json
+++ b/src/lib/i18n/zh-TW.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "預設資料夾",
@@ -3895,5 +3900,23 @@
"test_title": "追蹤通知運作正常",
"test_body": "包裹狀態變化時,您將看到此類通知。"
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.json
index 9f4afd3e..eba5b63e 100644
--- a/src/lib/i18n/zh.json
+++ b/src/lib/i18n/zh.json
@@ -548,7 +548,12 @@
"lang_it": "Italiano",
"lang_fr": "Français",
"lang_es": "Español",
- "lang_el": "Ελληνικά"
+ "lang_el": "Ελληνικά",
+ "accessibility_title": "Accessibility",
+ "reduce_motion": "Reduce motion",
+ "reduce_motion_desc": "Turns position and scale animations into simple fades.",
+ "reduce_transparency": "Reduce transparency",
+ "reduce_transparency_desc": "Replaces translucent panels with solid backgrounds."
},
"download": {
"default_output_dir": "默认文件夹",
@@ -3895,5 +3900,23 @@
"test_title": "跟踪通知正常工作",
"test_body": "包裹状态变化时,您将看到此类通知。"
}
+ },
+ "error": {
+ "cause": {
+ "po_token_required": "YouTube asked for a proof-of-origin token before serving this video.",
+ "sabr_only": "YouTube only offered streams this player cannot save yet.",
+ "rate_limited": "The site is rate-limiting downloads from your connection.",
+ "disk_full": "There is no space left on the download disk.",
+ "needs_login": "The site asked for a login to reach this content.",
+ "tls_fingerprint": "The site blocked the connection before sending any content.",
+ "extractor_outdated": "yt-dlp needs an update to keep up with this site."
+ },
+ "remedy": {
+ "import_cookies": "Import cookies",
+ "retry": "Try again",
+ "update_ytdlp": "Update yt-dlp",
+ "updated": "yt-dlp updated",
+ "pot_guide": "Open the PO token guide"
+ }
}
}
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 90f8dca4..2104a664 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -282,7 +282,7 @@
});
</script>
-<div class="shell" data-reduce-motion={settings?.accessibility?.reduce_motion}>
+<div class="shell" data-reduce-motion={settings?.accessibility?.reduce_motion} data-reduce-transparency={settings?.accessibility?.reduce_transparency}>
<AppSidebar {primaryNav} {appNav} {pluginNav} {badgeLabel} />
<div class="shell-body">
diff --git a/src/routes/downloads/+page.svelte b/src/routes/downloads/+page.svelte
index 643d6fb9..84a7ee86 100644
--- a/src/routes/downloads/+page.svelte
+++ b/src/routes/downloads/+page.svelte
@@ -21,6 +21,7 @@
import PlatformIcon from "$components/icons/PlatformIcon.svelte";
import QueueKindBadge from "$lib/study-components/QueueKindBadge.svelte";
import Mascot from "$components/mascot/Mascot.svelte";
+ import RootCauseHint from "$components/downloads/RootCauseHint.svelte";
import ContextHint from "$components/hints/ContextHint.svelte";
import DownloadSpeedGraph from "$components/download/DownloadSpeedGraph.svelte";
import DownloadLog from "$components/download/DownloadLog.svelte";
@@ -1065,6 +1066,7 @@
{#if item.status === "error" && item.error}
<span class="item-error">{translateBackendError(item.error, $t)}</span>
+ <RootCauseHint error={item.error} onRetry={() => retryDownload(item.id)} />
{/if}
{#if item.status !== "queued"}