Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.
Rust downloadmanagerguihacktoberfesthomebrewlightweightlinuxlinux-distributionlocal-firstmacosmacos-packagemedia-toolboxopen-sourcerustsveltetauritrendingtrending-repositorieswindowswindows-desktopytdlp
Refactor music UI state management and enhance download history features
Tonho399c466dd2d4
diff --git a/browser-extension/chrome/popup/popup.css b/browser-extension/chrome/popup/popup.cssindex bd2c4c3c..1ea42e7a 100644--- a/browser-extension/chrome/popup/popup.css+++ b/browser-extension/chrome/popup/popup.css@@ -327,3 +327,49 @@ body {::-webkit-scrollbar-thumb:hover { background: #444; }.hidden { display: none; }++.cookie-capture {+ border-top: 1px solid rgba(255, 255, 255, 0.08);+ padding: 10px 14px 12px;+ display: flex;+ flex-direction: column;+ gap: 4px;+}+.cookie-capture[data-state="hidden"] { display: none; }+.cookie-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ padding: 8px 12px;+ background: rgba(255, 255, 255, 0.04);+ color: #e5e5e5;+ border: 1px solid rgba(255, 255, 255, 0.12);+ border-radius: 8px;+ font: inherit;+ font-size: 12px;+ font-weight: 500;+ cursor: pointer;+ transition: border-color 120ms, background 120ms, color 120ms;+}+.cookie-btn:hover:not(:disabled) {+ border-color: rgba(255, 255, 255, 0.28);+ background: rgba(255, 255, 255, 0.07);+ color: #fff;+}+.cookie-btn:disabled { opacity: 0.5; cursor: not-allowed; }+.cookie-btn[data-state="success"] {+ border-color: #1DB954;+ color: #1DB954;+}+.cookie-btn[data-state="error"] {+ border-color: #d33;+ color: #d33;+}+.cookie-btn-label { flex: 1; text-align: left; }+.cookie-hint {+ margin: 0;+ font-size: 10px;+ color: rgba(255, 255, 255, 0.45);+ line-height: 1.4;+}diff --git a/browser-extension/chrome/popup/popup.html b/browser-extension/chrome/popup/popup.htmlindex ea56befc..a18a04c9 100644--- a/browser-extension/chrome/popup/popup.html+++ b/browser-extension/chrome/popup/popup.html@@ -43,6 +43,16 @@<div class="listening-dot"></div></div></div>+ <div class="cookie-capture" id="cookie-capture">+ <button type="button" class="cookie-btn" id="cookie-capture-btn">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M21.598 11.064a1.006 1.006 0 0 0-.854-.172A2.94 2.94 0 0 1 17.92 8.36a1 1 0 0 0-.85-.85 2.94 2.94 0 0 1-2.532-2.825 1 1 0 0 0-.85-.99 9.65 9.65 0 0 0-2.49-.005A10 10 0 0 0 12 22a10 10 0 0 0 9.834-9.745z"/>+ <path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-1 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm6 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3-3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-3-6a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>+ </svg>+ <span class="cookie-btn-label" id="cookie-capture-label">Save site cookies</span>+ </button>+ <p class="cookie-hint" id="cookie-capture-hint">Sends cookies of this site to OmniGet's cookie manager.</p>+ </div></div><script type="module" src="popup.js"></script></body>diff --git a/browser-extension/chrome/popup/popup.js b/browser-extension/chrome/popup/popup.jsindex 4a1a1be3..a990d0ad 100644--- a/browser-extension/chrome/popup/popup.js+++ b/browser-extension/chrome/popup/popup.js@@ -2,6 +2,7 @@ import { loadOpenAppState, isOpenAppEnabled, setOpenAppEnabled } from "../src/opimport { getHlsGroupKey } from "../src/hls-grouping.js";import { normalizePageKey } from "../src/sniffer-storage.js";import { formatCookieSummary } from "../src/cookie-summary.js";+import { captureCookiesForTab } from "../src/cookie-capture.js";const APP_URL = "https://github.com/tonhowtf/omniget/releases/latest";@@ -22,12 +23,16 @@ async function init() {const toggle = document.getElementById("sniffer-toggle");const openAppToggle = document.getElementById("open-app-toggle");+ let activeTab = null;try {const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });+ activeTab = tab ?? null;pageTitle = tab?.title || "";pageThumbnail = tab?.favIconUrl || "";} catch {}+ initCookieCapture(activeTab);+await loadOpenAppState();openAppToggle.checked = isOpenAppEnabled();openAppToggle.addEventListener("change", () => {@@ -503,4 +508,70 @@ function escapeHtml(str) {return d.innerHTML;}+function initCookieCapture(activeTab) {+ const wrap = document.getElementById("cookie-capture");+ const btn = document.getElementById("cookie-capture-btn");+ const label = document.getElementById("cookie-capture-label");+ const hint = document.getElementById("cookie-capture-hint");+ if (!wrap || !btn || !label) return;++ const url = activeTab?.url ?? "";+ let isHttpish = false;+ try {+ const p = new URL(url);+ isHttpish = p.protocol === "http:" || p.protocol === "https:";+ } catch {}++ if (!isHttpish) {+ wrap.dataset.state = "hidden";+ return;+ }++ let busy = false;+ btn.addEventListener("click", async () => {+ if (busy) return;+ busy = true;+ btn.disabled = true;+ btn.removeAttribute("data-state");+ label.textContent = "Saving cookies…";++ const result = await captureCookiesForTab(activeTab);+ busy = false;+ btn.disabled = false;++ if (result.ok) {+ btn.dataset.state = "success";+ label.textContent = `${result.cookie_count} cookies saved`;+ if (hint) hint.textContent = `${result.domain} • ${result.platform_kind.replace("_", " ")}`;+ setTimeout(() => {+ btn.removeAttribute("data-state");+ label.textContent = "Save site cookies";+ if (hint) hint.textContent = "Sends cookies of this site to OmniGet's cookie manager.";+ }, 3500);+ } else {+ btn.dataset.state = "error";+ label.textContent = explainFailure(result);+ setTimeout(() => {+ btn.removeAttribute("data-state");+ label.textContent = "Save site cookies";+ }, 4000);+ }+ });+}++function explainFailure(result) {+ switch (result?.reason) {+ case "no-url": return "No active tab";+ case "invalid-url": return "Page can't be inspected";+ case "unsupported-scheme": return "Only http/https pages";+ case "no-cookies-api": return "Cookies API blocked";+ case "no-cookies-for-domain": return "No cookies for this site";+ case "missing-token": return "Pair OmniGet first";+ case "missing-endpoint": return "OmniGet not detected";+ case "fetch-failed": return "OmniGet isn't running";+ case "unauthorized": return "Bad pairing token";+ default: return "Couldn't save cookies";+ }+}+init();diff --git a/browser-extension/chrome/src/bridge-client.js b/browser-extension/chrome/src/bridge-client.jsindex 2dd2ed31..99631876 100644--- a/browser-extension/chrome/src/bridge-client.js+++ b/browser-extension/chrome/src/bridge-client.js@@ -227,6 +227,9 @@ export async function sendCookiesViaBridge(storage = globalThis.chrome?.storage?.local,timeoutMs = ENQUEUE_TIMEOUT_MS,config = null,+ sourceUrl = null,+ pageTitle = null,+ alias = null,} = {}) {if (!fetchImpl) {@@ -245,6 +248,9 @@ export async function sendCookiesViaBridge(}const body = { cookies, protocolVersion: PROTOCOL_VERSION };+ if (sourceUrl) body.sourceUrl = sourceUrl;+ if (pageTitle) body.pageTitle = pageTitle;+ if (alias) body.alias = alias;const controller = typeof AbortController !== "undefined" ? new AbortController() : null;let response;diff --git a/browser-extension/chrome/src/cookie-capture.js b/browser-extension/chrome/src/cookie-capture.jsnew file mode 100644index 00000000..17804ab6--- /dev/null+++ b/browser-extension/chrome/src/cookie-capture.js@@ -0,0 +1,121 @@+/**+ * Manual "Capture cookies from this site" flow.+ *+ * Reads cookies for the active tab's URL and ships them to the desktop app via+ * the localhost HTTP bridge (`POST /v1/cookies`). Includes metadata so the+ * desktop Cookie Manager UI can show the source URL, page title (as alias hint)+ * and label the capture as "manual".+ */++import { sendCookiesViaBridge } from "./bridge-client.js";++const TRACKED_PLATFORMS = {+ "youtube.com": "youtube",+ "youtu.be": "youtube",+ "music.youtube.com": "youtube_music",+ "soundcloud.com": "soundcloud",+ "spotify.com": "spotify",+ "twitch.tv": "twitch",+ "instagram.com": "instagram",+ "x.com": "x_twitter",+ "twitter.com": "x_twitter",+ "vimeo.com": "vimeo",+ "tiktok.com": "tiktok",+ "bilibili.com": "bilibili",+ "reddit.com": "reddit",+ "pinterest.com": "pinterest",+ "bsky.app": "bluesky",+ "bsky.social": "bluesky",+};++function rootDomainOf(host) {+ const h = (host || "").replace(/^\./, "").toLowerCase();+ const parts = h.split(".");+ if (parts.length >= 2) {+ return parts.slice(-2).join(".");+ }+ return h;+}++export function detectPlatformKind(hostname) {+ const h = (hostname || "").toLowerCase().replace(/^\./, "");+ if (h === "music.youtube.com") return "youtube_music";+ const root = rootDomainOf(h);+ return TRACKED_PLATFORMS[root] ?? "generic";+}++function chromeCookieToExtensionCookie(cookie) {+ return {+ domain: cookie.domain,+ name: cookie.name,+ value: cookie.value,+ path: cookie.path || "/",+ secure: !!cookie.secure,+ httpOnly: !!cookie.httpOnly,+ expires: cookie.expirationDate ? Math.floor(cookie.expirationDate) : 0,+ hostOnly: !!cookie.hostOnly,+ sameSite: cookie.sameSite ?? null,+ };+}++export async function captureCookiesForTab(tab, {+ cookiesApi = globalThis.chrome?.cookies,+ send = sendCookiesViaBridge,+} = {}) {+ if (!tab?.url) {+ return { ok: false, reason: "no-url" };+ }+ let parsed;+ try {+ parsed = new URL(tab.url);+ } catch {+ return { ok: false, reason: "invalid-url" };+ }+ const proto = parsed.protocol;+ if (proto !== "http:" && proto !== "https:") {+ return { ok: false, reason: "unsupported-scheme" };+ }+ if (!cookiesApi?.getAll) {+ return { ok: false, reason: "no-cookies-api" };+ }++ const root = rootDomainOf(parsed.hostname);+ let raw;+ try {+ raw = await new Promise((resolve, reject) => {+ cookiesApi.getAll({ domain: root }, (cookies) => {+ const err = globalThis.chrome?.runtime?.lastError;+ if (err) reject(new Error(err.message));+ else resolve(cookies || []);+ });+ });+ } catch (error) {+ return { ok: false, reason: "cookies-fetch-failed", message: error?.message ?? String(error) };+ }++ if (!raw || raw.length === 0) {+ return { ok: false, reason: "no-cookies-for-domain", domain: root };+ }++ const cookies = raw.map(chromeCookieToExtensionCookie);+ const platformKind = detectPlatformKind(parsed.hostname);+ const title = (tab.title || "").trim();+ const alias = title ? `${title} (${root})` : root;++ const result = await send(cookies, {+ sourceUrl: tab.url,+ pageTitle: title || null,+ alias,+ });++ if (!result?.ok) {+ return { ok: false, reason: result?.reason ?? "send-failed", message: result?.message ?? null };+ }++ return {+ ok: true,+ domain: root,+ cookie_count: cookies.length,+ platform_kind: platformKind,+ };+}diff --git a/browser-extension/firefox/popup/popup.css b/browser-extension/firefox/popup/popup.cssindex bd2c4c3c..1ea42e7a 100644--- a/browser-extension/firefox/popup/popup.css+++ b/browser-extension/firefox/popup/popup.css@@ -327,3 +327,49 @@ body {::-webkit-scrollbar-thumb:hover { background: #444; }.hidden { display: none; }++.cookie-capture {+ border-top: 1px solid rgba(255, 255, 255, 0.08);+ padding: 10px 14px 12px;+ display: flex;+ flex-direction: column;+ gap: 4px;+}+.cookie-capture[data-state="hidden"] { display: none; }+.cookie-btn {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ gap: 8px;+ padding: 8px 12px;+ background: rgba(255, 255, 255, 0.04);+ color: #e5e5e5;+ border: 1px solid rgba(255, 255, 255, 0.12);+ border-radius: 8px;+ font: inherit;+ font-size: 12px;+ font-weight: 500;+ cursor: pointer;+ transition: border-color 120ms, background 120ms, color 120ms;+}+.cookie-btn:hover:not(:disabled) {+ border-color: rgba(255, 255, 255, 0.28);+ background: rgba(255, 255, 255, 0.07);+ color: #fff;+}+.cookie-btn:disabled { opacity: 0.5; cursor: not-allowed; }+.cookie-btn[data-state="success"] {+ border-color: #1DB954;+ color: #1DB954;+}+.cookie-btn[data-state="error"] {+ border-color: #d33;+ color: #d33;+}+.cookie-btn-label { flex: 1; text-align: left; }+.cookie-hint {+ margin: 0;+ font-size: 10px;+ color: rgba(255, 255, 255, 0.45);+ line-height: 1.4;+}diff --git a/browser-extension/firefox/popup/popup.html b/browser-extension/firefox/popup/popup.htmlindex ea56befc..a18a04c9 100644--- a/browser-extension/firefox/popup/popup.html+++ b/browser-extension/firefox/popup/popup.html@@ -43,6 +43,16 @@<div class="listening-dot"></div></div></div>+ <div class="cookie-capture" id="cookie-capture">+ <button type="button" class="cookie-btn" id="cookie-capture-btn">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M21.598 11.064a1.006 1.006 0 0 0-.854-.172A2.94 2.94 0 0 1 17.92 8.36a1 1 0 0 0-.85-.85 2.94 2.94 0 0 1-2.532-2.825 1 1 0 0 0-.85-.99 9.65 9.65 0 0 0-2.49-.005A10 10 0 0 0 12 22a10 10 0 0 0 9.834-9.745z"/>+ <path d="M8 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-1 5a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm6 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm3-3a1 1 0 1 0 0-2 1 1 0 0 0 0 2zm-3-6a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/>+ </svg>+ <span class="cookie-btn-label" id="cookie-capture-label">Save site cookies</span>+ </button>+ <p class="cookie-hint" id="cookie-capture-hint">Sends cookies of this site to OmniGet's cookie manager.</p>+ </div></div><script type="module" src="popup.js"></script></body>diff --git a/browser-extension/firefox/popup/popup.js b/browser-extension/firefox/popup/popup.jsindex 4a1a1be3..a990d0ad 100644--- a/browser-extension/firefox/popup/popup.js+++ b/browser-extension/firefox/popup/popup.js@@ -2,6 +2,7 @@ import { loadOpenAppState, isOpenAppEnabled, setOpenAppEnabled } from "../src/opimport { getHlsGroupKey } from "../src/hls-grouping.js";import { normalizePageKey } from "../src/sniffer-storage.js";import { formatCookieSummary } from "../src/cookie-summary.js";+import { captureCookiesForTab } from "../src/cookie-capture.js";const APP_URL = "https://github.com/tonhowtf/omniget/releases/latest";@@ -22,12 +23,16 @@ async function init() {const toggle = document.getElementById("sniffer-toggle");const openAppToggle = document.getElementById("open-app-toggle");+ let activeTab = null;try {const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });+ activeTab = tab ?? null;pageTitle = tab?.title || "";pageThumbnail = tab?.favIconUrl || "";} catch {}+ initCookieCapture(activeTab);+await loadOpenAppState();openAppToggle.checked = isOpenAppEnabled();openAppToggle.addEventListener("change", () => {@@ -503,4 +508,70 @@ function escapeHtml(str) {return d.innerHTML;}+function initCookieCapture(activeTab) {+ const wrap = document.getElementById("cookie-capture");+ const btn = document.getElementById("cookie-capture-btn");+ const label = document.getElementById("cookie-capture-label");+ const hint = document.getElementById("cookie-capture-hint");+ if (!wrap || !btn || !label) return;++ const url = activeTab?.url ?? "";+ let isHttpish = false;+ try {+ const p = new URL(url);+ isHttpish = p.protocol === "http:" || p.protocol === "https:";+ } catch {}++ if (!isHttpish) {+ wrap.dataset.state = "hidden";+ return;+ }++ let busy = false;+ btn.addEventListener("click", async () => {+ if (busy) return;+ busy = true;+ btn.disabled = true;+ btn.removeAttribute("data-state");+ label.textContent = "Saving cookies…";++ const result = await captureCookiesForTab(activeTab);+ busy = false;+ btn.disabled = false;++ if (result.ok) {+ btn.dataset.state = "success";+ label.textContent = `${result.cookie_count} cookies saved`;+ if (hint) hint.textContent = `${result.domain} • ${result.platform_kind.replace("_", " ")}`;+ setTimeout(() => {+ btn.removeAttribute("data-state");+ label.textContent = "Save site cookies";+ if (hint) hint.textContent = "Sends cookies of this site to OmniGet's cookie manager.";+ }, 3500);+ } else {+ btn.dataset.state = "error";+ label.textContent = explainFailure(result);+ setTimeout(() => {+ btn.removeAttribute("data-state");+ label.textContent = "Save site cookies";+ }, 4000);+ }+ });+}++function explainFailure(result) {+ switch (result?.reason) {+ case "no-url": return "No active tab";+ case "invalid-url": return "Page can't be inspected";+ case "unsupported-scheme": return "Only http/https pages";+ case "no-cookies-api": return "Cookies API blocked";+ case "no-cookies-for-domain": return "No cookies for this site";+ case "missing-token": return "Pair OmniGet first";+ case "missing-endpoint": return "OmniGet not detected";+ case "fetch-failed": return "OmniGet isn't running";+ case "unauthorized": return "Bad pairing token";+ default: return "Couldn't save cookies";+ }+}+init();diff --git a/browser-extension/firefox/src/bridge-client.js b/browser-extension/firefox/src/bridge-client.jsindex 2dd2ed31..99631876 100644--- a/browser-extension/firefox/src/bridge-client.js+++ b/browser-extension/firefox/src/bridge-client.js@@ -227,6 +227,9 @@ export async function sendCookiesViaBridge(storage = globalThis.chrome?.storage?.local,timeoutMs = ENQUEUE_TIMEOUT_MS,config = null,+ sourceUrl = null,+ pageTitle = null,+ alias = null,} = {}) {if (!fetchImpl) {@@ -245,6 +248,9 @@ export async function sendCookiesViaBridge(}const body = { cookies, protocolVersion: PROTOCOL_VERSION };+ if (sourceUrl) body.sourceUrl = sourceUrl;+ if (pageTitle) body.pageTitle = pageTitle;+ if (alias) body.alias = alias;const controller = typeof AbortController !== "undefined" ? new AbortController() : null;let response;diff --git a/browser-extension/firefox/src/cookie-capture.js b/browser-extension/firefox/src/cookie-capture.jsnew file mode 100644index 00000000..17804ab6--- /dev/null+++ b/browser-extension/firefox/src/cookie-capture.js@@ -0,0 +1,121 @@+/**+ * Manual "Capture cookies from this site" flow.+ *+ * Reads cookies for the active tab's URL and ships them to the desktop app via+ * the localhost HTTP bridge (`POST /v1/cookies`). Includes metadata so the+ * desktop Cookie Manager UI can show the source URL, page title (as alias hint)+ * and label the capture as "manual".+ */++import { sendCookiesViaBridge } from "./bridge-client.js";++const TRACKED_PLATFORMS = {+ "youtube.com": "youtube",+ "youtu.be": "youtube",+ "music.youtube.com": "youtube_music",+ "soundcloud.com": "soundcloud",+ "spotify.com": "spotify",+ "twitch.tv": "twitch",+ "instagram.com": "instagram",+ "x.com": "x_twitter",+ "twitter.com": "x_twitter",+ "vimeo.com": "vimeo",+ "tiktok.com": "tiktok",+ "bilibili.com": "bilibili",+ "reddit.com": "reddit",+ "pinterest.com": "pinterest",+ "bsky.app": "bluesky",+ "bsky.social": "bluesky",+};++function rootDomainOf(host) {+ const h = (host || "").replace(/^\./, "").toLowerCase();+ const parts = h.split(".");+ if (parts.length >= 2) {+ return parts.slice(-2).join(".");+ }+ return h;+}++export function detectPlatformKind(hostname) {+ const h = (hostname || "").toLowerCase().replace(/^\./, "");+ if (h === "music.youtube.com") return "youtube_music";+ const root = rootDomainOf(h);+ return TRACKED_PLATFORMS[root] ?? "generic";+}++function chromeCookieToExtensionCookie(cookie) {+ return {+ domain: cookie.domain,+ name: cookie.name,+ value: cookie.value,+ path: cookie.path || "/",+ secure: !!cookie.secure,+ httpOnly: !!cookie.httpOnly,+ expires: cookie.expirationDate ? Math.floor(cookie.expirationDate) : 0,+ hostOnly: !!cookie.hostOnly,+ sameSite: cookie.sameSite ?? null,+ };+}++export async function captureCookiesForTab(tab, {+ cookiesApi = globalThis.chrome?.cookies,+ send = sendCookiesViaBridge,+} = {}) {+ if (!tab?.url) {+ return { ok: false, reason: "no-url" };+ }+ let parsed;+ try {+ parsed = new URL(tab.url);+ } catch {+ return { ok: false, reason: "invalid-url" };+ }+ const proto = parsed.protocol;+ if (proto !== "http:" && proto !== "https:") {+ return { ok: false, reason: "unsupported-scheme" };+ }+ if (!cookiesApi?.getAll) {+ return { ok: false, reason: "no-cookies-api" };+ }++ const root = rootDomainOf(parsed.hostname);+ let raw;+ try {+ raw = await new Promise((resolve, reject) => {+ cookiesApi.getAll({ domain: root }, (cookies) => {+ const err = globalThis.chrome?.runtime?.lastError;+ if (err) reject(new Error(err.message));+ else resolve(cookies || []);+ });+ });+ } catch (error) {+ return { ok: false, reason: "cookies-fetch-failed", message: error?.message ?? String(error) };+ }++ if (!raw || raw.length === 0) {+ return { ok: false, reason: "no-cookies-for-domain", domain: root };+ }++ const cookies = raw.map(chromeCookieToExtensionCookie);+ const platformKind = detectPlatformKind(parsed.hostname);+ const title = (tab.title || "").trim();+ const alias = title ? `${title} (${root})` : root;++ const result = await send(cookies, {+ sourceUrl: tab.url,+ pageTitle: title || null,+ alias,+ });++ if (!result?.ok) {+ return { ok: false, reason: result?.reason ?? "send-failed", message: result?.message ?? null };+ }++ return {+ ok: true,+ domain: root,+ cookie_count: cookies.length,+ platform_kind: platformKind,+ };+}diff --git a/src-tauri/omniget-core/src/core/ytdlp.rs b/src-tauri/omniget-core/src/core/ytdlp.rsindex 95fddedb..a01258ba 100644--- a/src-tauri/omniget-core/src/core/ytdlp.rs+++ b/src-tauri/omniget-core/src/core/ytdlp.rs@@ -21,6 +21,7 @@ type IncludeAutoSubsFn = Box<dyn Fn() -> bool + Send + Sync>;type TranslateMetadataFn = Box<dyn Fn() -> Option<String> + Send + Sync>;type SponsorBlockFn = Box<dyn Fn() -> bool + Send + Sync>;type SplitChaptersFn = Box<dyn Fn() -> bool + Send + Sync>;+type PerDomainCookieFn = Box<dyn Fn(&str) -> Option<PathBuf> + Send + Sync>;static EXT_COOKIE_PATH_FN: OnceLock<ExtCookiePathFn> = OnceLock::new();static GLOBAL_COOKIE_FILE_FN: OnceLock<GlobalCookieFileFn> = OnceLock::new();@@ -28,6 +29,7 @@ static COOKIES_FROM_BROWSER_FN: OnceLock<CookiesFromBrowserFn> = OnceLock::new()static MANUAL_COOKIE_HEADER_FN: OnceLock<ManualCookieHeaderFn> = OnceLock::new();static EXT_REFERER_FN: OnceLock<ExtRefererFn> = OnceLock::new();static INCLUDE_AUTO_SUBS_FN: OnceLock<IncludeAutoSubsFn> = OnceLock::new();+static PER_DOMAIN_COOKIE_FN: OnceLock<PerDomainCookieFn> = OnceLock::new();static TRANSLATE_METADATA_FN: OnceLock<TranslateMetadataFn> = OnceLock::new();static SPONSORBLOCK_FN: OnceLock<SponsorBlockFn> = OnceLock::new();static SPLIT_CHAPTERS_FN: OnceLock<SplitChaptersFn> = OnceLock::new();@@ -36,6 +38,10 @@ pub fn set_ext_cookie_path_fn(f: impl Fn() -> PathBuf + Send + Sync + 'static) {let _ = EXT_COOKIE_PATH_FN.set(Box::new(f));}+pub fn set_per_domain_cookie_fn(f: impl Fn(&str) -> Option<PathBuf> + Send + Sync + 'static) {+ let _ = PER_DOMAIN_COOKIE_FN.set(Box::new(f));+}+pub fn set_global_cookie_file_fn(f: impl Fn() -> Option<String> + Send + Sync + 'static) {let _ = GLOBAL_COOKIE_FILE_FN.set(Box::new(f));}@@ -703,6 +709,25 @@ async fn find_ffmpeg_location_cached() -> Option<String> {result}+fn per_domain_cookie_file(url: &str) -> Option<std::path::PathBuf> {+ let source = PER_DOMAIN_COOKIE_FN.get()?(url)?;+ if !source.exists() {+ return None;+ }+ let metadata = std::fs::metadata(&source).ok()?;+ let modified = metadata.modified().ok()?;+ if modified.elapsed().unwrap_or_default() >= std::time::Duration::from_secs(604800 * 4) {+ return None;+ }+ let stem = source+ .file_stem()+ .and_then(|s| s.to_str())+ .unwrap_or("cookies");+ let copy = source.with_file_name(format!("{}-session.txt", stem));+ std::fs::copy(&source, ©).ok()?;+ Some(copy)+}+/// Returns a disposable copy of the extension cookie file for yt-dlp.////// yt-dlp rewrites `--cookies` files after every run, which corrupts the@@ -875,6 +900,8 @@ pub async fn get_video_info("--no-warnings".to_string(),"--no-playlist".to_string(),"--no-check-certificates".to_string(),+ "--encoding".to_string(),+ "utf-8".to_string(),"--socket-timeout".to_string(),"15".to_string(),"--retries".to_string(),@@ -895,22 +922,31 @@ pub async fn get_video_info(}let explicit_cookie_header = has_explicit_cookie_header(extra_flags);- let manual_cookie_header = if explicit_cookie_header {+ let per_domain_cookies = if explicit_cookie_header {+ None+ } else {+ per_domain_cookie_file(url)+ };+ let manual_cookie_header = if explicit_cookie_header || per_domain_cookies.is_some() {None} else {manual_cookie_header_setting()};- let extension_cookies = if manual_cookie_header.is_none() {+ let extension_cookies = if per_domain_cookies.is_none() && manual_cookie_header.is_none() {extension_cookie_file()} else {None};- let global_cf = if manual_cookie_header.is_none() {+ let global_cf = if per_domain_cookies.is_none() && manual_cookie_header.is_none() {global_cookie_file()} else {None};- if let Some(ref cookie_header) = manual_cookie_header {+ if let Some(ref cf) = per_domain_cookies {+ args.push("--cookies".to_string());+ args.push(cf.to_string_lossy().to_string());+ tracing::debug!("[yt-dlp] using per-domain cookies from cookies manager");+ } else if let Some(ref cookie_header) = manual_cookie_header {append_cookie_header(&mut args, cookie_header);tracing::debug!("[yt-dlp] using manual cookie header from settings");} else if let Some(ref cf) = extension_cookies {@@ -1032,6 +1068,8 @@ pub async fn get_playlist_info("--flat-playlist".to_string(),"--dump-json".to_string(),"--no-warnings".to_string(),+ "--encoding".to_string(),+ "utf-8".to_string(),"--socket-timeout".to_string(),"30".to_string(),"--retries".to_string(),@@ -1258,19 +1296,31 @@ pub async fn download_video(std::fs::create_dir_all(output_dir)?;let explicit_cookie_header = has_explicit_cookie_header(extra_flags);- let manual_cookie_header = if explicit_cookie_header || cookie_file.is_some() {+ let per_domain_cookies = if explicit_cookie_header || cookie_file.is_some() {+ None+ } else {+ per_domain_cookie_file(url)+ };+ let manual_cookie_header = if explicit_cookie_header+ || cookie_file.is_some()+ || per_domain_cookies.is_some()+ {None} else {manual_cookie_header_setting()};let manual_cookie_enabled = manual_cookie_header.is_some();- let global_cookie_file = if manual_cookie_enabled {+ let global_cookie_file = if manual_cookie_enabled || per_domain_cookies.is_some() {None} else {global_cookie_file()};- let ext_cookies = if cookie_file.is_none() && global_cookie_file.is_none() && !manual_cookie_enabled {+ let ext_cookies = if cookie_file.is_none()+ && global_cookie_file.is_none()+ && !manual_cookie_enabled+ && per_domain_cookies.is_none()+ {extension_cookie_file()} else {None@@ -1278,15 +1328,23 @@ pub async fn download_video(let effective_cookie_file = cookie_file.map(|p| p.to_path_buf())+ .or_else(|| per_domain_cookies.clone()).or_else(|| global_cookie_file.map(std::path::PathBuf::from)).or(ext_cookies);- let cfb_setting = if manual_cookie_enabled || explicit_cookie_header {+ let cfb_setting = if manual_cookie_enabled || explicit_cookie_header || effective_cookie_file.is_some() {String::new()} else {cookies_from_browser_setting()};- let mut base_args = vec!["-f".to_string(), format_selector];+ let mut base_args = vec![+ "-f".to_string(),+ format_selector,+ "--encoding".to_string(),+ "utf-8".to_string(),+ "--print".to_string(),+ "after_video:OMNIGET_FILEPATH:%(filepath)s".to_string(),+ ];base_args.extend(js_runtime_args());if format_id.is_none() && mode == "audio" {@@ -1544,6 +1602,7 @@ pub async fn download_video(let mut max_reported = 0.0f64;let mut first_line_logged = false;let mut first_progress_logged = false;+ let mut authoritative_capture = false;let mut last_send = std::time::Instant::now();let throttle = std::time::Duration::from_millis(250);while let Ok(Some(line)) = lines.next_line().await {@@ -1557,6 +1616,15 @@ pub async fn download_video(_timer_start.elapsed());}+ if let Some(rest) = line.strip_prefix("OMNIGET_FILEPATH:") {+ let final_path = rest.trim();+ if !final_path.is_empty() && final_path != "NA" {+ authoritative_capture = true;+ let mut guard = captured_path_writer.lock().unwrap();+ *guard = Some(PathBuf::from(final_path));+ }+ continue;+ }if let Some(dest) = parse_destination_line(&line) {let dest_path = PathBuf::from(&dest);let ext = dest_path@@ -1566,7 +1634,7 @@ pub async fn download_video(.to_lowercase();let is_subtitle =matches!(ext.as_str(), "vtt" | "srt" | "ass" | "ssa" | "sub" | "lrc");- if !is_subtitle {+ if !is_subtitle && !authoritative_capture {phase += 1;let mut guard = captured_path_writer.lock().unwrap();*guard = Some(dest_path);@@ -1943,8 +2011,18 @@ fn translate_ytdlp_error(stderr: &str) -> anyhow::Error {if lower.contains("http error 403") || lower.contains("forbidden") {return anyhow!("Access denied (403). The video may be private or region-restricted.");}- if lower.contains("sign in to confirm") || lower.contains("login required") {- return anyhow!("Video requires login. Use browser cookies or try another URL.");+ if lower.contains("sign in to confirm")+ || lower.contains("login required")+ || stderr.contains("请先登录")+ || stderr.contains("需要登录")+ || stderr.contains("登录后可")+ || stderr.contains("仅登录用户")+ || lower.contains("this video is only available")+ && lower.contains("members")+ {+ return anyhow!(+ "This video requires login. Import cookies for this site in Settings → Cookies, then retry."+ );}if lower.contains("nsig extraction failed") || lower.contains("nsig") {return anyhow!("Video extraction failed. Update yt-dlp or try again.");@@ -2151,7 +2229,12 @@ async fn find_downloaded_file(output_dir: &Path, url: &str) -> anyhow::Result<Panewest.map(|(p, _)| p)- .ok_or_else(|| anyhow!("Downloaded file not found in {:?}", output_dir))+ .ok_or_else(|| anyhow!(+ "Download reported success but no matching file appeared in {:?}. \+ This can happen on Windows with a non-UTF-8 console locale when the title contains non-Latin characters. \+ Try `chcp 65001` in a terminal before launching the app, or update yt-dlp in Settings → Dependencies.",+ output_dir+ ))}pub fn parse_formats(json: &serde_json::Value) -> Vec<FormatInfo> {@@ -2253,6 +2336,16 @@ fn extract_id_from_url(url: &str) -> Option<String> {.map(|(_, v)| v.to_string());}+ if host.contains("bilibili.com") || host == "b23.tv" {+ for seg in parsed.path().split('/').filter(|s| !s.is_empty()) {+ if (seg.starts_with("BV") && seg.len() >= 10)+ || (seg.starts_with("av") && seg.len() > 2)+ {+ return Some(seg.trim_end_matches('/').to_string());+ }+ }+ }+None}diff --git a/src-tauri/omniget-plugin-sdk/src/host.rs b/src-tauri/omniget-plugin-sdk/src/host.rsindex e1052f30..a79c8b6a 100644--- a/src-tauri/omniget-plugin-sdk/src/host.rs+++ b/src-tauri/omniget-plugin-sdk/src/host.rs@@ -67,6 +67,45 @@ pub trait PluginHost: Send + Sync {/// them at runtime for any SDK method. A future host revision may/// introduce uniform runtime enforcement for all capabilities at once.fn external_data_cache(&self, plugin_id: &str, namespace: &str) -> anyhow::Result<PathBuf>;++ /// Returns the on-disk path to a Netscape-format cookies file for the+ /// requested domain, suitable for handing to yt-dlp via `--cookies` or to+ /// any HTTP client that accepts Mozilla cookie jars.+ ///+ /// Returns `None` when:+ /// * the host does not yet support per-domain cookie storage (older host+ /// versions running plugins compiled against a newer SDK — the default+ /// impl below covers them by returning `None`),+ /// * the host has no cookies recorded for this domain,+ /// * the file would exist but is unreadable for some reason.+ ///+ /// Plugins should treat `None` as "no cookies for this domain" and fall+ /// back gracefully (skip auth, prompt the user to configure cookies, etc).+ ///+ /// # Parameters+ /// - `domain`: a hostname (`youtube.com`, `music.youtube.com`,+ /// `soundcloud.com`). The host normalizes to the registrable root+ /// internally, so `www.youtube.com` and `music.youtube.com` map to the+ /// same `youtube.com` bucket.+ /// - `account`: optional slug for multi-account setups. `None` resolves to+ /// the bucket's `_default` account, which is what plugins should use+ /// unless they expose multi-account UX themselves.+ ///+ /// The default impl returns `None` so plugins built against SDK ≥ this+ /// version still load on hosts built against older SDKs without ABI+ /// breakage. Hosts that implement the method override it.+ fn get_cookie_file(&self, _domain: &str, _account: Option<&str>) -> Option<PathBuf> {+ None+ }++ /// Reports the freshness status of the host-managed cookies for a domain.+ ///+ /// Plugins can use this to surface "your cookies expired, reconnect"+ /// messaging in their UI without parsing the cookie file themselves.+ /// Default impl returns `CookieStatus::Missing` on older hosts.+ fn cookie_status(&self, _domain: &str) -> CookieStatus {+ CookieStatus::Missing+ }}#[derive(Debug, Clone)]@@ -77,3 +116,16 @@ pub struct ProxyConfig {pub username: Option<String>,pub password: Option<String>,}++/// Freshness state of host-managed cookies for a particular domain.+#[derive(Debug, Clone, PartialEq, Eq)]+pub enum CookieStatus {+ /// No cookies on disk for this domain — plugin should treat as anonymous.+ Missing,+ /// Cookies present, plus the path on disk and recency metadata.+ Available {+ path: PathBuf,+ last_modified_secs: i64,+ cookie_count: usize,+ },+}diff --git a/src-tauri/src/cookies/commands.rs b/src-tauri/src/cookies/commands.rsindex 609f5863..3f0b00f0 100644--- a/src-tauri/src/cookies/commands.rs+++ b/src-tauri/src/cookies/commands.rs@@ -143,6 +143,101 @@ pub async fn cookies_detect_platform(domain: String) -> Result<String, String> {Ok(PlatformKind::from_domain(&domain).as_str().to_string())}+#[derive(Debug, Deserialize)]+pub struct ImportFileRequest {+ pub path: String,+ #[serde(default)]+ pub alias: Option<String>,+}++#[tauri::command]+pub async fn cookies_import_file(request: ImportFileRequest) -> Result<ImportResponse, String> {+ let path = std::path::Path::new(&request.path);+ let content = std::fs::read_to_string(path)+ .map_err(|e| format!("Failed to read {}: {e}", request.path))?;+ let cookies = parsers::parse(&content).map_err(|e| e.to_string())?;+ if cookies.is_empty() {+ return Err("No cookies found in file".to_string());+ }+ let filename = path+ .file_name()+ .map(|s| s.to_string_lossy().into_owned())+ .unwrap_or_else(|| request.path.clone());+ let label = format!("File import: {}", filename);+ let written = storage::ingest_batch(+ &cookies,+ IngestSource {+ source_url: None,+ source_label: label,+ alias_hint: request.alias,+ },+ )+ .map_err(|e| e.to_string())?;+ let buckets_written = written+ .into_iter()+ .map(|(domain, cookie_count)| {+ let platform_kind = PlatformKind::from_domain(&domain).as_str().to_string();+ BucketWrite { domain, cookie_count, platform_kind }+ })+ .collect();+ Ok(ImportResponse { buckets_written })+}++#[derive(Debug, Deserialize)]+pub struct ExportToRequest {+ pub domain: String,+ #[serde(default)]+ pub slug: Option<String>,+ pub destination_path: String,+}++#[derive(Debug, Deserialize)]+pub struct AddAccountRequest {+ pub domain: String,+ pub alias: String,+ pub content: String,+ #[serde(default)]+ pub source_url: Option<String>,+}++#[derive(Debug, Serialize)]+pub struct AddAccountResponse {+ pub slug: String,+ pub cookie_count: usize,+}++#[tauri::command]+pub async fn cookies_add_account(request: AddAccountRequest) -> Result<AddAccountResponse, String> {+ if request.alias.trim().is_empty() {+ return Err("Alias is required for a new account".to_string());+ }+ let cookies = parsers::parse(&request.content).map_err(|e| e.to_string())?;+ if cookies.is_empty() {+ return Err("No cookies found in payload".to_string());+ }+ let (slug, cookie_count) = storage::ingest_to_account(+ &request.domain,+ request.alias.trim(),+ &cookies,+ IngestSource {+ source_url: request.source_url,+ source_label: "Manual add (multi-account)".to_string(),+ alias_hint: Some(request.alias.trim().to_string()),+ },+ )+ .map_err(|e| e.to_string())?;+ Ok(AddAccountResponse { slug, cookie_count })+}++#[tauri::command]+pub async fn cookies_export_to(request: ExportToRequest) -> Result<OkResponse, String> {+ let slug = request.slug.as_deref().unwrap_or(DEFAULT_SLUG);+ let content = storage::read_account_file(&request.domain, slug).map_err(|e| e.to_string())?;+ std::fs::write(&request.destination_path, content)+ .map_err(|e| format!("Failed to write {}: {e}", request.destination_path))?;+ Ok(OkResponse { ok: true })+}+#[allow(dead_code)]pub fn list_accounts_for_domain(domain: &str) -> Vec<AccountEntry> {let registry = storage::load_registry();diff --git a/src-tauri/src/cookies/mod.rs b/src-tauri/src/cookies/mod.rsindex cae73dbd..0941c047 100644--- a/src-tauri/src/cookies/mod.rs+++ b/src-tauri/src/cookies/mod.rs@@ -19,6 +19,6 @@ pub mod storage;pub use platform::{root_domain_of, PlatformKind};pub use storage::{- account_path_for_consumer, ingest_batch, load_registry, migrate_legacy_if_needed,- AccountEntry, BucketEntry, CookieRegistry, IngestSource,+ account_path_for_consumer, ingest_batch, ingest_to_account, load_registry,+ migrate_legacy_if_needed, AccountEntry, BucketEntry, CookieRegistry, IngestSource,};diff --git a/src-tauri/src/cookies/platform.rs b/src-tauri/src/cookies/platform.rsindex fd4fa9cf..149b285f 100644--- a/src-tauri/src/cookies/platform.rs+++ b/src-tauri/src/cookies/platform.rs@@ -21,6 +21,7 @@ pub enum PlatformKind {Vimeo,Tiktok,Bilibili,+ Douyin,Reddit,Pinterest,Bluesky,@@ -40,6 +41,7 @@ impl PlatformKind {PlatformKind::Vimeo => "vimeo",PlatformKind::Tiktok => "tiktok",PlatformKind::Bilibili => "bilibili",+ PlatformKind::Douyin => "douyin",PlatformKind::Reddit => "reddit",PlatformKind::Pinterest => "pinterest",PlatformKind::Bluesky => "bluesky",@@ -63,6 +65,7 @@ impl PlatformKind {"vimeo.com" => PlatformKind::Vimeo,"tiktok.com" => PlatformKind::Tiktok,"bilibili.com" => PlatformKind::Bilibili,+ "douyin.com" | "iesdouyin.com" => PlatformKind::Douyin,"reddit.com" => PlatformKind::Reddit,"pinterest.com" => PlatformKind::Pinterest,"bsky.app" | "bsky.social" => PlatformKind::Bluesky,diff --git a/src-tauri/src/cookies/storage.rs b/src-tauri/src/cookies/storage.rsindex 49f5c0f9..63ac4192 100644--- a/src-tauri/src/cookies/storage.rs+++ b/src-tauri/src/cookies/storage.rs@@ -253,6 +253,7 @@ fn platform_display(p: PlatformKind) -> &'static str {PlatformKind::Vimeo => "Vimeo",PlatformKind::Tiktok => "TikTok",PlatformKind::Bilibili => "Bilibili",+ PlatformKind::Douyin => "Douyin",PlatformKind::Reddit => "Reddit",PlatformKind::Pinterest => "Pinterest",PlatformKind::Bluesky => "Bluesky",@@ -307,6 +308,101 @@ pub fn move_to_trash(domain: &str, slug: &str) -> anyhow::Result<()> {Ok(())}+pub fn slugify_alias(alias: &str) -> String {+ let lowered = alias.to_lowercase();+ let cleaned: String = lowered+ .chars()+ .map(|c| {+ if c.is_ascii_alphanumeric() {+ c+ } else if c.is_whitespace() || c == '-' || c == '_' {+ '-'+ } else {+ '-'+ }+ })+ .collect();+ let collapsed: String = cleaned+ .split('-')+ .filter(|s| !s.is_empty())+ .collect::<Vec<_>>()+ .join("-");+ if collapsed.is_empty() || collapsed.starts_with('_') {+ format!("account-{}", current_unix_ms())+ } else {+ collapsed.chars().take(40).collect()+ }+}++pub fn ingest_to_account(+ domain: &str,+ requested_slug: &str,+ cookies: &[ExtensionCookie],+ source: IngestSource,+) -> anyhow::Result<(String, usize)> {+ let root = root_domain_of(domain);+ if root.is_empty() {+ anyhow::bail!("invalid domain: {domain}");+ }+ let scoped: Vec<ExtensionCookie> = cookies+ .iter()+ .filter(|c| root_domain_of(&c.domain) == root)+ .cloned()+ .collect();+ if scoped.is_empty() {+ anyhow::bail!("no cookies in payload match domain {root}");+ }++ let mut registry = load_registry();+ let bucket = registry.buckets.entry(root.clone()).or_insert_with(|| {+ let platform = PlatformKind::from_domain(&root);+ BucketEntry {+ platform_kind: platform.as_str().to_string(),+ accounts: Vec::new(),+ }+ });++ let mut slug = if requested_slug.trim().is_empty() {+ slugify_alias(+ source+ .alias_hint+ .as_deref()+ .unwrap_or(""),+ )+ } else {+ slugify_alias(requested_slug)+ };+ if slug == DEFAULT_SLUG {+ slug = format!("{}-extra", DEFAULT_SLUG.trim_start_matches('_'));+ }+ let mut candidate = slug.clone();+ let mut suffix = 2;+ while bucket.accounts.iter().any(|a| a.slug == candidate) {+ candidate = format!("{}-{}", slug, suffix);+ suffix += 1;+ }+ let final_slug = candidate;++ let count = write_account_file(&root, &final_slug, &scoped)?;+ let now = current_unix_ms();+ let alias = source.alias_hint.clone().unwrap_or_else(|| {+ format!("{} · {}", platform_display(PlatformKind::from_domain(&root)), human_date(now))+ });++ bucket.accounts.push(AccountEntry {+ slug: final_slug.clone(),+ alias,+ source_url: source.source_url.clone(),+ source_label: Some(source.source_label.clone()),+ captured_at_ms: now,+ cookie_count: count,+ last_used_at_ms: None,+ });++ save_registry(®istry)?;+ Ok((final_slug, count))+}+pub fn rename_account(domain: &str, slug: &str, new_alias: &str) -> anyhow::Result<()> {let mut registry = load_registry();let bucket = registrydiff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rsindex 6835f8de..bb437fda 100644--- a/src-tauri/src/lib.rs+++ b/src-tauri/src/lib.rs@@ -53,6 +53,7 @@ pub fn run() {registry.register(Arc::new(platforms::youtube::YouTubeDownloader::new()));registry.register(Arc::new(platforms::vimeo::VimeoDownloader::new()));registry.register(Arc::new(platforms::bilibili::BilibiliDownloader::new()));+ registry.register(Arc::new(platforms::douyin::DouyinDownloader::new()));let torrent_session: Arc<tokio::sync::Mutex<Option<Arc<librqbit::Session>>>> =Arc::new(tokio::sync::Mutex::new(None));registry.register(Arc::new(platforms::magnet::MagnetDownloader::new(@@ -132,7 +133,15 @@ pub fn run() {core::http_fetcher::set_global_max_concurrent_segments(settings.advanced.max_concurrent_segments as usize,);- core::ytdlp::set_ext_cookie_path_fn(|| extension_storage::extension_cookie_file_path());+ core::ytdlp::set_per_domain_cookie_fn(|url| {+ let parsed = url::Url::parse(url).ok()?;+ let host = parsed.host_str()?;+ let root = crate::cookies::root_domain_of(host);+ if root.is_empty() {+ return None;+ }+ crate::cookies::account_path_for_consumer(&root, None)+ });core::ytdlp::set_global_cookie_file_fn(|| {let s = storage::config::load_settings_standalone();let cf = s.download.cookie_file.clone();@@ -262,6 +271,42 @@ pub fn run() {// Firefox stop trying to start the legacy host process.extension_storage::cleanup_legacy_native_messaging();+ // Cookie Manager: reparticiona `chrome-extension-cookies.txt` legacy em+ // `cookies/<domain>/_default.txt` (CK-1). Quando o registry já tem+ // buckets, a migration vira no-op. Após migration bem-sucedida, o+ // arquivo legacy é deletado — a partir de CK-7b o multi-file é a+ // única fonte de verdade.+ if !cookies::storage::has_been_migrated() {+ match cookies::migrate_legacy_if_needed() {+ Ok(_) => {+ let legacy = extension_storage::extension_cookie_file_path();+ if legacy.exists() {+ if let Err(err) = std::fs::remove_file(&legacy) {+ tracing::warn!(+ "cookies: failed to remove legacy file {}: {}",+ legacy.display(),+ err+ );+ }+ }+ }+ Err(err) => tracing::warn!("cookies: legacy migration skipped: {err}"),+ }+ } else {+ // Registry já populado — significa migration anterior já rolou; se+ // o legacy ainda existe (instalação intermediária), remove agora.+ let legacy = extension_storage::extension_cookie_file_path();+ if legacy.exists() {+ if let Err(err) = std::fs::remove_file(&legacy) {+ tracing::warn!(+ "cookies: failed to remove stale legacy file {}: {}",+ legacy.display(),+ err+ );+ }+ }+ }+// Start the localhost HTTP bridge for the browser extension. This// replaces the previous Chrome native-messaging path, which forced// us to maintain a hard-coded extension-ID allowlist. Bridge auth@@ -365,6 +410,9 @@ pub fn run() {cookies::commands::cookies_rename,cookies::commands::cookies_migrate_legacy,cookies::commands::cookies_detect_platform,+ cookies::commands::cookies_import_file,+ cookies::commands::cookies_export_to,+ cookies::commands::cookies_add_account,commands::clip::clip_video,commands::reencode::reencode_video,commands::diagnostics::get_rate_limit_stats,diff --git a/src-tauri/src/local_bridge.rs b/src-tauri/src/local_bridge.rsindex c2da14df..21117abe 100644--- a/src-tauri/src/local_bridge.rs+++ b/src-tauri/src/local_bridge.rs@@ -36,7 +36,7 @@ use tokio::net::TcpListener;use tower_http::cors::{Any, CorsLayer};use crate::extension_storage::{- cookie_limit, write_extension_cookies, write_extension_metadata, ExtensionCookie,+ cookie_limit, write_extension_metadata, ExtensionCookie,ExtensionPayload,};use crate::storage::config;@@ -300,9 +300,6 @@ async fn enqueue();}if !cookies.is_empty() {- if let Err(error) = write_extension_cookies(cookies) {- tracing::warn!("failed to write extension cookies: {error}");- }if let Err(error) = crate::cookies::ingest_batch(cookies,crate::cookies::IngestSource {@@ -382,13 +379,6 @@ async fn cookies_export(}if !request.cookies.is_empty() {- if let Err(error) = write_extension_cookies(&request.cookies) {- return error_response(- StatusCode::INTERNAL_SERVER_ERROR,- "WRITE_FAILED",- format!("write extension cookies: {error}"),- );- }let label = if request.source_url.is_some() || request.alias.is_some() {"Browser extension (manual capture)".to_string()} else {@@ -403,7 +393,11 @@ async fn cookies_export(alias_hint,},) {- tracing::warn!("failed to ingest cookies into manager: {error}");+ return error_response(+ StatusCode::INTERNAL_SERVER_ERROR,+ "WRITE_FAILED",+ format!("ingest cookies: {error}"),+ );}}diff --git a/src-tauri/src/platforms/douyin/mod.rs b/src-tauri/src/platforms/douyin/mod.rsnew file mode 100644index 00000000..e616727f--- /dev/null+++ b/src-tauri/src/platforms/douyin/mod.rs@@ -0,0 +1,254 @@+use std::collections::HashSet;+use std::time::Duration;++use anyhow::anyhow;+use async_trait::async_trait;+use tokio::sync::mpsc;++use crate::core::http_client;+use crate::core::ytdlp;+use crate::models::media::{+ DownloadOptions, DownloadResult, MediaInfo, MediaType, VideoQuality as MediaVideoQuality,+};+use crate::platforms::traits::PlatformDownloader;++const DOUYIN_UA: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36";+const DOUYIN_REFERER: &str = "https://www.douyin.com/?recommend=1";++pub struct DouyinDownloader;++impl Default for DouyinDownloader {+ fn default() -> Self {+ Self::new()+ }+}++impl DouyinDownloader {+ pub fn new() -> Self {+ Self+ }++ fn extra_flags() -> Vec<String> {+ vec![+ "--referer".to_string(),+ DOUYIN_REFERER.to_string(),+ "--user-agent".to_string(),+ DOUYIN_UA.to_string(),+ ]+ }++ fn host_matches(host: &str) -> bool {+ let host = host.to_lowercase();+ host == "douyin.com"+ || host.ends_with(".douyin.com")+ || host == "iesdouyin.com"+ || host.ends_with(".iesdouyin.com")+ || host == "webcast.amemv.com"+ }++ fn is_short_link(url: &str) -> bool {+ if let Ok(parsed) = url::Url::parse(url) {+ if let Some(host) = parsed.host_str() {+ let host = host.to_lowercase();+ return host == "v.douyin.com"+ || host == "webcast.amemv.com"+ || (host == "iesdouyin.com" || host.ends_with(".iesdouyin.com"));+ }+ }+ false+ }++ async fn resolve_url(url: &str) -> String {+ if !Self::is_short_link(url) {+ return url.to_string();+ }+ let builder = reqwest::Client::builder()+ .timeout(Duration::from_secs(10))+ .redirect(reqwest::redirect::Policy::limited(10))+ .user_agent(DOUYIN_UA);+ let client = match http_client::apply_global_proxy(builder).build() {+ Ok(c) => c,+ Err(_) => return url.to_string(),+ };+ match client.get(url).send().await {+ Ok(resp) => resp.url().to_string(),+ Err(e) => {+ tracing::warn!("[douyin] short-link resolve failed: {}", e);+ url.to_string()+ }+ }+ }++ fn build_qualities(formats: &[serde_json::Value], url: &str) -> Vec<MediaVideoQuality> {+ let mut seen_heights = HashSet::new();+ let mut qualities = Vec::new();++ for fmt in formats {+ let height = fmt.get("height").and_then(|v| v.as_u64()).unwrap_or(0) as u32;+ let vcodec = fmt.get("vcodec").and_then(|v| v.as_str()).unwrap_or("none");++ if height == 0 || vcodec == "none" {+ continue;+ }+ if !seen_heights.insert(height) {+ continue;+ }++ let label = match height {+ 2160 => "4K".to_string(),+ 1440 => "2K".to_string(),+ 1080 => "1080p".to_string(),+ 720 => "720p".to_string(),+ 480 => "480p".to_string(),+ 360 => "360p".to_string(),+ _ => format!("{}p", height),+ };++ qualities.push(MediaVideoQuality {+ label,+ width: fmt.get("width").and_then(|v| v.as_u64()).unwrap_or(0) as u32,+ height,+ url: url.to_string(),+ format: "mp4".to_string(),+ });+ }++ qualities.sort_by(|a, b| b.height.cmp(&a.height));++ if qualities.is_empty() {+ qualities.push(MediaVideoQuality {+ label: "best".to_string(),+ width: 0,+ height: 0,+ url: url.to_string(),+ format: "mp4".to_string(),+ });+ }++ qualities+ }+}++#[async_trait]+impl PlatformDownloader for DouyinDownloader {+ fn name(&self) -> &str {+ "douyin"+ }++ fn can_handle(&self, url: &str) -> bool {+ if let Ok(parsed) = url::Url::parse(url) {+ if let Some(host) = parsed.host_str() {+ return Self::host_matches(host);+ }+ }+ false+ }++ async fn get_media_info(&self, url: &str) -> anyhow::Result<MediaInfo> {+ let ytdlp_path = ytdlp::find_ytdlp_cached()+ .await+ .ok_or_else(|| anyhow!("yt-dlp not found"))?;++ let resolved = Self::resolve_url(url).await;+ let extra = Self::extra_flags();+ let json = ytdlp::get_video_info(&ytdlp_path, &resolved, &extra).await?;++ let title = json+ .get("title")+ .and_then(|v| v.as_str())+ .unwrap_or("Douyin Video")+ .to_string();++ let author = json+ .get("uploader")+ .and_then(|v| v.as_str())+ .or_else(|| json.get("channel").and_then(|v| v.as_str()))+ .unwrap_or("Unknown")+ .to_string();++ let duration = json.get("duration").and_then(|v| v.as_f64());++ let thumbnail = json+ .get("thumbnail")+ .and_then(|v| v.as_str())+ .map(String::from);++ let formats = json+ .get("formats")+ .and_then(|v| v.as_array())+ .cloned()+ .unwrap_or_default();++ let qualities = Self::build_qualities(&formats, &resolved);++ let has_video = formats+ .iter()+ .any(|f| f.get("vcodec").and_then(|v| v.as_str()).unwrap_or("none") != "none");++ Ok(MediaInfo {+ title,+ author,+ platform: "douyin".to_string(),+ duration_seconds: duration,+ thumbnail_url: thumbnail,+ available_qualities: qualities,+ media_type: if has_video {+ MediaType::Video+ } else {+ MediaType::Audio+ },+ file_size_bytes: None,+ })+ }++ async fn download(+ &self,+ info: &MediaInfo,+ opts: &DownloadOptions,+ progress: mpsc::Sender<f64>,+ ) -> anyhow::Result<DownloadResult> {+ let _ = progress.send(0.0).await;++ let ytdlp_path = match &opts.ytdlp_path {+ Some(p) => p.clone(),+ None => ytdlp::find_ytdlp_cached()+ .await+ .ok_or_else(|| anyhow!("yt-dlp not found"))?,+ };++ let canonical = info+ .available_qualities+ .first()+ .map(|q| q.url.as_str())+ .unwrap_or("");+ if canonical.is_empty() {+ return Err(anyhow!("No URL available"));+ }++ let quality_height = opts+ .quality+ .as_ref()+ .and_then(|q| q.trim_end_matches('p').parse::<u32>().ok());++ let extra = Self::extra_flags();++ ytdlp::download_video(+ &ytdlp_path,+ canonical,+ &opts.output_dir,+ quality_height,+ progress,+ opts.download_mode.as_deref(),+ opts.format_id.as_deref(),+ opts.filename_template.as_deref(),+ opts.referer.as_deref().or(Some(DOUYIN_REFERER)),+ opts.cancel_token.clone(),+ None,+ opts.concurrent_fragments,+ opts.download_subtitles,+ &extra,+ opts.audio_format.as_deref(),+ )+ .await+ }+}diff --git a/src-tauri/src/platforms/mod.rs b/src-tauri/src/platforms/mod.rsindex 9682624a..4760a68d 100644--- a/src-tauri/src/platforms/mod.rs+++ b/src-tauri/src/platforms/mod.rs@@ -11,6 +11,8 @@ pub mod twitter;#[cfg(not(target_os = "android"))]pub mod bilibili;#[cfg(not(target_os = "android"))]+pub mod douyin;+#[cfg(not(target_os = "android"))]pub mod generic_ytdlp;#[cfg(not(target_os = "android"))]pub mod instagram;diff --git a/src-tauri/src/plugin_host.rs b/src-tauri/src/plugin_host.rsindex 22da92d9..3d26bec7 100644--- a/src-tauri/src/plugin_host.rs+++ b/src-tauri/src/plugin_host.rs@@ -137,4 +137,30 @@ impl<R: Runtime + 'static> PluginHost for PluginHostImpl<R> {})?;Ok(dir)}++ fn get_cookie_file(&self, domain: &str, account: Option<&str>) -> Option<PathBuf> {+ crate::cookies::account_path_for_consumer(domain, account)+ }++ fn cookie_status(&self, domain: &str) -> omniget_plugin_sdk::CookieStatus {+ let registry = crate::cookies::load_registry();+ let root = crate::cookies::root_domain_of(domain);+ let bucket = match registry.buckets.get(&root) {+ Some(b) => b,+ None => return omniget_plugin_sdk::CookieStatus::Missing,+ };+ let primary = match bucket.accounts.iter().find(|a| a.slug == "_default") {+ Some(a) => a,+ None => return omniget_plugin_sdk::CookieStatus::Missing,+ };+ let path = match crate::cookies::account_path_for_consumer(&root, None) {+ Some(p) => p,+ None => return omniget_plugin_sdk::CookieStatus::Missing,+ };+ omniget_plugin_sdk::CookieStatus::Available {+ path,+ last_modified_secs: primary.captured_at_ms / 1000,+ cookie_count: primary.cookie_count,+ }+ }}diff --git a/src/components/dialog/ReencodeDialog.svelte b/src/components/dialog/ReencodeDialog.sveltenew file mode 100644index 00000000..87cc2f2b--- /dev/null+++ b/src/components/dialog/ReencodeDialog.svelte@@ -0,0 +1,379 @@+<script lang="ts">+ import { invoke } from "@tauri-apps/api/core";+ import { t } from "$lib/i18n";+ import { showToast } from "$lib/stores/toast-store.svelte";+ import { formatBytes } from "$lib/stores/download-store.svelte";+ import DialogContainer from "./DialogContainer.svelte";++ type Codec = "hevc" | "h264" | "av1";++ type ReencodeResult = {+ output_path: string;+ encoder_used: string;+ used_hwaccel: boolean;+ original_size_bytes: number;+ new_size_bytes: number;+ savings_pct: number;+ replaced_original: boolean;+ };++ let {+ inputPath = $bindable<string | null>(null),+ }: {+ inputPath?: string | null;+ } = $props();++ let isOpen = $derived(inputPath !== null);+ let codec = $state<Codec>("hevc");+ let replaceOriginal = $state(false);+ let busy = $state(false);++ function close() {+ if (busy) return;+ inputPath = null;+ codec = "hevc";+ replaceOriginal = false;+ }++ async function runReencode() {+ if (!inputPath || busy) return;+ busy = true;+ try {+ const result = await invoke<ReencodeResult>("reencode_video", {+ req: {+ input_path: inputPath,+ output_path: null,+ codec,+ cq: null,+ replace_original: replaceOriginal,+ },+ });+ const saved = formatBytes(result.original_size_bytes - result.new_size_bytes);+ const pct = result.savings_pct.toFixed(0);+ const toastKey = result.replaced_original+ ? "reencode.toast_replaced"+ : "reencode.toast_done";+ showToast(+ "info",+ $t(toastKey, { saved, pct, encoder: result.encoder_used }) as string,+ );+ inputPath = null;+ codec = "hevc";+ replaceOriginal = false;+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ } finally {+ busy = false;+ }+ }++ const codecOptions: { id: Codec; titleKey: string; subKey: string; tag?: string }[] = [+ { id: "hevc", titleKey: "reencode.codec_hevc_title", subKey: "reencode.codec_hevc_desc", tag: "recommended" },+ { id: "h264", titleKey: "reencode.codec_h264_title", subKey: "reencode.codec_h264_desc" },+ { id: "av1", titleKey: "reencode.codec_av1_title", subKey: "reencode.codec_av1_desc" },+ ];+</script>++<DialogContainer bind:isOpen onClose={close} titleId="reencode-dialog-title">+ <div class="reencode-header">+ <h2 id="reencode-dialog-title">{$t("reencode.title")}</h2>+ <button class="dialog-close" onclick={close} aria-label={$t("common.close")} disabled={busy}>+ <svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M18 6L6 18M6 6l12 12" />+ </svg>+ </button>+ </div>++ <div class="reencode-body">+ {#if inputPath}+ <p class="reencode-target" title={inputPath}>+ {inputPath.split(/[\\/]/).pop()}+ </p>+ {/if}++ <fieldset class="codec-fieldset" disabled={busy}>+ <legend>{$t("reencode.codec_legend")}</legend>+ {#each codecOptions as opt}+ <label class="codec-option" class:selected={codec === opt.id}>+ <input+ type="radio"+ name="codec"+ value={opt.id}+ bind:group={codec}+ />+ <span class="codec-text">+ <span class="codec-title">+ {$t(opt.titleKey)}+ {#if opt.tag === "recommended"}+ <span class="codec-tag">{$t("reencode.tag_recommended")}</span>+ {/if}+ </span>+ <span class="codec-sub">{$t(opt.subKey)}</span>+ </span>+ </label>+ {/each}+ </fieldset>++ <label class="replace-row">+ <input+ type="checkbox"+ bind:checked={replaceOriginal}+ disabled={busy}+ />+ <span class="replace-text">+ <span class="replace-title">{$t("reencode.replace_title")}</span>+ <span class="replace-sub">{$t("reencode.replace_desc")}</span>+ </span>+ </label>+ </div>++ <div class="reencode-footer">+ <button class="btn-secondary" onclick={close} disabled={busy}>+ {$t("common.cancel")}+ </button>+ <button class="btn-primary" onclick={runReencode} disabled={busy || !inputPath}>+ {#if busy}+ <span class="spinner" aria-hidden="true"></span>+ {$t("reencode.encoding")}+ {:else}+ {$t("reencode.start")}+ {/if}+ </button>+ </div>+</DialogContainer>++<style>+ .reencode-header {+ display: flex;+ justify-content: space-between;+ align-items: center;+ padding: 16px 20px 4px;+ }++ .reencode-header h2 {+ margin: 0;+ font-size: 16px;+ font-weight: 600;+ color: var(--secondary);+ }++ .dialog-close {+ background: transparent;+ border: none;+ color: var(--tertiary);+ padding: 4px;+ cursor: pointer;+ border-radius: var(--border-radius);+ }++ .dialog-close:hover:not(:disabled) {+ background: var(--button-hover);+ color: var(--secondary);+ }++ .dialog-close:disabled {+ opacity: 0.5;+ cursor: not-allowed;+ }++ .reencode-body {+ padding: 8px 20px 16px;+ overflow-y: auto;+ display: flex;+ flex-direction: column;+ gap: 14px;+ }++ .reencode-target {+ margin: 0;+ font-size: 12.5px;+ color: var(--tertiary);+ font-family: var(--font-mono, ui-monospace, monospace);+ background: var(--button);+ padding: 8px 10px;+ border-radius: var(--border-radius);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }++ .codec-fieldset {+ border: none;+ padding: 0;+ margin: 0;+ display: flex;+ flex-direction: column;+ gap: 6px;+ }++ .codec-fieldset legend {+ font-size: 12px;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.5px;+ color: var(--tertiary);+ margin-bottom: 6px;+ padding: 0;+ }++ .codec-option {+ display: flex;+ align-items: flex-start;+ gap: 10px;+ padding: 10px 12px;+ border-radius: var(--border-radius);+ background: var(--button);+ cursor: pointer;+ border: 1px solid transparent;+ transition: background 0.12s, border-color 0.12s;+ }++ .codec-option:hover {+ background: var(--button-hover);+ }++ .codec-option.selected {+ background: var(--button-elevated);+ border-color: var(--accent);+ }++ .codec-option input[type="radio"] {+ margin-top: 3px;+ accent-color: var(--accent);+ flex-shrink: 0;+ }++ .codec-text {+ display: flex;+ flex-direction: column;+ gap: 2px;+ flex: 1;+ min-width: 0;+ }++ .codec-title {+ font-size: 13.5px;+ font-weight: 500;+ color: var(--secondary);+ display: inline-flex;+ align-items: center;+ gap: 8px;+ }++ .codec-tag {+ font-size: 10px;+ font-weight: 600;+ text-transform: uppercase;+ letter-spacing: 0.5px;+ color: var(--accent);+ background: var(--accent-soft, color-mix(in srgb, var(--accent) 15%, transparent));+ padding: 2px 6px;+ border-radius: calc(var(--border-radius) / 2);+ }++ .codec-sub {+ font-size: 12px;+ color: var(--tertiary);+ }++ .replace-row {+ display: flex;+ align-items: flex-start;+ gap: 10px;+ padding: 10px 12px;+ border-radius: var(--border-radius);+ background: var(--button);+ cursor: pointer;+ }++ .replace-row input[type="checkbox"] {+ margin-top: 3px;+ accent-color: var(--accent);+ flex-shrink: 0;+ }++ .replace-text {+ display: flex;+ flex-direction: column;+ gap: 2px;+ flex: 1;+ min-width: 0;+ }++ .replace-title {+ font-size: 13.5px;+ font-weight: 500;+ color: var(--secondary);+ }++ .replace-sub {+ font-size: 12px;+ color: var(--tertiary);+ line-height: 1.4;+ }++ .reencode-footer {+ display: flex;+ justify-content: flex-end;+ gap: 8px;+ padding: 12px 20px 16px;+ border-top: 1px solid var(--content-border, var(--button));+ }++ .btn-secondary,+ .btn-primary {+ padding: 8px 16px;+ border-radius: var(--border-radius);+ border: none;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ gap: 6px;+ }++ .btn-secondary {+ background: var(--button);+ color: var(--secondary);+ }++ .btn-secondary:hover:not(:disabled) {+ background: var(--button-hover);+ }++ .btn-primary {+ background: var(--accent);+ color: var(--on-accent, #fff);+ }++ .btn-primary:hover:not(:disabled) {+ filter: brightness(1.08);+ }++ .btn-primary:disabled,+ .btn-secondary:disabled {+ opacity: 0.6;+ cursor: not-allowed;+ }++ .spinner {+ width: 12px;+ height: 12px;+ border-radius: 50%;+ border: 2px solid currentColor;+ border-top-color: transparent;+ animation: spin 0.7s linear infinite;+ }++ @keyframes spin {+ to { transform: rotate(360deg); }+ }++ @media (prefers-reduced-motion: reduce) {+ .spinner {+ animation: none;+ }+ }+</style>diff --git a/src/components/settings/SettingsCookies.svelte b/src/components/settings/SettingsCookies.sveltenew file mode 100644index 00000000..b87e3b21--- /dev/null+++ b/src/components/settings/SettingsCookies.svelte@@ -0,0 +1,493 @@+<script lang="ts">+ import { onMount } from "svelte";+ import { invoke } from "@tauri-apps/api/core";+ import { open as openShell } from "@tauri-apps/plugin-shell";+ import { save as saveDialog } from "@tauri-apps/plugin-dialog";+ import { t } from "$lib/i18n";+ import { showToast } from "$lib/stores/toast-store.svelte";+ import CookieBucketCard from "$lib/components/cookies/CookieBucketCard.svelte";+ import CookieImportMenu from "$lib/components/cookies/CookieImportMenu.svelte";+ import CookieContentModal from "$lib/components/cookies/CookieContentModal.svelte";+ import CookiePasteModal from "$lib/components/cookies/CookiePasteModal.svelte";++ type Account = {+ slug: string;+ alias: string;+ source_url: string | null;+ source_label: string | null;+ captured_at_ms: number;+ cookie_count: number;+ last_used_at_ms: number | null;+ };+ type BucketEntry = { platform_kind: string; accounts: Account[] };+ type Registry = { buckets: Record<string, BucketEntry> };+ type ListResponse = { registry: Registry; cookies_dir: string };+ type ImportResponse = {+ buckets_written: Array<{ domain: string; cookie_count: number; platform_kind: string }>;+ };++ let registry = $state<Registry>({ buckets: {} });+ let cookiesDir = $state("");+ let loading = $state(true);+ let pasteOpen = $state(false);+ let genericDomain = $state("");+ let genericFormOpen = $state(false);++ let viewOpen = $state(false);+ let viewDomain = $state("");+ let viewSlug = $state("");+ let viewContent = $state("");+ let viewPath = $state("");++ let confirmClearOpen = $state(false);+ let confirmDomain = $state("");+ let confirmSlug = $state("");++ let addAccountOpen = $state(false);+ let addAccountDomain = $state("");++ let bucketList = $derived(+ Object.entries(registry.buckets)+ .map(([domain, b]) => ({ domain, ...b }))+ .sort((a, b) => {+ const aTime = a.accounts[0]?.captured_at_ms ?? 0;+ const bTime = b.accounts[0]?.captured_at_ms ?? 0;+ return bTime - aTime;+ }),+ );++ async function reload() {+ loading = true;+ try {+ const res = await invoke<ListResponse>("cookies_list");+ registry = res.registry;+ cookiesDir = res.cookies_dir;+ } catch (e) {+ showToast("error", String(e));+ } finally {+ loading = false;+ }+ }++ async function importContent(content: string, sourceUrl: string, alias: string, label: string) {+ try {+ const res = await invoke<ImportResponse>("cookies_import", {+ request: {+ content,+ source_url: sourceUrl || null,+ source_label: label,+ alias: alias || null,+ },+ });+ const total = res.buckets_written.reduce((s, b) => s + b.cookie_count, 0);+ showToast(+ "success",+ ($t("settings.cookies.import_success", {+ buckets: String(res.buckets_written.length),+ cookies: String(total),+ }) as string) ?? `Imported ${total} cookies`,+ );+ pasteOpen = false;+ await reload();+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function handleImportFile(path: string) {+ try {+ const res = await invoke<ImportResponse>("cookies_import_file", {+ request: { path, alias: null },+ });+ const total = res.buckets_written.reduce((s, b) => s + b.cookie_count, 0);+ showToast(+ "success",+ ($t("settings.cookies.import_success", {+ buckets: String(res.buckets_written.length),+ cookies: String(total),+ }) as string) ?? `Imported ${total} cookies`,+ );+ await reload();+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function handleImportPasteContent(content: string, sourceUrl: string, alias: string) {+ await importContent(content, sourceUrl, alias, "Paste import");+ }++ async function handleView(domain: string, slug: string) {+ try {+ const res = await invoke<{ content: string; path: string }>("cookies_read", {+ request: { domain, slug },+ });+ viewContent = res.content;+ viewPath = res.path;+ viewDomain = domain;+ viewSlug = slug;+ viewOpen = true;+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function handleExport(domain: string, slug: string) {+ try {+ const saved = await saveDialog({+ title: $t("settings.cookies.export_dialog_title") as string,+ defaultPath: `${domain}-cookies.txt`,+ filters: [{ name: "Netscape Cookies", extensions: ["txt"] }],+ });+ if (saved && typeof saved === "string") {+ await invoke("cookies_export_to", {+ request: { domain, slug, destination_path: saved },+ });+ showToast("success", $t("settings.cookies.export_done") as string);+ }+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function handleRename(domain: string, slug: string, newAlias: string) {+ try {+ await invoke("cookies_rename", { request: { domain, slug, new_alias: newAlias } });+ await reload();+ } catch (e) {+ showToast("error", String(e));+ }+ }++ function askClear(domain: string, slug: string) {+ confirmDomain = domain;+ confirmSlug = slug;+ confirmClearOpen = true;+ }++ function openAddAccount(domain: string) {+ addAccountDomain = domain;+ addAccountOpen = true;+ }++ async function submitAddAccount(content: string, sourceUrl: string, alias: string) {+ try {+ const res = await invoke<{ slug: string; cookie_count: number }>("cookies_add_account", {+ request: {+ domain: addAccountDomain,+ alias: alias || "Conta",+ content,+ source_url: sourceUrl || null,+ },+ });+ showToast(+ "success",+ ($t("settings.cookies.add_account_success", {+ slug: res.slug,+ count: String(res.cookie_count),+ }) as string) ?? `Account added (${res.slug})`,+ );+ addAccountOpen = false;+ await reload();+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function confirmClear() {+ try {+ await invoke("cookies_clear", { request: { domain: confirmDomain, slug: confirmSlug } });+ confirmClearOpen = false;+ await reload();+ showToast("success", $t("settings.cookies.cleared_toast") as string);+ } catch (e) {+ showToast("error", String(e));+ }+ }++ async function openCookiesDir() {+ if (!cookiesDir) return;+ try {+ await openShell(cookiesDir);+ } catch (e) {+ console.warn("[cookies] open dir failed", e);+ }+ }++ function showExtensionHint() {+ showToast(+ "info",+ $t("settings.cookies.hint_use_extension") as string,+ );+ }++ onMount(() => {+ void reload();+ });+</script>++<section class="section">+ <header class="section-head">+ <h2 class="section-title">{$t("settings.cookies.title")}</h2>+ <p class="section-intro">{$t("settings.cookies.intro")}</p>+ <div class="head-actions">+ <button type="button" class="ghost-btn" onclick={showExtensionHint}>+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <rect x="4" y="4" width="16" height="16" rx="3"/>+ <path d="M8 8h8M8 12h6M8 16h4"/>+ </svg>+ {$t("settings.cookies.capture_via_extension")}+ </button>+ <button type="button" class="ghost-btn subtle" onclick={openCookiesDir} disabled={!cookiesDir}>+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"/>+ </svg>+ {$t("settings.cookies.open_folder")}+ </button>+ <CookieImportMenu+ onImportFile={handleImportFile}+ onImportPaste={() => pasteOpen = true}+ />+ </div>+ {#if cookiesDir}+ <p class="dir-hint" title={cookiesDir}>+ <span>{$t("settings.cookies.dir_label")}</span>+ <code>{cookiesDir}</code>+ </p>+ {/if}+ </header>++ {#if loading}+ <div class="loading">+ {#each Array(3) as _, i (i)}+ <div class="skel"></div>+ {/each}+ </div>+ {:else if bucketList.length === 0}+ <div class="empty-state">+ <svg viewBox="0 0 24 24" width="42" height="42" fill="none" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <circle cx="12" cy="12" r="10"/>+ <circle cx="8" cy="10" r="1"/>+ <circle cx="16" cy="10" r="1"/>+ <circle cx="11" cy="14" r="1"/>+ </svg>+ <h3>{$t("settings.cookies.empty_title")}</h3>+ <p>{$t("settings.cookies.empty_body")}</p>+ </div>+ {:else}+ <div class="buckets">+ {#each bucketList as bucket (bucket.domain)}+ <CookieBucketCard+ {bucket}+ onView={handleView}+ onExport={handleExport}+ onRename={handleRename}+ onClear={askClear}+ onAddAccount={openAddAccount}+ />+ {/each}+ </div>+ {/if}++ <div class="add-generic">+ {#if !genericFormOpen}+ <button type="button" class="add-toggle" onclick={() => genericFormOpen = true}>+ + {$t("settings.cookies.add_generic_title")}+ </button>+ <p class="add-hint">{$t("settings.cookies.add_generic_hint")}</p>+ {:else}+ <div class="add-form">+ <input+ type="text"+ placeholder={$t("settings.cookies.add_generic_placeholder") as string}+ bind:value={genericDomain}+ />+ <button+ type="button"+ class="ghost-btn"+ onclick={() => { genericFormOpen = false; pasteOpen = true; }}+ disabled={!genericDomain.trim()}+ >+ {$t("settings.cookies.add_generic_paste")}+ </button>+ <button type="button" class="ghost-btn subtle" onclick={() => { genericFormOpen = false; genericDomain = ""; }}>+ {$t("settings.cookies.add_generic_cancel")}+ </button>+ </div>+ {/if}+ </div>+</section>++<CookieContentModal+ open={viewOpen}+ domain={viewDomain}+ slug={viewSlug}+ content={viewContent}+ path={viewPath}+ onClose={() => viewOpen = false}+/>++<CookiePasteModal+ open={pasteOpen}+ onSubmit={handleImportPasteContent}+ onClose={() => pasteOpen = false}+/>++<CookiePasteModal+ open={addAccountOpen}+ onSubmit={submitAddAccount}+ onClose={() => addAccountOpen = false}+/>++{#if confirmClearOpen}+ <div class="overlay" onclick={(e) => { if (e.target === e.currentTarget) confirmClearOpen = false; }} role="presentation">+ <div class="confirm" role="dialog" aria-label={$t("settings.cookies.confirm_clear_title") as string}>+ <h3>{$t("settings.cookies.confirm_clear_title")}</h3>+ <p>{$t("settings.cookies.confirm_clear_body", { domain: confirmDomain })}</p>+ <div class="confirm-actions">+ <button type="button" class="ghost-btn" onclick={() => confirmClearOpen = false}>+ {$t("settings.cookies.confirm_clear_cancel")}+ </button>+ <button type="button" class="danger-btn" onclick={confirmClear}>+ {$t("settings.cookies.confirm_clear_action")}+ </button>+ </div>+ </div>+ </div>+{/if}++<style>+ .section { display: flex; flex-direction: column; gap: 16px; }+ .section-head { display: flex; flex-direction: column; gap: 8px; }+ .section-title { margin: 0; font-size: 18px; font-weight: 600; color: var(--primary); }+ .section-intro { margin: 0; color: var(--secondary); font-size: 13px; line-height: 1.5; }+ .head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }+ .dir-hint {+ margin: 6px 0 0;+ font-size: 11px;+ color: var(--tertiary);+ display: flex;+ align-items: center;+ gap: 8px;+ flex-wrap: wrap;+ }+ .dir-hint code {+ font-family: ui-monospace, "Cascadia Code", monospace;+ background: color-mix(in oklab, var(--button) 50%, transparent);+ padding: 2px 8px;+ border-radius: 4px;+ overflow: hidden;+ text-overflow: ellipsis;+ max-width: 100%;+ }+ .ghost-btn {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 7px 14px;+ background: transparent;+ border: 1px solid color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 999px;+ color: var(--secondary);+ font-size: 13px;+ cursor: pointer;+ transition: border-color 120ms, color 120ms;+ }+ .ghost-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }+ .ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }+ .ghost-btn.subtle { color: var(--tertiary); }+ .loading { display: flex; flex-direction: column; gap: 12px; }+ .skel {+ height: 92px;+ border-radius: 14px;+ background: linear-gradient(+ 90deg,+ color-mix(in oklab, var(--button) 35%, transparent) 0%,+ color-mix(in oklab, var(--button) 60%, transparent) 50%,+ color-mix(in oklab, var(--button) 35%, transparent) 100%+ );+ background-size: 200% 100%;+ animation: shimmer 1.5s ease-in-out infinite;+ }+ @keyframes shimmer {+ 0% { background-position: 200% 0; }+ 100% { background-position: -200% 0; }+ }+ .empty-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ text-align: center;+ gap: 8px;+ padding: 40px 20px;+ color: var(--tertiary);+ background: color-mix(in oklab, var(--button) 15%, transparent);+ border: 1px dashed color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 14px;+ }+ .empty-state svg { color: var(--tertiary); opacity: 0.6; }+ .empty-state h3 { margin: 4px 0 0; font-size: 15px; color: var(--secondary); font-weight: 600; }+ .empty-state p { margin: 0; font-size: 13px; max-width: 380px; line-height: 1.5; }+ .buckets { display: flex; flex-direction: column; gap: 10px; }+ .add-generic {+ padding: 14px 18px;+ border-radius: 14px;+ border: 1px dashed color-mix(in oklab, var(--content-border) 40%, transparent);+ margin-top: 4px;+ }+ .add-toggle {+ background: transparent;+ border: 0;+ color: var(--accent);+ font: inherit;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ padding: 0;+ }+ .add-toggle:hover { filter: brightness(1.2); }+ .add-hint { margin: 4px 0 0; font-size: 11px; color: var(--tertiary); }+ .add-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }+ .add-form input {+ flex: 1;+ min-width: 200px;+ padding: 7px 12px;+ background: color-mix(in oklab, var(--button) 50%, transparent);+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 8px;+ color: var(--primary);+ font: inherit;+ font-size: 13px;+ outline: none;+ }+ .add-form input:focus { border-color: var(--accent); }+ .overlay {+ position: fixed; inset: 0;+ background: rgba(0, 0, 0, 0.6);+ display: flex; align-items: center; justify-content: center;+ z-index: 1000;+ padding: 24px;+ }+ .confirm {+ width: min(420px, 100%);+ background: var(--background);+ border: 1px solid color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 14px;+ padding: 20px;+ display: flex; flex-direction: column; gap: 12px;+ }+ .confirm h3 { margin: 0; font-size: 16px; color: var(--primary); }+ .confirm p { margin: 0; font-size: 13px; color: var(--secondary); line-height: 1.5; }+ .confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }+ .danger-btn {+ padding: 7px 16px;+ background: #d33;+ color: white;+ border: 0;+ border-radius: 999px;+ font: inherit;+ font-size: 13px;+ cursor: pointer;+ }+ .danger-btn:hover { filter: brightness(1.1); }+</style>diff --git a/src/components/settings/SettingsDownloads.svelte b/src/components/settings/SettingsDownloads.svelteindex 41de6791..acf277d6 100644--- a/src/components/settings/SettingsDownloads.svelte+++ b/src/components/settings/SettingsDownloads.svelte@@ -135,6 +135,11 @@const value = (e.target as HTMLSelectElement).value;updateSettings({ download: { music_audio_format: value } });}++ function changeCaptionLocale(e: Event) {+ const value = (e.target as HTMLSelectElement).value;+ updateSettings({ download: { caption_locale: value } });+ }</script>{#if settings}@@ -325,6 +330,32 @@</div><button class="toggle" class:on={settings.download.include_auto_subtitles} onclick={() => toggleBool("download", "include_auto_subtitles", settings.download.include_auto_subtitles)} role="switch" aria-checked={settings.download.include_auto_subtitles} aria-label={$t('settings.download.include_auto_subtitles') 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.download.caption_locale')}</span>+ <span class="setting-path">{$t('settings.download.caption_locale_desc')}</span>+ </div>+ <select class="select" value={settings.download.caption_locale} onchange={changeCaptionLocale}>+ <option value="en">English</option>+ <option value="pt">Português</option>+ <option value="es">Español</option>+ <option value="fr">Français</option>+ <option value="it">Italiano</option>+ <option value="ja">日本語</option>+ <option value="zh-Hans">简体中文</option>+ <option value="zh-Hant">繁體中文</option>+ <option value="el">Ελληνικά</option>+ </select>+ </div>+ <div class="divider"></div>+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">{$t('settings.download.keep_vtt')}</span>+ <span class="setting-path">{$t('settings.download.keep_vtt_desc')}</span>+ </div>+ <button class="toggle" class:on={settings.download.keep_vtt} onclick={() => toggleBool("download", "keep_vtt", settings.download.keep_vtt)} role="switch" aria-checked={settings.download.keep_vtt} aria-label={$t('settings.download.keep_vtt') as string}><span class="toggle-knob"></span></button>+ </div>{/if}<div class="divider"></div><div class="setting-row">@@ -374,6 +405,19 @@</div></details>+<details class="section">+ <summary class="section-title">{$t('settings.download.courses_section')}</summary>+ <div class="card">+ <div class="setting-row">+ <div class="setting-col">+ <span class="setting-label">{$t('settings.download.continuous_lecture_numbers')}</span>+ <span class="setting-path">{$t('settings.download.continuous_lecture_numbers_desc')}</span>+ </div>+ <button class="toggle" class:on={settings.download.continuous_lecture_numbers} onclick={() => toggleBool("download", "continuous_lecture_numbers", settings.download.continuous_lecture_numbers)} role="switch" aria-checked={settings.download.continuous_lecture_numbers} aria-label={$t('settings.download.continuous_lecture_numbers') as string}><span class="toggle-knob"></span></button>+ </div>+ </div>+</details>+<details class="section"><summary class="section-title">{$t('settings.download.clipboard_detection')}</summary><div class="card">diff --git a/src/lib/components/cookies/CookieBucketCard.svelte b/src/lib/components/cookies/CookieBucketCard.sveltenew file mode 100644index 00000000..ec360cc4--- /dev/null+++ b/src/lib/components/cookies/CookieBucketCard.svelte@@ -0,0 +1,460 @@+<script lang="ts">+ import { t } from "$lib/i18n";+ import { open as openShell } from "@tauri-apps/plugin-shell";+ import PlatformLogo from "./PlatformLogo.svelte";++ type Account = {+ slug: string;+ alias: string;+ source_url: string | null;+ source_label: string | null;+ captured_at_ms: number;+ cookie_count: number;+ last_used_at_ms: number | null;+ };++ type Bucket = {+ domain: string;+ platform_kind: string;+ accounts: Account[];+ };++ type Props = {+ bucket: Bucket;+ onView: (domain: string, slug: string) => void;+ onExport: (domain: string, slug: string) => void;+ onRename: (domain: string, slug: string, currentAlias: string) => void;+ onClear: (domain: string, slug: string) => void;+ onAddAccount?: (domain: string) => void;+ };++ let { bucket, onView, onExport, onRename, onClear, onAddAccount }: Props = $props();++ let primaryAccount = $derived(bucket.accounts.find((a) => a.slug === "_default") ?? bucket.accounts[0]);+ let extraAccounts = $derived(bucket.accounts.filter((a) => a !== primaryAccount));+ let isEditing = $state(false);+ let editValue = $state("");+ let inputRef = $state<HTMLInputElement | null>(null);++ let status = $derived.by(() => {+ if (!primaryAccount) return "empty";+ const ageMs = Date.now() - primaryAccount.captured_at_ms;+ const dayMs = 24 * 60 * 60 * 1000;+ if (ageMs < dayMs) return "fresh";+ if (ageMs < 30 * dayMs) return "aging";+ return "stale";+ });++ let statusLabel = $derived.by(() => {+ if (status === "fresh") return $t("settings.cookies.status_fresh") as string;+ if (status === "aging") return $t("settings.cookies.status_aging") as string;+ if (status === "stale") return $t("settings.cookies.status_stale") as string;+ return $t("settings.cookies.status_empty") as string;+ });++ function fmtAgo(ms: number): string {+ const seconds = Math.floor((Date.now() - ms) / 1000);+ if (seconds < 60) return $t("settings.cookies.time_just_now") as string;+ const minutes = Math.floor(seconds / 60);+ if (minutes < 60) return ($t("settings.cookies.time_minutes", { count: String(minutes) }) as string) || `${minutes} min`;+ const hours = Math.floor(minutes / 60);+ if (hours < 24) return ($t("settings.cookies.time_hours", { count: String(hours) }) as string) || `${hours}h`;+ const days = Math.floor(hours / 24);+ if (days < 30) return ($t("settings.cookies.time_days", { count: String(days) }) as string) || `${days}d`;+ const months = Math.floor(days / 30);+ if (months < 12) return ($t("settings.cookies.time_months", { count: String(months) }) as string) || `${months}m`;+ const years = Math.floor(months / 12);+ return ($t("settings.cookies.time_years", { count: String(years) }) as string) || `${years}y`;+ }++ function platformDisplayName(kind: string, domain: string): string {+ const map: Record<string, string> = {+ youtube: "YouTube",+ youtube_music: "YouTube Music",+ soundcloud: "SoundCloud",+ spotify: "Spotify",+ twitch: "Twitch",+ instagram: "Instagram",+ x_twitter: "X",+ vimeo: "Vimeo",+ tiktok: "TikTok",+ bilibili: "Bilibili",+ reddit: "Reddit",+ pinterest: "Pinterest",+ bluesky: "Bluesky",+ };+ return map[kind] ?? domain;+ }++ function startEdit() {+ if (!primaryAccount) return;+ editValue = primaryAccount.alias;+ isEditing = true;+ queueMicrotask(() => inputRef?.focus());+ }++ function commitEdit() {+ if (!primaryAccount) return;+ const trimmed = editValue.trim();+ if (trimmed && trimmed !== primaryAccount.alias) {+ onRename(bucket.domain, primaryAccount.slug, trimmed);+ }+ isEditing = false;+ }++ function cancelEdit() {+ isEditing = false;+ editValue = "";+ }++ function onAliasKey(e: KeyboardEvent) {+ if (e.key === "Enter") {+ e.preventDefault();+ commitEdit();+ } else if (e.key === "Escape") {+ e.preventDefault();+ cancelEdit();+ }+ }++ async function openSourceUrl() {+ if (!primaryAccount?.source_url) return;+ try {+ await openShell(primaryAccount.source_url);+ } catch (e) {+ console.warn("[cookies] failed to open source url", e);+ }+ }+</script>++<article class="bucket-card" data-status={status}>+ <PlatformLogo kind={bucket.platform_kind as never} domain={bucket.domain} size={56} />++ <div class="meta">+ <div class="top-row">+ {#if isEditing}+ <input+ bind:this={inputRef}+ class="alias-input"+ bind:value={editValue}+ onkeydown={onAliasKey}+ onblur={commitEdit}+ aria-label={$t("settings.cookies.alias_aria") as string}+ />+ {:else}+ <button+ type="button"+ class="alias-display"+ onclick={startEdit}+ aria-label={$t("settings.cookies.alias_edit_aria") as string}+ >+ <span class="alias-text">{primaryAccount?.alias ?? bucket.domain}</span>+ <svg class="pencil" viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"/>+ <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"/>+ </svg>+ </button>+ {/if}+ </div>++ <p class="platform-line">+ <span class="platform-name">{platformDisplayName(bucket.platform_kind, bucket.domain)}</span>+ <span class="sep">·</span>+ <span class="domain">{bucket.domain}</span>+ {#if primaryAccount}+ <span class="sep">·</span>+ <span class="count">{$t("settings.cookies.count_cookies", { count: String(primaryAccount.cookie_count) })}</span>+ {/if}+ </p>++ {#if primaryAccount?.source_url}+ <p class="source-line">+ <span class="source-label">{$t("settings.cookies.captured_from")}</span>+ <button type="button" class="source-link" onclick={openSourceUrl} title={primaryAccount.source_url}>+ {primaryAccount.source_url}+ </button>+ </p>+ {/if}++ {#if primaryAccount}+ <p class="time-line">+ <span>{fmtAgo(primaryAccount.captured_at_ms)}</span>+ {#if primaryAccount.source_label}+ <span class="sep">·</span>+ <span class="via">{$t("settings.cookies.via_label", { label: primaryAccount.source_label })}</span>+ {/if}+ </p>+ {/if}++ {#if primaryAccount}+ <div class="actions">+ <button type="button" class="ghost-btn" onclick={() => onView(bucket.domain, primaryAccount.slug)}>+ {$t("settings.cookies.action_view")}+ </button>+ <button type="button" class="ghost-btn" onclick={() => onExport(bucket.domain, primaryAccount.slug)}>+ {$t("settings.cookies.action_export")}+ </button>+ <button type="button" class="ghost-btn" onclick={() => startEdit()}>+ {$t("settings.cookies.action_rename")}+ </button>+ <button type="button" class="ghost-btn danger" onclick={() => onClear(bucket.domain, primaryAccount.slug)}>+ {$t("settings.cookies.action_clear")}+ </button>+ </div>+ {/if}++ {#if extraAccounts.length > 0}+ <ul class="extra-accounts">+ {#each extraAccounts as account (account.slug)}+ <li class="extra-account">+ <span class="extra-alias">{account.alias}</span>+ <span class="extra-count">{$t("settings.cookies.count_cookies", { count: String(account.cookie_count) })}</span>+ <div class="extra-actions">+ <button type="button" class="mini-btn" onclick={() => onView(bucket.domain, account.slug)} aria-label={$t("settings.cookies.action_view") as string}>+ <svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/></svg>+ </button>+ <button type="button" class="mini-btn" onclick={() => onExport(bucket.domain, account.slug)} aria-label={$t("settings.cookies.action_export") as string}>+ <svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3"/></svg>+ </button>+ <button type="button" class="mini-btn danger" onclick={() => onClear(bucket.domain, account.slug)} aria-label={$t("settings.cookies.action_clear") as string}>+ <svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>+ </button>+ </div>+ </li>+ {/each}+ </ul>+ {/if}++ {#if onAddAccount && primaryAccount}+ <button type="button" class="add-account-btn" onclick={() => onAddAccount(bucket.domain)}>+ + {$t("settings.cookies.add_account_label")}+ </button>+ {/if}+ </div>++ <div class="status-dot" data-state={status} title={statusLabel} aria-label={statusLabel}></div>+</article>++<style>+ .bucket-card {+ position: relative;+ display: grid;+ grid-template-columns: 56px 1fr 12px;+ gap: 18px;+ padding: 18px;+ background: color-mix(in oklab, var(--button) 25%, transparent);+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 14px;+ transition: border-color 120ms;+ }+ .bucket-card:hover {+ border-color: color-mix(in oklab, var(--content-border) 70%, transparent);+ }+ .meta {+ min-width: 0;+ display: flex;+ flex-direction: column;+ gap: 4px;+ }+ .top-row {+ display: flex;+ align-items: center;+ min-height: 24px;+ }+ .alias-display {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 0;+ background: transparent;+ border: 0;+ color: var(--primary);+ font-size: 16px;+ font-weight: 600;+ cursor: pointer;+ text-align: left;+ max-width: 100%;+ }+ .alias-text {+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .pencil {+ opacity: 0;+ transition: opacity 120ms;+ flex-shrink: 0;+ }+ .alias-display:hover .pencil,+ .alias-display:focus-visible .pencil {+ opacity: 0.6;+ }+ .alias-input {+ width: 100%;+ padding: 2px 8px;+ background: color-mix(in oklab, var(--button) 60%, transparent);+ border: 1px solid var(--accent);+ border-radius: 6px;+ color: var(--primary);+ font-size: 16px;+ font-weight: 600;+ outline: none;+ }+ .platform-line,+ .source-line,+ .time-line {+ margin: 0;+ font-size: 12px;+ color: var(--secondary);+ line-height: 1.4;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .platform-name {+ font-weight: 500;+ }+ .domain {+ font-family: ui-monospace, "Cascadia Code", monospace;+ color: var(--tertiary);+ }+ .count {+ color: var(--tertiary);+ }+ .sep {+ margin: 0 6px;+ color: var(--tertiary);+ opacity: 0.5;+ }+ .source-line {+ color: var(--tertiary);+ }+ .source-label {+ color: var(--tertiary);+ }+ .source-link {+ padding: 0;+ background: transparent;+ border: 0;+ color: var(--accent);+ font: inherit;+ cursor: pointer;+ text-decoration: underline;+ text-underline-offset: 2px;+ max-width: 100%;+ overflow: hidden;+ text-overflow: ellipsis;+ vertical-align: bottom;+ }+ .source-link:hover {+ filter: brightness(1.2);+ }+ .time-line {+ color: var(--tertiary);+ font-size: 11px;+ }+ .actions {+ display: flex;+ gap: 6px;+ margin-top: 8px;+ flex-wrap: wrap;+ }+ .ghost-btn {+ padding: 5px 12px;+ background: transparent;+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 999px;+ color: var(--secondary);+ font-size: 12px;+ cursor: pointer;+ transition: border-color 120ms, color 120ms, background 120ms;+ }+ .ghost-btn:hover {+ border-color: var(--accent);+ color: var(--accent);+ }+ .ghost-btn.danger:hover {+ border-color: #d33;+ color: #d33;+ }+ .status-dot {+ width: 8px;+ height: 8px;+ border-radius: 50%;+ align-self: start;+ margin-top: 6px;+ }+ .status-dot[data-state="fresh"] { background: #1DB954; }+ .status-dot[data-state="aging"] { background: #f4a72b; }+ .status-dot[data-state="stale"] { background: #d33; }+ .status-dot[data-state="empty"] { background: var(--tertiary); opacity: 0.4; }++ .extra-accounts {+ list-style: none;+ margin: 8px 0 0;+ padding: 8px 0 0;+ border-top: 1px dashed color-mix(in oklab, var(--content-border) 30%, transparent);+ display: flex;+ flex-direction: column;+ gap: 4px;+ }+ .extra-account {+ display: grid;+ grid-template-columns: 1fr auto auto;+ gap: 10px;+ align-items: center;+ padding: 4px 0;+ font-size: 12px;+ }+ .extra-alias {+ color: var(--secondary);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ }+ .extra-count {+ color: var(--tertiary);+ font-size: 11px;+ }+ .extra-actions {+ display: flex;+ gap: 4px;+ }+ .mini-btn {+ width: 24px;+ height: 24px;+ padding: 0;+ background: transparent;+ border: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ border-radius: 6px;+ color: var(--tertiary);+ cursor: pointer;+ display: inline-flex;+ align-items: center;+ justify-content: center;+ transition: border-color 120ms, color 120ms;+ }+ .mini-btn:hover {+ border-color: var(--accent);+ color: var(--accent);+ }+ .mini-btn.danger:hover {+ border-color: #d33;+ color: #d33;+ }+ .add-account-btn {+ margin-top: 8px;+ padding: 6px 0;+ background: transparent;+ border: 0;+ color: var(--tertiary);+ font: inherit;+ font-size: 11px;+ cursor: pointer;+ align-self: flex-start;+ transition: color 120ms;+ }+ .add-account-btn:hover {+ color: var(--accent);+ }+</style>diff --git a/src/lib/components/cookies/CookieContentModal.svelte b/src/lib/components/cookies/CookieContentModal.sveltenew file mode 100644index 00000000..0dea57af--- /dev/null+++ b/src/lib/components/cookies/CookieContentModal.svelte@@ -0,0 +1,297 @@+<script lang="ts">+ import { t } from "$lib/i18n";+ import { showToast } from "$lib/stores/toast-store.svelte";++ type Props = {+ open: boolean;+ domain: string;+ slug: string;+ content: string;+ path: string;+ onClose: () => void;+ };++ let { open, domain, slug, content, path, onClose }: Props = $props();++ let filter = $state("");+ let nowSec = $derived(Math.floor(Date.now() / 1000));++ type ParsedLine = {+ raw: string;+ domain: string;+ name: string;+ value: string;+ expires: number;+ http_only: boolean;+ expired: boolean;+ };++ let parsed = $derived.by<ParsedLine[]>(() => {+ const out: ParsedLine[] = [];+ for (const raw of content.split("\n")) {+ const trimmed = raw.trim();+ if (!trimmed) continue;+ let effective = trimmed;+ let http_only = false;+ if (trimmed.startsWith("#HttpOnly_")) {+ effective = trimmed.slice("#HttpOnly_".length);+ http_only = true;+ } else if (trimmed.startsWith("#")) {+ continue;+ }+ const parts = effective.split("\t");+ if (parts.length < 7) continue;+ const expires = parseInt(parts[4] ?? "0", 10) || 0;+ out.push({+ raw,+ domain: parts[0] ?? "",+ name: parts[5] ?? "",+ value: parts[6] ?? "",+ expires,+ http_only,+ expired: expires > 0 && expires < nowSec,+ });+ }+ return out;+ });++ let filtered = $derived(+ !filter.trim()+ ? parsed+ : parsed.filter((p) => p.name.toLowerCase().includes(filter.toLowerCase().trim())),+ );++ let expiredCount = $derived(parsed.filter((p) => p.expired).length);++ async function copyAll() {+ try {+ await navigator.clipboard.writeText(content);+ showToast("success", $t("settings.cookies.modal_copied") as string);+ } catch {+ showToast("error", "clipboard");+ }+ }+</script>++{#if open}+ <div+ class="overlay"+ onclick={(e) => { if (e.target === e.currentTarget) onClose(); }}+ onkeydown={(e) => { if (e.key === "Escape") onClose(); }}+ role="presentation"+ >+ <div class="modal" role="dialog" aria-label={$t("settings.cookies.modal_title") as string}>+ <header class="modal-head">+ <h2>{$t("settings.cookies.modal_title")}</h2>+ <p class="subtitle">+ <span class="domain">{domain}</span>+ {#if slug !== "_default"}<span class="slug">/{slug}</span>{/if}+ </p>+ <button class="close" type="button" onclick={onClose} aria-label={$t("settings.cookies.modal_close") as string}>×</button>+ </header>++ <div class="toolbar">+ <input+ type="search"+ class="filter"+ placeholder={$t("settings.cookies.modal_filter_placeholder") as string}+ bind:value={filter}+ />+ <button type="button" class="ghost-btn" onclick={copyAll}>+ {$t("settings.cookies.modal_copy_all")}+ </button>+ </div>++ <div class="list">+ {#if filtered.length === 0}+ <p class="empty">{$t("settings.cookies.modal_no_results")}</p>+ {:else}+ <ul>+ {#each filtered as row, i (row.name + i)}+ <li class:expired={row.expired}>+ <span class="row-name">{row.name}</span>+ <span class="row-domain">{row.domain}</span>+ <span class="row-value">{row.value}</span>+ {#if row.expired}+ <span class="expired-tag">{$t("settings.cookies.modal_expired_tag")}</span>+ {/if}+ {#if row.http_only}+ <span class="httponly-tag">httpOnly</span>+ {/if}+ </li>+ {/each}+ </ul>+ {/if}+ </div>++ <footer class="modal-foot">+ <span class="stat">{$t("settings.cookies.modal_total", { count: String(parsed.length) })}</span>+ {#if expiredCount > 0}+ <span class="stat warn">{$t("settings.cookies.modal_expired_count", { count: String(expiredCount) })}</span>+ {/if}+ <span class="path" title={path}>{path}</span>+ </footer>+ </div>+ </div>+{/if}++<style>+ .overlay {+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.6);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 1000;+ padding: 24px;+ }+ .modal {+ width: min(720px, 100%);+ max-height: 80vh;+ display: flex;+ flex-direction: column;+ background: var(--background);+ border: 1px solid color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 16px;+ overflow: hidden;+ }+ .modal-head {+ position: relative;+ padding: 20px 56px 16px 20px;+ border-bottom: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ }+ .modal-head h2 {+ margin: 0;+ font-size: 18px;+ font-weight: 600;+ color: var(--primary);+ }+ .subtitle {+ margin: 4px 0 0;+ font-size: 12px;+ color: var(--tertiary);+ }+ .domain {+ font-family: ui-monospace, monospace;+ }+ .slug {+ color: var(--secondary);+ }+ .close {+ position: absolute;+ top: 14px;+ right: 14px;+ width: 28px;+ height: 28px;+ padding: 0;+ background: transparent;+ border: 0;+ border-radius: 50%;+ color: var(--tertiary);+ font-size: 18px;+ cursor: pointer;+ }+ .close:hover {+ color: var(--secondary);+ background: color-mix(in oklab, var(--button) 40%, transparent);+ }+ .toolbar {+ display: flex;+ gap: 10px;+ padding: 12px 20px;+ border-bottom: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ }+ .filter {+ flex: 1;+ padding: 6px 12px;+ background: color-mix(in oklab, var(--button) 50%, transparent);+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 999px;+ color: var(--secondary);+ font-size: 13px;+ outline: none;+ }+ .filter:focus { border-color: var(--accent); }+ .ghost-btn {+ padding: 6px 14px;+ background: transparent;+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 999px;+ color: var(--secondary);+ font-size: 12px;+ cursor: pointer;+ }+ .ghost-btn:hover { border-color: var(--accent); color: var(--accent); }+ .list {+ flex: 1;+ overflow-y: auto;+ padding: 8px 20px;+ }+ .list ul {+ list-style: none;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ gap: 4px;+ }+ .list li {+ display: grid;+ grid-template-columns: 1.2fr 1.5fr 2fr auto auto;+ gap: 10px;+ align-items: center;+ padding: 6px 8px;+ font-size: 12px;+ font-family: ui-monospace, "Cascadia Code", monospace;+ border-radius: 6px;+ }+ .list li:hover {+ background: color-mix(in oklab, var(--button) 30%, transparent);+ }+ .list li.expired {+ color: var(--tertiary);+ text-decoration: line-through;+ }+ .row-name { font-weight: 600; color: var(--primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .row-domain { color: var(--tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .row-value { color: var(--secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }+ .expired-tag {+ font-size: 10px;+ padding: 2px 6px;+ background: color-mix(in oklab, #d33 20%, transparent);+ color: #d33;+ border-radius: 4px;+ text-decoration: none;+ }+ .httponly-tag {+ font-size: 10px;+ padding: 2px 6px;+ background: color-mix(in oklab, var(--accent) 15%, transparent);+ color: var(--accent);+ border-radius: 4px;+ }+ .empty {+ text-align: center;+ padding: 30px;+ color: var(--tertiary);+ }+ .modal-foot {+ padding: 12px 20px;+ border-top: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ display: flex;+ align-items: center;+ gap: 16px;+ font-size: 11px;+ color: var(--tertiary);+ }+ .stat.warn { color: #f4a72b; }+ .path {+ margin-left: auto;+ font-family: ui-monospace, monospace;+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ max-width: 50%;+ }+</style>diff --git a/src/lib/components/cookies/CookieImportMenu.svelte b/src/lib/components/cookies/CookieImportMenu.sveltenew file mode 100644index 00000000..2bfb14ce--- /dev/null+++ b/src/lib/components/cookies/CookieImportMenu.svelte@@ -0,0 +1,125 @@+<script lang="ts">+ import { t } from "$lib/i18n";+ import { open as openDialog } from "@tauri-apps/plugin-dialog";++ type Props = {+ onImportFile: (path: string) => void;+ onImportPaste: () => void;+ };++ let { onImportFile, onImportPaste }: Props = $props();++ let pickerOpen = $state(false);++ async function chooseFile() {+ pickerOpen = false;+ try {+ const selected = await openDialog({+ title: $t("settings.cookies.import_file_dialog_title") as string,+ filters: [+ { name: "Cookies", extensions: ["txt", "json"] },+ { name: "All", extensions: ["*"] },+ ],+ multiple: false,+ });+ if (selected && typeof selected === "string") {+ onImportFile(selected);+ }+ } catch (e) {+ console.warn("[cookies] file picker failed", e);+ }+ }++ function pickPaste() {+ pickerOpen = false;+ onImportPaste();+ }+</script>++<div class="import-menu">+ <button type="button" class="trigger" onclick={() => pickerOpen = !pickerOpen}>+ {$t("settings.cookies.import_trigger")}+ <svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>+ </button>+ {#if pickerOpen}+ <div class="menu" role="menu">+ <button type="button" class="menu-item" onclick={chooseFile} role="menuitem">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>+ <polyline points="14 2 14 8 20 8"/>+ </svg>+ <div class="item-text">+ <span class="item-title">{$t("settings.cookies.import_file_title")}</span>+ <span class="item-hint">{$t("settings.cookies.import_file_hint")}</span>+ </div>+ </button>+ <button type="button" class="menu-item" onclick={pickPaste} role="menuitem">+ <svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <rect x="8" y="2" width="8" height="4" rx="1"/>+ <path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>+ </svg>+ <div class="item-text">+ <span class="item-title">{$t("settings.cookies.import_paste_title")}</span>+ <span class="item-hint">{$t("settings.cookies.import_paste_hint")}</span>+ </div>+ </button>+ </div>+ {/if}+</div>++<svelte:window onclick={(e) => {+ if (pickerOpen && !(e.target as HTMLElement)?.closest(".import-menu")) {+ pickerOpen = false;+ }+}} />++<style>+ .import-menu { position: relative; display: inline-block; }+ .trigger {+ display: inline-flex;+ align-items: center;+ gap: 6px;+ padding: 7px 14px;+ background: var(--accent);+ color: white;+ border: 0;+ border-radius: 999px;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ transition: filter 120ms;+ }+ .trigger:hover { filter: brightness(1.1); }+ .menu {+ position: absolute;+ top: calc(100% + 4px);+ right: 0;+ min-width: 240px;+ background: var(--background);+ border: 1px solid color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 10px;+ overflow: hidden;+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);+ z-index: 50;+ display: flex;+ flex-direction: column;+ }+ .menu-item {+ display: flex;+ align-items: flex-start;+ gap: 12px;+ padding: 12px 14px;+ background: transparent;+ border: 0;+ color: var(--secondary);+ font: inherit;+ text-align: left;+ cursor: pointer;+ transition: background 120ms;+ }+ .menu-item:hover { background: color-mix(in oklab, var(--button) 40%, transparent); color: var(--primary); }+ .menu-item svg { margin-top: 2px; flex-shrink: 0; }+ .item-text { display: flex; flex-direction: column; gap: 2px; }+ .item-title { font-size: 13px; font-weight: 500; }+ .item-hint { font-size: 11px; color: var(--tertiary); }+</style>diff --git a/src/lib/components/cookies/CookiePasteModal.svelte b/src/lib/components/cookies/CookiePasteModal.sveltenew file mode 100644index 00000000..3e6af85f--- /dev/null+++ b/src/lib/components/cookies/CookiePasteModal.svelte@@ -0,0 +1,162 @@+<script lang="ts">+ import { t } from "$lib/i18n";++ type Props = {+ open: boolean;+ onSubmit: (content: string, sourceUrl: string, alias: string) => void;+ onClose: () => void;+ };++ let { open, onSubmit, onClose }: Props = $props();++ let content = $state("");+ let sourceUrl = $state("");+ let alias = $state("");+ let busy = $state(false);++ function submit() {+ if (!content.trim()) return;+ busy = true;+ onSubmit(content, sourceUrl.trim(), alias.trim());+ }++ function reset() {+ content = "";+ sourceUrl = "";+ alias = "";+ busy = false;+ }++ $effect(() => {+ if (!open) reset();+ });+</script>++{#if open}+ <div+ class="overlay"+ onclick={(e) => { if (e.target === e.currentTarget) onClose(); }}+ onkeydown={(e) => { if (e.key === "Escape") onClose(); }}+ role="presentation"+ >+ <div class="modal" role="dialog" aria-label={$t("settings.cookies.paste_modal_title") as string}>+ <header class="modal-head">+ <h2>{$t("settings.cookies.paste_modal_title")}</h2>+ <p class="subtitle">{$t("settings.cookies.paste_modal_subtitle")}</p>+ <button type="button" class="close" onclick={onClose} aria-label={$t("settings.cookies.modal_close") as string}>×</button>+ </header>++ <div class="body">+ <label class="field">+ <span class="lbl">{$t("settings.cookies.paste_field_content")}</span>+ <textarea bind:value={content} rows="10" placeholder={$t("settings.cookies.paste_content_placeholder") as string} spellcheck="false"></textarea>+ </label>++ <label class="field">+ <span class="lbl">{$t("settings.cookies.paste_field_source")}</span>+ <input type="url" bind:value={sourceUrl} placeholder={$t("settings.cookies.paste_source_placeholder") as string} />+ </label>++ <label class="field">+ <span class="lbl">{$t("settings.cookies.paste_field_alias")}</span>+ <input type="text" bind:value={alias} placeholder={$t("settings.cookies.paste_alias_placeholder") as string} />+ </label>+ </div>++ <footer class="modal-foot">+ <button type="button" class="ghost-btn" onclick={onClose}>{$t("settings.cookies.paste_cancel")}</button>+ <button type="button" class="primary-btn" onclick={submit} disabled={!content.trim() || busy}>+ {busy ? $t("settings.cookies.paste_importing") : $t("settings.cookies.paste_submit")}+ </button>+ </footer>+ </div>+ </div>+{/if}++<style>+ .overlay {+ position: fixed;+ inset: 0;+ background: rgba(0, 0, 0, 0.6);+ display: flex;+ align-items: center;+ justify-content: center;+ z-index: 1000;+ padding: 24px;+ }+ .modal {+ width: min(560px, 100%);+ max-height: 80vh;+ display: flex;+ flex-direction: column;+ background: var(--background);+ border: 1px solid color-mix(in oklab, var(--content-border) 50%, transparent);+ border-radius: 16px;+ overflow: hidden;+ }+ .modal-head {+ position: relative;+ padding: 20px 56px 16px 20px;+ border-bottom: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ }+ .modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; color: var(--primary); }+ .subtitle { margin: 4px 0 0; font-size: 12px; color: var(--tertiary); line-height: 1.5; }+ .close {+ position: absolute;+ top: 14px; right: 14px;+ width: 28px; height: 28px;+ padding: 0;+ background: transparent;+ border: 0;+ border-radius: 50%;+ color: var(--tertiary);+ font-size: 18px;+ cursor: pointer;+ }+ .close:hover { color: var(--secondary); background: color-mix(in oklab, var(--button) 40%, transparent); }+ .body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; flex: 1; }+ .field { display: flex; flex-direction: column; gap: 6px; }+ .lbl { font-size: 11px; font-weight: 600; color: var(--tertiary); text-transform: uppercase; letter-spacing: 0.04em; }+ textarea, input[type="url"], input[type="text"] {+ padding: 8px 12px;+ background: color-mix(in oklab, var(--button) 40%, transparent);+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 8px;+ color: var(--primary);+ font: inherit;+ font-size: 13px;+ outline: none;+ resize: vertical;+ }+ textarea { font-family: ui-monospace, "Cascadia Code", monospace; min-height: 120px; }+ textarea:focus, input:focus { border-color: var(--accent); }+ .modal-foot {+ padding: 14px 20px;+ border-top: 1px solid color-mix(in oklab, var(--content-border) 30%, transparent);+ display: flex;+ justify-content: flex-end;+ gap: 10px;+ }+ .ghost-btn {+ padding: 7px 16px;+ background: transparent;+ border: 1px solid color-mix(in oklab, var(--content-border) 40%, transparent);+ border-radius: 999px;+ color: var(--secondary);+ font-size: 13px;+ cursor: pointer;+ }+ .ghost-btn:hover { border-color: var(--accent); color: var(--accent); }+ .primary-btn {+ padding: 7px 18px;+ background: var(--accent);+ color: white;+ border: 0;+ border-radius: 999px;+ font-size: 13px;+ font-weight: 500;+ cursor: pointer;+ }+ .primary-btn:hover:not(:disabled) { filter: brightness(1.1); }+ .primary-btn:disabled { opacity: 0.5; cursor: not-allowed; }+</style>diff --git a/src/lib/components/cookies/PlatformLogo.svelte b/src/lib/components/cookies/PlatformLogo.sveltenew file mode 100644index 00000000..598d54d4--- /dev/null+++ b/src/lib/components/cookies/PlatformLogo.svelte@@ -0,0 +1,186 @@+<script lang="ts">+ type Kind =+ | "youtube"+ | "youtube_music"+ | "soundcloud"+ | "spotify"+ | "twitch"+ | "instagram"+ | "x_twitter"+ | "vimeo"+ | "tiktok"+ | "bilibili"+ | "douyin"+ | "reddit"+ | "pinterest"+ | "bluesky"+ | "generic";++ type Props = {+ kind: Kind;+ size?: number;+ domain?: string;+ };++ let { kind, size = 56, domain = "" }: Props = $props();++ function genericGradient(seed: string): string {+ let hash = 0;+ for (let i = 0; i < seed.length; i++) {+ hash = (hash << 5) - hash + seed.charCodeAt(i);+ hash |= 0;+ }+ const h1 = Math.abs(hash) % 360;+ const h2 = (h1 + 60) % 360;+ return `linear-gradient(135deg, hsl(${h1} 60% 45%), hsl(${h2} 60% 35%))`;+ }++ let genericInitial = $derived(+ domain ? domain.trim().charAt(0).toUpperCase() || "?" : "?",+ );+ let genericBg = $derived(genericGradient(domain || "x"));+</script>++<div class="logo" style="width: {size}px; height: {size}px;" data-kind={kind}>+ {#if kind === "youtube"}+ <div class="bg yt">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M8 5v14l11-7z"/>+ </svg>+ </div>+ {:else if kind === "youtube_music"}+ <div class="bg ytm">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <circle cx="12" cy="12" r="10" fill="none" stroke="white" stroke-width="2"/>+ <path d="M10 8v8l6-4z"/>+ </svg>+ </div>+ {:else if kind === "soundcloud"}+ <div class="bg sc">+ <svg viewBox="0 0 24 24" width="70%" height="70%" fill="white" aria-hidden="true">+ <path d="M2 14v4M5 12v6M8 10v8M11 8v10M14 6v12M17 8v8M20 10v6"+ stroke="white" stroke-width="1.6" stroke-linecap="round" fill="none"/>+ </svg>+ </div>+ {:else if kind === "spotify"}+ <div class="bg sp">+ <svg viewBox="0 0 24 24" width="65%" height="65%" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" aria-hidden="true">+ <path d="M5 9a14 14 0 0 1 14 1"/>+ <path d="M6 13a11 11 0 0 1 11 1"/>+ <path d="M7 17a8 8 0 0 1 8 0"/>+ </svg>+ </div>+ {:else if kind === "twitch"}+ <div class="bg tw">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M4 4v14h4v3l3-3h4l5-5V4H4zm14 8l-3 3h-3l-3 3v-3H6V6h12v6z"/>+ </svg>+ </div>+ {:else if kind === "instagram"}+ <div class="bg ig">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="none" stroke="white" stroke-width="2" aria-hidden="true">+ <rect x="3" y="3" width="18" height="18" rx="5"/>+ <circle cx="12" cy="12" r="4"/>+ <circle cx="17.5" cy="6.5" r="1" fill="white"/>+ </svg>+ </div>+ {:else if kind === "x_twitter"}+ <div class="bg x">+ <svg viewBox="0 0 24 24" width="55%" height="55%" fill="white" aria-hidden="true">+ <path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/>+ </svg>+ </div>+ {:else if kind === "vimeo"}+ <div class="bg vm">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M22 6.4c-.1 2.2-1.6 5.2-4.7 9-3.1 3.9-5.7 5.9-7.9 5.9-1.3 0-2.4-1.2-3.4-3.7C5.4 15.4 5 13 4.6 11c-.5-2.5-1-3.7-1.6-3.7-.1 0-.6.3-1.5.9l-.9-1.2C2.4 5.7 4.1 4 5.5 3.9c1.6-.2 2.6.9 3 3.4.4 2.7.7 4.4.9 5 .5 1.6 1 2.4 1.6 2.4.5 0 1.2-.7 2.1-2.2.9-1.5 1.4-2.6 1.5-3.4.1-.9-.3-1.4-1.1-1.4-.4 0-.8.1-1.2.3.9-2.8 2.5-4.2 5-4.1 1.7.1 2.6 1.3 2.7 3.5z"/>+ </svg>+ </div>+ {:else if kind === "tiktok"}+ <div class="bg tt">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5.8 20.1a6.34 6.34 0 0 0 10.86-4.43V8.43a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1.84-.86z"/>+ </svg>+ </div>+ {:else if kind === "bilibili"}+ <div class="bg bl">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M17.8 6h-1.5l-1.7-1.7c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4l.3.3h-3l.3-.3c.4-.4.4-1 0-1.4s-1-.4-1.4 0L7.7 6H6.2C4.4 6 3 7.4 3 9.2v6.5C3 17.6 4.4 19 6.2 19h11.6c1.8 0 3.2-1.4 3.2-3.2V9.2C21 7.4 19.6 6 17.8 6zM8 14H6v-3h2v3zm10 0h-2v-3h2v3z"/>+ </svg>+ </div>+ {:else if kind === "douyin"}+ <div class="bg dy">+ <svg viewBox="0 0 24 24" width="62%" height="62%" fill="white" aria-hidden="true">+ <path d="M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-5.2 1.74 2.89 2.89 0 0 1 2.31-4.64 2.93 2.93 0 0 1 .88.13V9.4a6.84 6.84 0 0 0-1-.05A6.33 6.33 0 0 0 5.8 20.1a6.34 6.34 0 0 0 10.86-4.43V8.43a8.16 8.16 0 0 0 4.77 1.52v-3.4a4.85 4.85 0 0 1-1.84-.86z"/>+ </svg>+ </div>+ {:else if kind === "reddit"}+ <div class="bg rd">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <circle cx="12" cy="13" r="7" fill="none" stroke="white" stroke-width="1.6"/>+ <circle cx="9" cy="13" r="1.2"/>+ <circle cx="15" cy="13" r="1.2"/>+ <path d="M9 16c1 1 5 1 6 0" stroke="white" stroke-width="1.4" fill="none" stroke-linecap="round"/>+ <circle cx="18.5" cy="6.5" r="1.5"/>+ </svg>+ </div>+ {:else if kind === "pinterest"}+ <div class="bg pn">+ <svg viewBox="0 0 24 24" width="60%" height="60%" fill="white" aria-hidden="true">+ <path d="M12 2C6.5 2 2 6.5 2 12c0 4.2 2.6 7.8 6.3 9.3-.1-.8-.2-2 0-2.9.2-.8 1.1-5.2 1.1-5.2s-.3-.6-.3-1.4c0-1.3.8-2.4 1.7-2.4.8 0 1.2.6 1.2 1.4 0 .8-.5 2.1-.8 3.3-.2 1 .5 1.8 1.5 1.8 1.8 0 3.2-1.9 3.2-4.7 0-2.4-1.7-4.1-4.2-4.1-2.9 0-4.6 2.2-4.6 4.4 0 .9.3 1.8.8 2.3.1.1.1.2.1.3l-.3 1.2c0 .2-.2.2-.4.1-1.3-.6-2.2-2.5-2.2-4 0-3.3 2.4-6.3 6.9-6.3 3.6 0 6.4 2.6 6.4 6 0 3.6-2.3 6.5-5.4 6.5-1.1 0-2.1-.6-2.4-1.2l-.7 2.5c-.2.9-.9 2-1.3 2.7.9.3 1.9.4 2.9.4 5.5 0 10-4.5 10-10S17.5 2 12 2z"/>+ </svg>+ </div>+ {:else if kind === "bluesky"}+ <div class="bg bs">+ <svg viewBox="0 0 24 24" width="65%" height="65%" fill="white" aria-hidden="true">+ <path d="M5.3 3.7c2.8 2.1 5.9 6.4 7 8.7 1.1-2.3 4.2-6.6 7-8.7 2-1.5 5.2-2.7 5.2 1 0 .7-.4 6.1-.7 7-.9 3-3.8 3.7-6.5 3.3 4.7.8 5.9 3.4 3.3 6-4.9 5-7-1.3-7.6-2.9-.1-.3-.2-.4-.2-.3-.1-.1-.1 0-.2.3-.5 1.6-2.7 7.9-7.6 2.9-2.6-2.6-1.3-5.2 3.3-6-2.7.4-5.6-.3-6.5-3.3-.3-.9-.7-6.3-.7-7 0-3.7 3.2-2.5 5.2-1z"/>+ </svg>+ </div>+ {:else}+ <div class="bg generic" style="background: {genericBg};">+ <span class="initial">{genericInitial}</span>+ </div>+ {/if}+</div>++<style>+ .logo {+ flex: 0 0 auto;+ border-radius: 14px;+ overflow: hidden;+ display: flex;+ align-items: center;+ justify-content: center;+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.05);+ }+ .bg {+ width: 100%;+ height: 100%;+ display: flex;+ align-items: center;+ justify-content: center;+ }+ .yt { background: #FF0000; }+ .ytm { background: #FF0000; }+ .sc { background: #FF5500; }+ .sp { background: #1DB954; }+ .tw { background: #9146FF; }+ .ig { background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }+ .x { background: #000000; }+ .vm { background: #1AB7EA; }+ .tt { background: linear-gradient(135deg, #25F4EE 0%, #000000 50%, #FE2C55 100%); }+ .bl { background: #00A1D6; }+ .dy { background: linear-gradient(135deg, #25F4EE 0%, #161823 50%, #FE2C55 100%); }+ .rd { background: #FF4500; }+ .pn { background: #E60023; }+ .bs { background: #0085FF; }+ .generic {+ color: white;+ }+ .initial {+ font-size: 50%;+ font-weight: 800;+ color: white;+ letter-spacing: -0.02em;+ }+</style>diff --git a/src/lib/error-translate.ts b/src/lib/error-translate.tsindex bb7fd564..26be97b3 100644--- a/src/lib/error-translate.ts+++ b/src/lib/error-translate.ts@@ -6,6 +6,8 @@const BACKEND_ERROR_MAP: Record<string, string> = {"Video requires login. Use browser cookies or try another URL.":"errors.login_required",+ "This video requires login. Import cookies for this site in Settings → Cookies, then retry.":+ "errors.login_required","Server returned error 429 (too many requests). Try again later.":"errors.rate_limited","Access denied (403). The video may be private or region-restricted.":@@ -71,6 +73,8 @@ export function translateBackendError(if (lower.includes("size mismatch")) return t("errors.size_mismatch");if (lower.includes("disk full") || lower.includes("write error")) return t("errors.disk_full");if (lower.includes("tiktok") && lower.includes("blocking")) return t("errors.tiktok_blocked");+ if (lower.includes("download reported success but no matching file"))+ return t("errors.console_encoding");return stripped || msg;}diff --git a/src/lib/i18n/el.json b/src/lib/i18n/el.jsonindex 706a71b4..a5ce244d 100644--- a/src/lib/i18n/el.json+++ b/src/lib/i18n/el.json@@ -68,6 +68,18 @@"cancel": "Ακύρωση","clear_finished": "Εκκαθάριση των ολοκληρωμένων","clear_confirm": "Clear all finished downloads?",+ "pause_all": "Παύση όλων",+ "resume_all": "Συνέχεια όλων",+ "reorder_hint": "σύρετε για αναδιάταξη",+ "history_toggle": "Εναλλαγή ιστορικού λήψεων",+ "history_toggle_hint": "Δείτε παλαιότερες λήψεις (Ctrl+H)",+ "history_view_link": "Δείτε το ιστορικό λήψεων",+ "history_loading": "Φόρτωση ιστορικού…",+ "history_empty": "Δεν υπάρχουν ολοκληρωμένες λήψεις ακόμη.",+ "history_clear": "Εκκαθάριση ιστορικού",+ "history_clear_confirm": "Εκκαθάριση όλου του ιστορικού λήψεων; Τα αρχεία στον δίσκο δεν διαγράφονται.",+ "history_redownload": "Λήψη ξανά",+ "history_requeued": "Προστέθηκε ξανά στην ουρά","show_more": "Δείξε {{count}} περισσότερα","open_folder": "Εμφάνιση στο φάκελο","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} βίντεο παραλείφθηκαν — προστατευμένα DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — η λήψη ολοκληρώθηκε!"},+ "reencode": {+ "title": "Επανακωδικοποίηση βίντεο",+ "action_label": "Επανακωδικοποίηση (συμπίεση)",+ "codec_legend": "Κωδικοποιητής",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Καλύτερη ισορροπία ποιότητας και μεγέθους. Αναπαράγεται στις περισσότερες σύγχρονες συσκευές.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Μέγιστη συμβατότητα. Αναπαράγεται παντού, αρχεία μεγαλύτερου μεγέθους.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "Μικρότερα αρχεία, πιο αργή κωδικοποίηση. Ιδανικό για αποθήκευση αν η συσκευή το υποστηρίζει.",+ "tag_recommended": "συνιστώμενο",+ "replace_title": "Αντικατάσταση του αρχικού αρχείου",+ "replace_desc": "Αν το νέο αρχείο είναι μικρότερο, αντικαθιστά το αρχικό. Το αρχικό διαγράφεται μετά την επιτυχία.",+ "start": "Επανακωδικοποίηση",+ "encoding": "Κωδικοποίηση…",+ "toast_done": "Εξοικονομήθηκαν {{saved}} ({{pct}}%) με {{encoder}}",+ "toast_replaced": "Αντικαταστάθηκε το αρχικό. Εξοικονομήθηκαν {{saved}} ({{pct}}%) με {{encoder}}"+ },"telegram": {"title": "Πλατφόρμα Telegram","checking_session": "Έλεγχος συνεδρίας...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Συμπερίληψη αυτόματων υπότιτλων","include_auto_subtitles_desc": "Λήψη υπότιτλων που δημιουργούνται αυτόματα από το YouTube όταν δεν υπάρχουν χειρωνακτικοί (η ποιότητα ποικίλλει)",+ "caption_locale": "Γλώσσα υπότιτλων",+ "caption_locale_desc": "Γλώσσα στην οποία θα γίνει λήψη των υπότιτλων (όταν είναι διαθέσιμη). Διαφορετικά χρησιμοποιείται ό,τι παρέχει η πηγή.",+ "caption_locale_auto": "Γλώσσα της εφαρμογής",+ "keep_vtt": "Διατήρηση αρχικών αρχείων .vtt",+ "keep_vtt_desc": "Κρατά το ακατέργαστο WebVTT μαζί με το μετατρεπόμενο SRT. Χρήσιμο για players ή scripts που χρειάζονται την αρχική μορφή.",+ "courses_section": "Μαθήματα (plugin)",+ "continuous_lecture_numbers": "Συνεχής αρίθμηση μαθημάτων",+ "continuous_lecture_numbers_desc": "Αρίθμηση των μαθημάτων με τη σειρά μεταξύ ενοτήτων (1, 2, 3…) αντί να ξεκινά από την αρχή σε κάθε ενότητα.","translate_metadata": "Μετάφραση τίτλων και κεφαλαίων","translate_metadata_desc": "Ζητήστε από το YouTube να τοπικοποιήσει τίτλους και κεφάλαια στη γλώσσα της εφαρμογής (μόνο YouTube)","youtube_sponsorblock": "Αφαίρεση τμημάτων SponsorBlock",@@ -384,6 +422,78 @@"copied_url": "Endpoint URL copied to clipboard.","copied_token": "Token copied to clipboard.","unavailable": "Bridge unavailable. Try restarting the app."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "Πρόσθεσε άλλο λογαριασμό",+ "add_account_success": "Λογαριασμός '{{slug}}' προστέθηκε — {{count}} cookies",+ "account_primary_tag": "προεπιλογή"}},"omnibox": {diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.jsonindex ee9153b6..48908273 100644--- a/src/lib/i18n/en.json+++ b/src/lib/i18n/en.json@@ -68,6 +68,18 @@"cancel": "Cancel","clear_finished": "Clear finished","clear_confirm": "Clear all finished downloads?",+ "pause_all": "Pause all",+ "resume_all": "Resume all",+ "reorder_hint": "drag to reorder",+ "history_toggle": "Toggle download history",+ "history_toggle_hint": "View past downloads (Ctrl+H)",+ "history_view_link": "View download history",+ "history_loading": "Loading history…",+ "history_empty": "No completed downloads yet.",+ "history_clear": "Clear history",+ "history_clear_confirm": "Clear the entire download history? This won't delete the files.",+ "history_redownload": "Download again",+ "history_requeued": "Re-queued for download","show_more": "Show {{count}} more","open_folder": "Show in folder","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} video(s) skipped — protected by DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — download complete!"},+ "reencode": {+ "title": "Re-encode video",+ "action_label": "Re-encode (compress)",+ "codec_legend": "Codec",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Best balance of quality and file size. Plays on most modern devices.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Best compatibility. Plays everywhere, files are larger.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "Smallest files, slowest encode. Best for storage if device supports it.",+ "tag_recommended": "recommended",+ "replace_title": "Replace original file",+ "replace_desc": "If the new file is smaller, swap it in place. Original is removed after success.",+ "start": "Re-encode",+ "encoding": "Encoding…",+ "toast_done": "Saved {{saved}} ({{pct}}%) using {{encoder}}",+ "toast_replaced": "Replaced original. Saved {{saved}} ({{pct}}%) using {{encoder}}"+ },"telegram": {"title": "Telegram","checking_session": "Checking session...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Include auto-generated subtitles","include_auto_subtitles_desc": "Also fetch captions auto-generated by YouTube when no manual ones exist (quality varies)",+ "caption_locale": "Subtitle language",+ "caption_locale_desc": "Language to download subtitles in (when available). Falls back to whatever the source has.",+ "caption_locale_auto": "Match app language",+ "keep_vtt": "Keep original .vtt files",+ "keep_vtt_desc": "Keep the raw WebVTT alongside the converted SRT. Useful for players or scripts that need the original format.",+ "courses_section": "Courses (plugin)",+ "continuous_lecture_numbers": "Continuous lecture numbering",+ "continuous_lecture_numbers_desc": "Number lectures sequentially across modules (1, 2, 3…) instead of restarting at each module.","translate_metadata": "Translate video title and description into your app language","translate_metadata_desc": "Ask YouTube to localize titles and chapter names to the app language (YouTube only)","youtube_sponsorblock": "Remove SponsorBlock segments",@@ -384,6 +422,78 @@"copied_url": "Endpoint URL copied to clipboard.","copied_token": "Token copied to clipboard.","unavailable": "Bridge unavailable. Try restarting the app."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "Add another account",+ "add_account_success": "Account '{{slug}}' added — {{count}} cookies",+ "account_primary_tag": "default"}},"omnibox": {diff --git a/src/lib/i18n/es.json b/src/lib/i18n/es.jsonindex e8b6c22b..04a17e52 100644--- a/src/lib/i18n/es.json+++ b/src/lib/i18n/es.json@@ -68,6 +68,18 @@"cancel": "Cancelar","clear_finished": "Limpiar terminadas","clear_confirm": "¿Limpiar todas las descargas terminadas?",+ "pause_all": "Pausar todas",+ "resume_all": "Reanudar todas",+ "reorder_hint": "arrastra para reordenar",+ "history_toggle": "Mostrar/ocultar historial",+ "history_toggle_hint": "Ver descargas anteriores (Ctrl+H)",+ "history_view_link": "Ver historial de descargas",+ "history_loading": "Cargando historial…",+ "history_empty": "Aún no hay descargas finalizadas.",+ "history_clear": "Limpiar historial",+ "history_clear_confirm": "¿Limpiar todo el historial de descargas? Los archivos descargados se mantienen.",+ "history_redownload": "Descargar de nuevo",+ "history_requeued": "Añadido a la cola de nuevo","show_more": "Mostrar {{count}} más","open_folder": "Mostrar en carpeta","open_in_study": "Ver en Estudio",@@ -104,6 +116,24 @@"drm_skipped": "{{count}} vídeo(s) omitidos — protegidos por DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — ¡descarga completa!"},+ "reencode": {+ "title": "Recodificar vídeo",+ "action_label": "Recodificar (comprimir)",+ "codec_legend": "Códec",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Mejor equilibrio entre calidad y tamaño. Funciona en la mayoría de dispositivos modernos.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Compatibilidad máxima. Funciona en cualquier sitio, los archivos son más grandes.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "Archivos más pequeños, codificación más lenta. Ideal para almacenar si tu dispositivo lo admite.",+ "tag_recommended": "recomendado",+ "replace_title": "Sustituir archivo original",+ "replace_desc": "Si el nuevo es más pequeño, sustituye el original. El original se elimina tras el éxito.",+ "start": "Recodificar",+ "encoding": "Codificando…",+ "toast_done": "Ahorrado {{saved}} ({{pct}}%) con {{encoder}}",+ "toast_replaced": "Original sustituido. Ahorrado {{saved}} ({{pct}}%) con {{encoder}}"+ },"telegram": {"title": "Telegram","checking_session": "Comprobando sesión...",@@ -222,6 +252,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Incluir subtítulos generados automáticamente","include_auto_subtitles_desc": "También obtiene los subtítulos auto-generados por YouTube cuando no hay manuales (calidad variable)",+ "caption_locale": "Idioma de los subtítulos",+ "caption_locale_desc": "Idioma en que descargar los subtítulos (cuando esté disponible). Si no, usa el que tenga la fuente.",+ "caption_locale_auto": "Idioma de la app",+ "keep_vtt": "Mantener archivos .vtt originales",+ "keep_vtt_desc": "Guarda el WebVTT crudo junto al SRT convertido. Útil para reproductores o scripts que necesitan el formato original.",+ "courses_section": "Cursos (plugin)",+ "continuous_lecture_numbers": "Numeración continua de lecciones",+ "continuous_lecture_numbers_desc": "Numera las lecciones de forma continua entre módulos (1, 2, 3…) en vez de reiniciar en cada módulo.","translate_metadata": "Traducir título y descripción al idioma de la app","translate_metadata_desc": "Pide a YouTube que localice los títulos y capítulos al idioma de la app (solo YouTube)","youtube_sponsorblock": "Eliminar segmentos de SponsorBlock",@@ -362,6 +400,78 @@"app_id_hint": "ID de la aplicación de Discord. Cámbialo solo si sabes lo que haces.","large_image": "Clave de imagen grande","large_image_hint": "Nombre del recurso subido a tu aplicación de Discord."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "Añadir otra cuenta",+ "add_account_success": "Cuenta '{{slug}}' añadida — {{count}} cookies",+ "account_primary_tag": "predeterminada"}},"omnibox": {diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.jsonindex c4fadabe..2468293a 100644--- a/src/lib/i18n/fr.json+++ b/src/lib/i18n/fr.json@@ -68,6 +68,18 @@"cancel": "Annuler","clear_finished": "Effacer les terminés","clear_confirm": "Clear all finished downloads?",+ "pause_all": "Tout mettre en pause",+ "resume_all": "Tout reprendre",+ "reorder_hint": "glissez pour réordonner",+ "history_toggle": "Afficher/masquer l'historique",+ "history_toggle_hint": "Voir les téléchargements passés (Ctrl+H)",+ "history_view_link": "Voir l'historique des téléchargements",+ "history_loading": "Chargement de l'historique…",+ "history_empty": "Aucun téléchargement terminé pour l'instant.",+ "history_clear": "Vider l'historique",+ "history_clear_confirm": "Vider tout l'historique des téléchargements ? Les fichiers téléchargés ne sont pas supprimés.",+ "history_redownload": "Télécharger à nouveau",+ "history_requeued": "Remis dans la file d'attente","show_more": "Afficher {{count}} de plus","open_folder": "Afficher dans le dossier","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} vidéo(s) ignorée(s) — protégée(s) par DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — téléchargement terminé !"},+ "reencode": {+ "title": "Réencoder la vidéo",+ "action_label": "Réencoder (compresser)",+ "codec_legend": "Codec",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Meilleur équilibre entre qualité et taille. Lecture sur la plupart des appareils modernes.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Compatibilité maximale. Lecture partout, mais fichiers plus volumineux.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "Fichiers les plus petits, encodage plus lent. Idéal pour le stockage si l'appareil le supporte.",+ "tag_recommended": "recommandé",+ "replace_title": "Remplacer le fichier original",+ "replace_desc": "Si le nouveau fichier est plus petit, il remplace l'original. L'original est supprimé après succès.",+ "start": "Réencoder",+ "encoding": "Encodage…",+ "toast_done": "Économisé {{saved}} ({{pct}}%) avec {{encoder}}",+ "toast_replaced": "Original remplacé. Économisé {{saved}} ({{pct}}%) avec {{encoder}}"+ },"telegram": {"title": "Telegram","checking_session": "Vérification de la session...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Inclure les sous-titres auto-générés","include_auto_subtitles_desc": "Télécharger aussi les sous-titres générés par YouTube en l'absence de sous-titres manuels (qualité variable)",+ "caption_locale": "Langue des sous-titres",+ "caption_locale_desc": "Langue dans laquelle télécharger les sous-titres (si disponible). Revient à ce que la source propose sinon.",+ "caption_locale_auto": "Suivre la langue de l'app",+ "keep_vtt": "Conserver les fichiers .vtt originaux",+ "keep_vtt_desc": "Garde le WebVTT brut à côté du SRT converti. Utile pour les lecteurs ou scripts qui veulent le format d'origine.",+ "courses_section": "Cours (plugin)",+ "continuous_lecture_numbers": "Numérotation continue des leçons",+ "continuous_lecture_numbers_desc": "Numérote les leçons en continu entre les modules (1, 2, 3…) au lieu de redémarrer à chaque module.","translate_metadata": "Traduire titres et chapitres","translate_metadata_desc": "Demander à YouTube de localiser titres et noms de chapitres dans la langue de l'app (YouTube uniquement)","youtube_sponsorblock": "Retirer les segments SponsorBlock",@@ -384,6 +422,78 @@"copied_url": "URL copiée dans le presse-papier.","copied_token": "Jeton copié dans le presse-papier.","unavailable": "Pont indisponible. Redémarrez l'application."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "Ajouter un autre compte",+ "add_account_success": "Compte '{{slug}}' ajouté — {{count}} cookies",+ "account_primary_tag": "par défaut"}},"omnibox": {diff --git a/src/lib/i18n/it.json b/src/lib/i18n/it.jsonindex 34fb2bd9..93164aff 100644--- a/src/lib/i18n/it.json+++ b/src/lib/i18n/it.json@@ -68,6 +68,18 @@"cancel": "Annulla","clear_finished": "Cancella completati","clear_confirm": "Clear all finished downloads?",+ "pause_all": "Pausa tutti",+ "resume_all": "Riprendi tutti",+ "reorder_hint": "trascina per riordinare",+ "history_toggle": "Mostra/nascondi cronologia",+ "history_toggle_hint": "Vedi i download passati (Ctrl+H)",+ "history_view_link": "Vedi cronologia download",+ "history_loading": "Caricamento cronologia…",+ "history_empty": "Nessun download completato finora.",+ "history_clear": "Cancella cronologia",+ "history_clear_confirm": "Cancellare tutta la cronologia? I file scaricati restano sul disco.",+ "history_redownload": "Scarica di nuovo",+ "history_requeued": "Aggiunto di nuovo in coda","show_more": "Mostra altri {{count}}","open_folder": "Mostra nella cartella","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} video ignorati — protetti da DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — download completato!"},+ "reencode": {+ "title": "Ricodifica video",+ "action_label": "Ricodifica (comprimi)",+ "codec_legend": "Codec",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Miglior equilibrio tra qualità e dimensione. Si riproduce su quasi tutti i dispositivi moderni.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Compatibilità massima. Si riproduce ovunque, ma i file sono più grandi.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "File più piccoli, codifica più lenta. Ideale per lo spazio di archiviazione se il dispositivo lo supporta.",+ "tag_recommended": "consigliato",+ "replace_title": "Sostituisci il file originale",+ "replace_desc": "Se il nuovo file è più piccolo, sostituisce l'originale. L'originale viene rimosso dopo il successo.",+ "start": "Ricodifica",+ "encoding": "Codifica in corso…",+ "toast_done": "Risparmiato {{saved}} ({{pct}}%) con {{encoder}}",+ "toast_replaced": "Originale sostituito. Risparmiato {{saved}} ({{pct}}%) con {{encoder}}"+ },"telegram": {"title": "Telegram","checking_session": "Verifica sessione...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Includi sottotitoli auto-generati","include_auto_subtitles_desc": "Scarica anche i sottotitoli generati automaticamente da YouTube quando non ne esistono di manuali (qualità variabile)",+ "caption_locale": "Lingua dei sottotitoli",+ "caption_locale_desc": "Lingua in cui scaricare i sottotitoli (se disponibile). Altrimenti usa quello che la fonte fornisce.",+ "caption_locale_auto": "Lingua dell'app",+ "keep_vtt": "Mantieni i file .vtt originali",+ "keep_vtt_desc": "Conserva il WebVTT grezzo accanto al SRT convertito. Utile per player o script che richiedono il formato originale.",+ "courses_section": "Corsi (plugin)",+ "continuous_lecture_numbers": "Numerazione continua delle lezioni",+ "continuous_lecture_numbers_desc": "Numera le lezioni in sequenza tra i moduli (1, 2, 3…) invece di ricominciare da capo a ogni modulo.","translate_metadata": "Traduci titoli e capitoli","translate_metadata_desc": "Chiedi a YouTube di localizzare titoli e nomi dei capitoli nella lingua dell'app (solo YouTube)","youtube_sponsorblock": "Rimuovi segmenti SponsorBlock",@@ -384,6 +422,78 @@"copied_url": "URL dell'endpoint copiato negli appunti.","copied_token": "Token copiato negli appunti.","unavailable": "Bridge non disponibile. Riavvia l'app."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "Aggiungi un altro account",+ "add_account_success": "Account '{{slug}}' aggiunto — {{count}} cookies",+ "account_primary_tag": "predefinito"}},"omnibox": {diff --git a/src/lib/i18n/ja.json b/src/lib/i18n/ja.jsonindex e699f511..d1cbd54a 100644--- a/src/lib/i18n/ja.json+++ b/src/lib/i18n/ja.json@@ -68,6 +68,18 @@"cancel": "キャンセル","clear_finished": "完了済みをクリア","clear_confirm": "Clear all finished downloads?",+ "pause_all": "すべて一時停止",+ "resume_all": "すべて再開",+ "reorder_hint": "ドラッグして並べ替え",+ "history_toggle": "履歴の表示切り替え",+ "history_toggle_hint": "過去のダウンロードを見る (Ctrl+H)",+ "history_view_link": "ダウンロード履歴を見る",+ "history_loading": "履歴を読み込み中…",+ "history_empty": "完了したダウンロードはまだありません。",+ "history_clear": "履歴をクリア",+ "history_clear_confirm": "ダウンロード履歴をすべてクリアしますか?ダウンロード済みファイルは削除されません。",+ "history_redownload": "もう一度ダウンロード",+ "history_requeued": "再度キューに追加されました","show_more": "さらに {{count}} 件を表示","open_folder": "フォルダーで表示","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} 本の動画をスキップしました — DRM保護(FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — ダウンロード完了!"},+ "reencode": {+ "title": "動画を再エンコード",+ "action_label": "再エンコード(圧縮)",+ "codec_legend": "コーデック",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "品質とファイルサイズの最適なバランス。最近のほとんどのデバイスで再生できます。",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "最高の互換性。どこでも再生できますが、ファイルサイズは大きめです。",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "最も小さいファイル、エンコードは最も遅い。デバイスが対応していれば保存用に最適です。",+ "tag_recommended": "おすすめ",+ "replace_title": "元のファイルを置き換える",+ "replace_desc": "新しいファイルの方が小さい場合、元のファイルを置き換えます。成功後に元のファイルは削除されます。",+ "start": "再エンコード",+ "encoding": "エンコード中…",+ "toast_done": "{{encoder}} で {{saved}}({{pct}}%)節約しました",+ "toast_replaced": "元のファイルを置き換えました。{{encoder}} で {{saved}}({{pct}}%)節約しました"+ },"telegram": {"title": "Telegram","checking_session": "セッションを確認中...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "自動生成字幕を含める","include_auto_subtitles_desc": "手動字幕がない場合、YouTubeが自動生成した字幕もダウンロードします(品質は可変)",+ "caption_locale": "字幕の言語",+ "caption_locale_desc": "字幕をダウンロードする言語(利用可能な場合)。なければソースが提供する言語にフォールバックします。",+ "caption_locale_auto": "アプリの言語に合わせる",+ "keep_vtt": "元の .vtt ファイルを残す",+ "keep_vtt_desc": "変換後の SRT と並んで生の WebVTT を保持します。元のフォーマットを必要とするプレーヤーやスクリプトで便利です。",+ "courses_section": "コース(プラグイン)",+ "continuous_lecture_numbers": "連続したレッスン番号",+ "continuous_lecture_numbers_desc": "モジュールごとにリセットせず、モジュール間で連続した番号(1, 2, 3…)を付けます。","translate_metadata": "タイトルとチャプターを翻訳","translate_metadata_desc": "YouTubeにタイトルとチャプター名をアプリ言語にローカライズするよう依頼(YouTubeのみ)","youtube_sponsorblock": "SponsorBlockセグメントを削除",@@ -384,6 +422,78 @@"copied_url": "エンドポイントURLをクリップボードにコピーしました。","copied_token": "トークンをクリップボードにコピーしました。","unavailable": "ブリッジが利用できません。アプリを再起動してください。"+ },+ "cat_cookies": "クッキー",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "別のアカウントを追加",+ "add_account_success": "アカウント '{{slug}}' を追加 — {{count}} cookies",+ "account_primary_tag": "デフォルト"}},"omnibox": {diff --git a/src/lib/i18n/keys.ts b/src/lib/i18n/keys.tsindex 48e0e4df..78c91efd 100644--- a/src/lib/i18n/keys.ts+++ b/src/lib/i18n/keys.ts@@ -166,6 +166,15 @@ export type TranslationKeys =| 'downloads.filter.failed'| 'downloads.filter.queued'| 'downloads.filter_label'+ | 'downloads.history_clear'+ | 'downloads.history_clear_confirm'+ | 'downloads.history_empty'+ | 'downloads.history_loading'+ | 'downloads.history_redownload'+ | 'downloads.history_requeued'+ | 'downloads.history_toggle'+ | 'downloads.history_toggle_hint'+ | 'downloads.history_view_link'| 'downloads.log.copied'| 'downloads.log.copy'| 'downloads.log.copy_failed'@@ -177,12 +186,15 @@ export type TranslationKeys =| 'downloads.open_in_study'| 'downloads.page_progress'| 'downloads.pause'+ | 'downloads.pause_all'| 'downloads.phase_connecting'| 'downloads.phase_fetching_info'| 'downloads.phase_preparing'| 'downloads.phase_starting'| 'downloads.quality_hint'+ | 'downloads.reorder_hint'| 'downloads.resume'+ | 'downloads.resume_all'| 'downloads.retry'| 'downloads.section_finished'| 'downloads.section_queued'@@ -444,6 +456,23 @@ export type TranslationKeys =| 'recovery.restored'| 'recovery.title'+ | 'reencode.action_label'+ | 'reencode.codec_av1_desc'+ | 'reencode.codec_av1_title'+ | 'reencode.codec_h264_desc'+ | 'reencode.codec_h264_title'+ | 'reencode.codec_hevc_desc'+ | 'reencode.codec_hevc_title'+ | 'reencode.codec_legend'+ | 'reencode.encoding'+ | 'reencode.replace_desc'+ | 'reencode.replace_title'+ | 'reencode.start'+ | 'reencode.tag_recommended'+ | 'reencode.title'+ | 'reencode.toast_done'+ | 'reencode.toast_replaced'+| 'services.and_more'| 'services.disclaimer'| 'services.title'@@ -497,10 +526,80 @@ export type TranslationKeys =| 'settings.bridge.unavailable'| 'settings.cat_advanced'| 'settings.cat_appearance'+ | 'settings.cat_cookies'| 'settings.cat_downloads'| 'settings.cat_network'| 'settings.cat_plugins'| 'settings.cat_typography'+ | 'settings.cookies.account_primary_tag'+ | 'settings.cookies.action_clear'+ | 'settings.cookies.action_export'+ | 'settings.cookies.action_rename'+ | 'settings.cookies.action_view'+ | 'settings.cookies.add_account_label'+ | 'settings.cookies.add_account_success'+ | 'settings.cookies.add_generic_cancel'+ | 'settings.cookies.add_generic_hint'+ | 'settings.cookies.add_generic_paste'+ | 'settings.cookies.add_generic_placeholder'+ | 'settings.cookies.add_generic_title'+ | 'settings.cookies.alias_aria'+ | 'settings.cookies.alias_edit_aria'+ | 'settings.cookies.capture_via_extension'+ | 'settings.cookies.captured_from'+ | 'settings.cookies.cleared_toast'+ | 'settings.cookies.confirm_clear_action'+ | 'settings.cookies.confirm_clear_body'+ | 'settings.cookies.confirm_clear_cancel'+ | 'settings.cookies.confirm_clear_title'+ | 'settings.cookies.count_cookies'+ | 'settings.cookies.dir_label'+ | 'settings.cookies.empty_body'+ | 'settings.cookies.empty_title'+ | 'settings.cookies.export_dialog_title'+ | 'settings.cookies.export_done'+ | 'settings.cookies.hint_use_extension'+ | 'settings.cookies.import_file_dialog_title'+ | 'settings.cookies.import_file_hint'+ | 'settings.cookies.import_file_title'+ | 'settings.cookies.import_paste_hint'+ | 'settings.cookies.import_paste_title'+ | 'settings.cookies.import_success'+ | 'settings.cookies.import_trigger'+ | 'settings.cookies.intro'+ | 'settings.cookies.modal_close'+ | 'settings.cookies.modal_copied'+ | 'settings.cookies.modal_copy_all'+ | 'settings.cookies.modal_expired_count'+ | 'settings.cookies.modal_expired_tag'+ | 'settings.cookies.modal_filter_placeholder'+ | 'settings.cookies.modal_no_results'+ | 'settings.cookies.modal_title'+ | 'settings.cookies.modal_total'+ | 'settings.cookies.open_folder'+ | 'settings.cookies.paste_alias_placeholder'+ | 'settings.cookies.paste_cancel'+ | 'settings.cookies.paste_content_placeholder'+ | 'settings.cookies.paste_field_alias'+ | 'settings.cookies.paste_field_content'+ | 'settings.cookies.paste_field_source'+ | 'settings.cookies.paste_importing'+ | 'settings.cookies.paste_modal_subtitle'+ | 'settings.cookies.paste_modal_title'+ | 'settings.cookies.paste_source_placeholder'+ | 'settings.cookies.paste_submit'+ | 'settings.cookies.status_aging'+ | 'settings.cookies.status_empty'+ | 'settings.cookies.status_fresh'+ | 'settings.cookies.status_stale'+ | 'settings.cookies.time_days'+ | 'settings.cookies.time_hours'+ | 'settings.cookies.time_just_now'+ | 'settings.cookies.time_minutes'+ | 'settings.cookies.time_months'+ | 'settings.cookies.time_years'+ | 'settings.cookies.title'+ | 'settings.cookies.via_label'| 'settings.dependencies.filter_all_files'| 'settings.dependencies.filter_pdfium'| 'settings.dependencies.install'@@ -518,11 +617,17 @@ export type TranslationKeys =| 'settings.download.always_ask_path'| 'settings.download.auto_download_on_paste'| 'settings.download.auto_download_on_paste_desc'+ | 'settings.download.caption_locale'+ | 'settings.download.caption_locale_auto'+ | 'settings.download.caption_locale_desc'| 'settings.download.choose_folder'| 'settings.download.clipboard_detection'| 'settings.download.clipboard_detection_desc'+ | 'settings.download.continuous_lecture_numbers'+ | 'settings.download.continuous_lecture_numbers_desc'| 'settings.download.copy_to_clipboard_on_hotkey'| 'settings.download.copy_to_clipboard_on_hotkey_desc'+ | 'settings.download.courses_section'| 'settings.download.default_output_dir'| 'settings.download.download_attachments'| 'settings.download.download_descriptions'@@ -543,6 +648,8 @@ export type TranslationKeys =| 'settings.download.hotkey_type'| 'settings.download.include_auto_subtitles'| 'settings.download.include_auto_subtitles_desc'+ | 'settings.download.keep_vtt'+ | 'settings.download.keep_vtt_desc'| 'settings.download.music_audio_format'| 'settings.download.music_audio_format_desc'| 'settings.download.music_hotkey_binding'diff --git a/src/lib/i18n/pt.json b/src/lib/i18n/pt.jsonindex d4e3803b..ffb59dff 100644--- a/src/lib/i18n/pt.json+++ b/src/lib/i18n/pt.json@@ -68,6 +68,18 @@"cancel": "Cancelar","clear_finished": "Limpar finalizados","clear_confirm": "Limpar todos os downloads finalizados?",+ "pause_all": "Pausar todos",+ "resume_all": "Retomar todos",+ "reorder_hint": "arraste pra reordenar",+ "history_toggle": "Mostrar/esconder histórico",+ "history_toggle_hint": "Ver downloads passados (Ctrl+H)",+ "history_view_link": "Ver histórico de downloads",+ "history_loading": "Carregando histórico…",+ "history_empty": "Nenhum download finalizado ainda.",+ "history_clear": "Limpar histórico",+ "history_clear_confirm": "Limpar todo o histórico de downloads? Os arquivos baixados continuam na pasta.",+ "history_redownload": "Baixar de novo",+ "history_requeued": "Adicionado à fila de novo","show_more": "Mostrar mais {{count}}","open_folder": "Abrir pasta","open_in_study": "Assistir no Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} vídeo(s) ignorados — protegidos por DRM (FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — download concluído!"},+ "reencode": {+ "title": "Re-codificar vídeo",+ "action_label": "Re-codificar (comprimir)",+ "codec_legend": "Codec",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "Melhor equilíbrio entre qualidade e tamanho. Roda na maioria dos dispositivos modernos.",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "Compatibilidade máxima. Roda em qualquer lugar, mas o arquivo é maior.",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "Arquivos menores, codificação mais lenta. Ideal pra economia de espaço se o dispositivo suportar.",+ "tag_recommended": "recomendado",+ "replace_title": "Substituir o arquivo original",+ "replace_desc": "Se o novo for menor, troca pelo original. O original é apagado depois do sucesso.",+ "start": "Re-codificar",+ "encoding": "Codificando…",+ "toast_done": "Economizou {{saved}} ({{pct}}%) usando {{encoder}}",+ "toast_replaced": "Substituiu o original. Economizou {{saved}} ({{pct}}%) usando {{encoder}}"+ },"telegram": {"title": "Telegram","checking_session": "Verificando sessão...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "Incluir legendas auto-geradas","include_auto_subtitles_desc": "Também baixar legendas geradas pelo YouTube quando não há legendas manuais (qualidade varia)",+ "caption_locale": "Idioma das legendas",+ "caption_locale_desc": "Idioma para baixar as legendas (quando disponível). Cai pro que a origem tiver se não achar.",+ "caption_locale_auto": "Mesmo idioma do app",+ "keep_vtt": "Manter arquivos .vtt originais",+ "keep_vtt_desc": "Guarda o WebVTT bruto junto com o SRT convertido. Útil para players ou scripts que precisam do formato original.",+ "courses_section": "Cursos (plugin)",+ "continuous_lecture_numbers": "Numeração contínua de aulas",+ "continuous_lecture_numbers_desc": "Numera as aulas em sequência entre módulos (1, 2, 3…) em vez de reiniciar a cada módulo.","translate_metadata": "Traduzir título e descrição do vídeo para o idioma do app","translate_metadata_desc": "Pedir que o YouTube localize títulos e capítulos para o idioma do app (apenas YouTube)","youtube_sponsorblock": "Remover segmentos SponsorBlock",@@ -384,6 +422,78 @@"copied_url": "URL do endpoint copiada para a área de transferência.","copied_token": "Token copiado para a área de transferência.","unavailable": "Bridge indisponível. Reinicie o app."+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Gerencie os cookies das suas contas. Tudo fica no seu computador — nada é enviado pra nossos servidores.",+ "capture_via_extension": "Capturar via extensão",+ "open_folder": "Abrir pasta",+ "dir_label": "Pasta:",+ "hint_use_extension": "Em qualquer site logado, clique no ícone da extensão omniget no canto do navegador. Os cookies aparecem aqui em segundos.",+ "empty_title": "Nenhum cookie por aqui ainda",+ "empty_body": "Use a extensão do navegador pra capturar cookies do site onde você está logado, ou importe um arquivo manualmente.",+ "status_fresh": "Cookies recentes",+ "status_aging": "Cookies envelhecendo",+ "status_stale": "Cookies antigos — talvez expirados",+ "status_empty": "Sem cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Capturado de",+ "via_label": "via {{label}}",+ "time_just_now": "agora",+ "time_minutes": "há {{count}} min",+ "time_hours": "há {{count}} h",+ "time_days": "há {{count}} dias",+ "time_months": "há {{count}} meses",+ "time_years": "há {{count}} anos",+ "alias_aria": "Nome desta entrada",+ "alias_edit_aria": "Renomear esta entrada",+ "action_view": "Ver",+ "action_export": "Exportar",+ "action_rename": "Renomear",+ "action_clear": "Limpar",+ "import_trigger": "Importar",+ "import_file_title": "Arquivo",+ "import_file_hint": "Netscape (.txt) ou JSON (.json)",+ "import_file_dialog_title": "Selecionar arquivo de cookies",+ "import_paste_title": "Colar",+ "import_paste_hint": "Cole o conteúdo de cookies em um modal",+ "import_success": "Importado: {{cookies}} cookies em {{buckets}} plataforma(s)",+ "paste_modal_title": "Colar cookies",+ "paste_modal_subtitle": "Cole o conteúdo do arquivo cookies — aceito Netscape (yt-dlp) ou JSON (Edit-This-Cookie).",+ "paste_field_content": "Conteúdo",+ "paste_field_source": "URL de origem (opcional)",+ "paste_field_alias": "Nome (opcional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "Ex: YouTube pessoal",+ "paste_cancel": "Cancelar",+ "paste_submit": "Importar",+ "paste_importing": "Importando…",+ "export_dialog_title": "Salvar arquivo de cookies",+ "export_done": "Arquivo salvo",+ "modal_title": "Conteúdo dos cookies",+ "modal_close": "Fechar",+ "modal_filter_placeholder": "Filtrar por nome do cookie…",+ "modal_copy_all": "Copiar tudo",+ "modal_copied": "Conteúdo copiado",+ "modal_no_results": "Nenhum cookie encontrado com esse filtro.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expirados",+ "modal_expired_tag": "expirado",+ "add_generic_title": "Adicionar genérico",+ "add_generic_hint": "Pra sites suportados por yt-dlp não listados acima.",+ "add_generic_placeholder": "Domínio (ex: bandcamp.com)",+ "add_generic_paste": "Colar cookies",+ "add_generic_cancel": "Cancelar",+ "confirm_clear_title": "Limpar cookies?",+ "confirm_clear_body": "Os cookies de {{domain}} vão pra lixeira (recuperável por 24h). Continuar?",+ "confirm_clear_cancel": "Cancelar",+ "confirm_clear_action": "Limpar",+ "cleared_toast": "Cookies movidos pra lixeira",+ "add_account_label": "Adicionar segunda conta",+ "add_account_success": "Conta '{{slug}}' adicionada — {{count}} cookies",+ "account_primary_tag": "padrão"}},"omnibox": {diff --git a/src/lib/i18n/zh-TW.json b/src/lib/i18n/zh-TW.jsonindex ba101fb8..ed5f0b4b 100644--- a/src/lib/i18n/zh-TW.json+++ b/src/lib/i18n/zh-TW.json@@ -68,6 +68,18 @@"cancel": "取消","clear_finished": "清除已完成項目","clear_confirm": "Clear all finished downloads?",+ "pause_all": "全部暫停",+ "resume_all": "全部繼續",+ "reorder_hint": "拖曳以重新排序",+ "history_toggle": "切換下載紀錄",+ "history_toggle_hint": "查看過往下載 (Ctrl+H)",+ "history_view_link": "查看下載紀錄",+ "history_loading": "載入紀錄中…",+ "history_empty": "尚無完成的下載。",+ "history_clear": "清除紀錄",+ "history_clear_confirm": "清除全部下載紀錄?已下載的檔案不會被刪除。",+ "history_redownload": "重新下載",+ "history_requeued": "已重新加入佇列","show_more": "顯示另外 {{count}} 項","open_folder": "在資料夾中顯示","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "已略過 {{count}} 部影片 — 受 DRM (FairPlay/SAMPLE-AES) 保護","generic_download_complete": "{{name}} — 下載完成!"},+ "reencode": {+ "title": "重新編碼影片",+ "action_label": "重新編碼(壓縮)",+ "codec_legend": "編碼",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "品質與檔案大小的最佳平衡。可在多數現代裝置播放。",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "相容性最佳。任何裝置都能播放,但檔案較大。",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "檔案最小,編碼最慢。裝置支援時,最適合儲存。",+ "tag_recommended": "建議",+ "replace_title": "取代原始檔案",+ "replace_desc": "若新檔案較小,則取代原始檔案。成功後原始檔案會被刪除。",+ "start": "重新編碼",+ "encoding": "編碼中…",+ "toast_done": "使用 {{encoder}} 節省 {{saved}}({{pct}}%)",+ "toast_replaced": "已取代原始檔案。使用 {{encoder}} 節省 {{saved}}({{pct}}%)"+ },"telegram": {"title": "Telegram","checking_session": "正在檢查登入狀態...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "包含自動產生的字幕","include_auto_subtitles_desc": "沒有手動字幕時,也下載 YouTube 自動產生的字幕(品質不一)",+ "caption_locale": "字幕語言",+ "caption_locale_desc": "下載字幕的語言(若有)。否則回退到來源提供的語言。",+ "caption_locale_auto": "跟隨應用語言",+ "keep_vtt": "保留原始 .vtt 檔案",+ "keep_vtt_desc": "在轉換後的 SRT 旁保留原始 WebVTT 檔案。適合需要原格式的播放器或腳本。",+ "courses_section": "課程(外掛)",+ "continuous_lecture_numbers": "連續編號課程",+ "continuous_lecture_numbers_desc": "在各模組之間連續編號課程(1、2、3…),而不是每個模組都從頭開始。","translate_metadata": "翻譯標題與章節","translate_metadata_desc": "請求 YouTube 將標題與章節名稱在地化為應用程式語言(僅 YouTube)","youtube_sponsorblock": "移除 SponsorBlock 片段",@@ -384,6 +422,78 @@"copied_url": "端點 URL 已複製到剪貼簿。","copied_token": "權杖已複製到剪貼簿。","unavailable": "橋接不可用。請重新啟動應用程式。"+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "新增其他帳戶",+ "add_account_success": "帳戶 '{{slug}}' 已新增 — {{count}} cookies",+ "account_primary_tag": "預設"}},"omnibox": {diff --git a/src/lib/i18n/zh.json b/src/lib/i18n/zh.jsonindex 99ffbcdc..86e16594 100644--- a/src/lib/i18n/zh.json+++ b/src/lib/i18n/zh.json@@ -68,6 +68,18 @@"cancel": "取消","clear_finished": "清除已完成","clear_confirm": "Clear all finished downloads?",+ "pause_all": "全部暂停",+ "resume_all": "全部恢复",+ "reorder_hint": "拖动以重新排序",+ "history_toggle": "切换下载历史",+ "history_toggle_hint": "查看过去的下载 (Ctrl+H)",+ "history_view_link": "查看下载历史",+ "history_loading": "正在加载历史…",+ "history_empty": "暂无已完成的下载。",+ "history_clear": "清除历史",+ "history_clear_confirm": "清除全部下载历史?已下载的文件不会被删除。",+ "history_redownload": "再次下载",+ "history_requeued": "已重新加入队列","show_more": "显示更多 {{count}} 项","open_folder": "在文件夹中显示","open_in_study": "Watch in Study",@@ -105,6 +117,24 @@"drm_skipped": "{{count}} 个视频已跳过 — 受DRM保护(FairPlay/SAMPLE-AES)","generic_download_complete": "{{name}} — 下载完成!"},+ "reencode": {+ "title": "重新编码视频",+ "action_label": "重新编码(压缩)",+ "codec_legend": "编码",+ "codec_hevc_title": "HEVC / H.265",+ "codec_hevc_desc": "质量与文件大小的最佳平衡。可在大多数现代设备播放。",+ "codec_h264_title": "H.264 / AVC",+ "codec_h264_desc": "兼容性最佳。处处可播放,但文件更大。",+ "codec_av1_title": "AV1",+ "codec_av1_desc": "文件最小,编码最慢。设备支持时,最适合存储。",+ "tag_recommended": "推荐",+ "replace_title": "替换原始文件",+ "replace_desc": "若新文件更小,则替换原始文件。成功后原始文件被删除。",+ "start": "重新编码",+ "encoding": "编码中…",+ "toast_done": "使用 {{encoder}} 节省 {{saved}}({{pct}}%)",+ "toast_replaced": "已替换原始文件。使用 {{encoder}} 节省 {{saved}}({{pct}}%)"+ },"telegram": {"title": "Telegram","checking_session": "正在检查登录状态...",@@ -225,6 +255,14 @@"telegram_plugin_section": "Telegram (plugin)","include_auto_subtitles": "包含自动生成的字幕","include_auto_subtitles_desc": "当没有人工字幕时,也下载 YouTube 自动生成的字幕(质量不稳定)",+ "caption_locale": "字幕语言",+ "caption_locale_desc": "下载字幕时使用的语言(如有)。否则回退到源提供的语言。",+ "caption_locale_auto": "跟随应用语言",+ "keep_vtt": "保留原始 .vtt 文件",+ "keep_vtt_desc": "在转换后的 SRT 旁保留原始 WebVTT 文件。适用于需要原格式的播放器或脚本。",+ "courses_section": "课程(插件)",+ "continuous_lecture_numbers": "连续编号的课程",+ "continuous_lecture_numbers_desc": "在模块之间连续编号课程(1、2、3…),而不是每个模块都重新开始。","translate_metadata": "翻译标题和章节","translate_metadata_desc": "请求 YouTube 将标题和章节名本地化为应用语言(仅 YouTube)","youtube_sponsorblock": "移除 SponsorBlock 片段",@@ -384,6 +422,78 @@"copied_url": "端点 URL 已复制到剪贴板。","copied_token": "令牌已复制到剪贴板。","unavailable": "桥接不可用。请重启应用。"+ },+ "cat_cookies": "Cookies",+ "cookies": {+ "title": "Cookies",+ "intro": "Manage your account cookies. Everything stays on your computer — nothing is sent to our servers.",+ "capture_via_extension": "Capture via extension",+ "open_folder": "Open folder",+ "dir_label": "Folder:",+ "hint_use_extension": "On any logged-in site, click the omniget extension icon in your browser. The cookies show up here in seconds.",+ "empty_title": "No cookies here yet",+ "empty_body": "Use the browser extension to capture cookies from sites where you're logged in, or import a file manually.",+ "status_fresh": "Fresh cookies",+ "status_aging": "Aging cookies",+ "status_stale": "Old cookies — possibly expired",+ "status_empty": "No cookies",+ "count_cookies": "{{count}} cookies",+ "captured_from": "Captured from",+ "via_label": "via {{label}}",+ "time_just_now": "just now",+ "time_minutes": "{{count}}m ago",+ "time_hours": "{{count}}h ago",+ "time_days": "{{count}}d ago",+ "time_months": "{{count}}mo ago",+ "time_years": "{{count}}y ago",+ "alias_aria": "Name for this entry",+ "alias_edit_aria": "Rename this entry",+ "action_view": "View",+ "action_export": "Export",+ "action_rename": "Rename",+ "action_clear": "Clear",+ "import_trigger": "Import",+ "import_file_title": "File",+ "import_file_hint": "Netscape (.txt) or JSON (.json)",+ "import_file_dialog_title": "Select cookies file",+ "import_paste_title": "Paste",+ "import_paste_hint": "Paste cookie contents in a modal",+ "import_success": "Imported: {{cookies}} cookies across {{buckets}} platform(s)",+ "paste_modal_title": "Paste cookies",+ "paste_modal_subtitle": "Paste your cookie file contents — Netscape (yt-dlp) or JSON (Edit-This-Cookie) accepted.",+ "paste_field_content": "Content",+ "paste_field_source": "Source URL (optional)",+ "paste_field_alias": "Name (optional)",+ "paste_content_placeholder": "# Netscape HTTP Cookie File\\n.youtube.com\\tTRUE\\t/\\tTRUE\\t...",+ "paste_source_placeholder": "https://www.example.com/...",+ "paste_alias_placeholder": "e.g. YouTube personal",+ "paste_cancel": "Cancel",+ "paste_submit": "Import",+ "paste_importing": "Importing…",+ "export_dialog_title": "Save cookies file",+ "export_done": "File saved",+ "modal_title": "Cookie contents",+ "modal_close": "Close",+ "modal_filter_placeholder": "Filter by cookie name…",+ "modal_copy_all": "Copy all",+ "modal_copied": "Content copied",+ "modal_no_results": "No cookies found with this filter.",+ "modal_total": "{{count}} cookies",+ "modal_expired_count": "{{count}} expired",+ "modal_expired_tag": "expired",+ "add_generic_title": "Add generic",+ "add_generic_hint": "For yt-dlp-supported sites not listed above.",+ "add_generic_placeholder": "Domain (e.g. bandcamp.com)",+ "add_generic_paste": "Paste cookies",+ "add_generic_cancel": "Cancel",+ "confirm_clear_title": "Clear cookies?",+ "confirm_clear_body": "Cookies for {{domain}} go to the trash (recoverable for 24h). Continue?",+ "confirm_clear_cancel": "Cancel",+ "confirm_clear_action": "Clear",+ "cleared_toast": "Cookies moved to trash",+ "add_account_label": "添加其他账户",+ "add_account_success": "账户 '{{slug}}' 已添加 — {{count}} cookies",+ "account_primary_tag": "默认"}},"omnibox": {diff --git a/src/lib/stores/settings-store.svelte.ts b/src/lib/stores/settings-store.svelte.tsindex 194faa67..e0d2e822 100644--- a/src/lib/stores/settings-store.svelte.ts+++ b/src/lib/stores/settings-store.svelte.ts@@ -21,6 +21,9 @@ export type AppSettings = {organize_by_platform: boolean;download_subtitles: boolean;include_auto_subtitles: boolean;+ caption_locale: string;+ keep_vtt: boolean;+ continuous_lecture_numbers: boolean;translate_metadata: boolean;youtube_sponsorblock: boolean;split_by_chapters: boolean;diff --git a/src/lib/study-music-components/EqualizerPanel.svelte b/src/lib/study-music-components/EqualizerPanel.svelteindex 57ef295a..9511a53b 100644--- a/src/lib/study-music-components/EqualizerPanel.svelte+++ b/src/lib/study-music-components/EqualizerPanel.svelte@@ -92,7 +92,7 @@<span class="gain">{value > 0 ? "+" : ""}{value.toFixed(1)} dB</span><inputtype="range"- orient="vertical"+ {...{ orient: "vertical" } as Record<string, string>}min="-12"max="12"step="0.5"diff --git a/src/lib/study-music-components/SourceOrderPanel.svelte b/src/lib/study-music-components/SourceOrderPanel.svelteindex 63125b8c..5f825043 100644--- a/src/lib/study-music-components/SourceOrderPanel.svelte+++ b/src/lib/study-music-components/SourceOrderPanel.svelte@@ -2,6 +2,7 @@import { pluginInvoke } from "$lib/plugin-invoke";import { showToast } from "$lib/stores/toast-store.svelte";import { musicUI } from "$lib/study-music/ui-store.svelte";+ import { goto } from "$app/navigation";import { t } from "$lib/i18n";type SourceEntry = { slug: string; available: boolean };@@ -102,7 +103,7 @@musicUI.openQobuz();} else if (slug === "youtube_music") {onClose();- musicUI.openYoutube();+ void goto("/settings?cat=cookies");}}diff --git a/src/lib/study-music-youtube-components/YoutubeConnectHero.svelte b/src/lib/study-music-youtube-components/YoutubeConnectHero.svelteindex 3131c42b..cab5bc53 100644--- a/src/lib/study-music-youtube-components/YoutubeConnectHero.svelte+++ b/src/lib/study-music-youtube-components/YoutubeConnectHero.svelte@@ -1,6 +1,5 @@<script lang="ts">import { t } from "$lib/i18n";- import { musicUI } from "$lib/study-music/ui-store.svelte";import { goto } from "$app/navigation";type Props = {@@ -11,11 +10,11 @@let { status, filePath }: Props = $props();function openConfigPanel() {- musicUI.openYoutube();+ void goto("/settings?cat=cookies");}function exploreAnonymously() {- goto("/study/music/youtube/explore");+ void goto("/study/music/youtube/explore");}</script>diff --git a/src/lib/study-music-youtube-components/YoutubePanel.svelte b/src/lib/study-music-youtube-components/YoutubePanel.sveltedeleted file mode 100644index c576904a..00000000--- a/src/lib/study-music-youtube-components/YoutubePanel.svelte+++ /dev/null@@ -1,481 +0,0 @@-<script lang="ts">- import { onMount, onDestroy } from "svelte";- import { invoke } from "@tauri-apps/api/core";- import { listen, type UnlistenFn } from "@tauri-apps/api/event";- import { pluginInvoke } from "$lib/plugin-invoke";- import { showToast } from "$lib/stores/toast-store.svelte";- import { t } from "$lib/i18n";-- type Settings = {- browser: string;- audio_format_preference: string;- sapisid_set: boolean;- cookie_set: boolean;- visitor_data_set: boolean;- };-- type Props = {- open: boolean;- onClose: () => void;- onImported?: () => void;- };-- let { open, onClose, onImported }: Props = $props();-- let settings = $state<Settings | null>(null);- let importUrl = $state("");- let busy = $state(false);- let sapisidInput = $state("");- let cookieInput = $state("");- let syncProgress = $state<{ stage: string; current?: number; total?: number; name?: string } | null>(null);- let unlistenFns: UnlistenFn[] = [];-- async function load() {- try {- settings = await pluginInvoke<Settings>("study", "study:music:youtube:get_settings");- } catch {- settings = null;- }- }-- $effect(() => {- if (open) void load();- });-- type Status = {- file_exists: boolean;- file_path: string;- last_modified_secs: number | null;- age_seconds: number | null;- total_cookies: number;- domains: string[];- };-- function fmtAge(secs: number | null | undefined): string {- if (secs == null) return "—";- if (secs < 60) return `${secs}s atrás`;- if (secs < 3600) return `${Math.floor(secs / 60)} min atrás`;- if (secs < 86400) return `${Math.floor(secs / 3600)} h atrás`;- return `${Math.floor(secs / 86400)} dias atrás`;- }-- async function importFromExtension() {- if (busy) return;- busy = true;- try {- const status = await invoke<Status>("extension_cookies_status");-- if (!status.file_exists) {- showToast(- "error",- $t("study.music.yt_ext_no_file", {- path: status.file_path,- }) as string,- );- return;- }-- const ageMin = status.age_seconds != null- ? Math.floor(status.age_seconds / 60)- : null;- const hasYoutube = status.domains.some(- (d) => d.endsWith("youtube.com") || d.endsWith("google.com"),- );-- if (!hasYoutube) {- showToast(- "error",- $t("study.music.yt_ext_no_youtube", {- domains: status.domains.slice(0, 3).join(", ") || "(nenhum)",- age: fmtAge(status.age_seconds),- }) as string,- );- return;- }-- type Bundle = {- domain: string;- cookie_string: string;- well_known: Record<string, string>;- cookies: Array<{ name: string; value: string }>;- fetched_at: number;- };- const bundle = await invoke<Bundle | null>("read_extension_cookies", {- domain: "youtube.com",- });- if (!bundle) {- showToast("error", $t("study.music.yt_ext_empty") as string);- return;- }- const sapisid = bundle.well_known["__Secure-3PAPISID"]- ?? bundle.well_known["SAPISID"]- ?? "";- if (!sapisid) {- showToast(- "error",- $t("study.music.yt_ext_no_sapisid_detail", {- count: bundle.cookies.length,- age: fmtAge(status.age_seconds),- }) as string,- );- return;- }- const res = await pluginInvoke<Settings>(- "study",- "study:music:youtube:set_settings",- {- sapisid,- cookie_string: bundle.cookie_string,- },- );- settings = res;- showToast(- "success",- $t("study.music.yt_ext_imported_detail", {- count: bundle.cookies.length,- age: fmtAge(status.age_seconds),- }) as string,- );- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- }- }-- async function saveAuth() {- if (busy) return;- busy = true;- try {- const args: Record<string, string> = {};- if (sapisidInput.trim()) args.sapisid = sapisidInput.trim();- if (cookieInput.trim()) args.cookie_string = cookieInput.trim();- const res = await pluginInvoke<Settings>(- "study",- "study:music:youtube:set_settings",- args,- );- settings = res;- sapisidInput = "";- cookieInput = "";- showToast("success", $t("study.music.yt_auth_saved") as string);- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- }- }-- async function autoVisitorData() {- if (busy) return;- busy = true;- try {- await pluginInvoke("study", "study:music:youtube:auto_visitor_data");- await load();- showToast("success", $t("study.music.yt_visitor_ok") as string);- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- }- }-- async function disconnect() {- if (busy || !window.confirm($t("study.music.yt_disconnect_confirm") as string)) return;- busy = true;- try {- await pluginInvoke("study", "study:music:youtube:set_settings", {- sapisid: "",- cookie_string: "",- visitor_data: "",- });- await load();- showToast("success", $t("study.music.yt_disconnected") as string);- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- }- }-- async function importPlaylist() {- if (!importUrl.trim() || busy) return;- busy = true;- try {- const res = await pluginInvoke<{ title: string; imported: number }>(- "study",- "study:music:youtube:import_playlist",- { url: importUrl.trim() },- );- showToast(- "success",- $t("study.music.yt_imported", {- title: res.title || "playlist",- count: res.imported,- }) as string,- );- importUrl = "";- onImported?.();- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- }- }-- async function syncLibrary() {- if (busy) return;- busy = true;- syncProgress = { stage: "starting" };- try {- const res = await pluginInvoke<{ playlists: number; tracks: number }>(- "study",- "study:music:youtube:sync_library",- );- showToast(- "success",- $t("study.music.yt_sync_done", {- playlists: res.playlists,- tracks: res.tracks,- }) as string,- );- onImported?.();- } catch (e) {- showToast("error", e instanceof Error ? e.message : String(e));- } finally {- busy = false;- setTimeout(() => (syncProgress = null), 2000);- }- }-- onMount(async () => {- try {- unlistenFns.push(- await listen<{ stage: string; current?: number; total?: number; name?: string }>(- "study:music:youtube:sync_progress",- (e) => {- syncProgress = e.payload;- },- ),- );- } catch {- /* ignore */- }- });-- onDestroy(() => {- for (const fn of unlistenFns) fn();- });-- function onKey(e: KeyboardEvent) {- if (e.key === "Escape") {- e.preventDefault();- e.stopPropagation();- onClose();- }- }-- const isAuthed = $derived((settings?.sapisid_set ?? false) || (settings?.cookie_set ?? false));-</script>--{#if open}- <div- class="overlay"- role="presentation"- onclick={(e) => {- if (e.target === e.currentTarget) onClose();- }}- onkeydown={onKey}- >- <div class="dialog" role="dialog" aria-modal="true" tabindex="-1">- <header class="head">- <div class="head-text">- <h3>{$t("study.music.yt_title")}</h3>- {#if isAuthed}- <span class="state on">✓ {$t("study.music.yt_state_authed")}</span>- {:else}- <span class="state off">{$t("study.music.yt_state_anon")}</span>- {/if}- </div>- <button type="button" class="close" onclick={onClose} aria-label={$t("study.common.close") as string}>×</button>- </header>- <div class="body">- <p class="hint">{$t("study.music.yt_intro")}</p>-- <section class="step">- <span class="step-num">1</span>- <div class="step-body">- <h4>{$t("study.music.yt_auth_title")}</h4>- <p class="step-desc">{$t("study.music.yt_auth_desc")}</p>- <div class="ext-shortcut">- <button type="button" class="cta-secondary" onclick={importFromExtension} disabled={busy}>- <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">- <polyline points="20 6 9 17 4 12"/>- </svg>- {$t("study.music.yt_ext_import")}- </button>- <span class="ext-hint">{$t("study.music.yt_ext_hint")}</span>- </div>- <div class="manual-divider"><span>{$t("study.music.yt_or_manual")}</span></div>- <details class="howto">- <summary>{$t("study.music.yt_auth_how")}</summary>- <ol>- <li>{$t("study.music.yt_auth_step1")}</li>- <li>{$t("study.music.yt_auth_step2")}</li>- <li>{$t("study.music.yt_auth_step3")}</li>- <li>{$t("study.music.yt_auth_step4")}</li>- </ol>- </details>- <label class="field">- <span>__Secure-3PAPISID</span>- <input- type="password"- bind:value={sapisidInput}- placeholder={settings?.sapisid_set ? "•••••• (já configurado)" : "AbcDef123..."}- autocomplete="off"- />- </label>- <label class="field">- <span>{$t("study.music.yt_cookie_full")}</span>- <textarea- bind:value={cookieInput}- placeholder={settings?.cookie_set ? "(já configurado)" : "VISITOR_INFO1_LIVE=...; SID=...; HSID=...; ..."}- rows="2"- ></textarea>- <small>{$t("study.music.yt_cookie_hint")}</small>- </label>- <div class="row-actions">- <button type="button" class="cta-secondary" onclick={saveAuth} disabled={busy || (!sapisidInput.trim() && !cookieInput.trim())}>- {$t("study.music.yt_save_auth")}- </button>- {#if isAuthed}- <button type="button" class="link danger" onclick={disconnect} disabled={busy}>- {$t("study.music.yt_disconnect")}- </button>- {/if}- </div>- </div>- </section>-- <section class="step">- <span class="step-num">2</span>- <div class="step-body">- <h4>{$t("study.music.yt_step2_title")}</h4>- <p class="step-desc">{$t("study.music.yt_step2_desc")}</p>- <div class="import-row">- <input- type="text"- bind:value={importUrl}- placeholder="https://music.youtube.com/playlist?list=..."- onkeydown={(e) => { if (e.key === "Enter") importPlaylist(); }}- disabled={busy}- />- <button type="button" class="cta" onclick={importPlaylist} disabled={busy || !importUrl.trim()}>- {$t("study.music.yt_import")}- </button>- </div>- <ul class="example-list">- <li><code>music.youtube.com/playlist?list=LM</code> — <span>{$t("study.music.yt_lm_label")}</span></li>- <li><code>music.youtube.com/playlist?list=PLxxxx</code> — <span>{$t("study.music.yt_playlist_label")}</span></li>- </ul>- </div>- </section>-- {#if isAuthed}- <section class="step accent">- <span class="step-num">3</span>- <div class="step-body">- <h4>{$t("study.music.yt_sync_title")}</h4>- <p class="step-desc">{$t("study.music.yt_sync_desc")}</p>- <button type="button" class="cta wide" onclick={syncLibrary} disabled={busy}>- {busy ? $t("study.music.yt_syncing") : $t("study.music.yt_sync_now")}- </button>- {#if syncProgress}- <div class="progress-line">- {#if syncProgress.stage === "starting"}- {$t("study.music.yt_sync_starting")}- {:else if syncProgress.stage === "liked"}- {$t("study.music.yt_sync_liked")}- {:else if syncProgress.stage === "playlists"}- {$t("study.music.yt_sync_playlists", { total: syncProgress.total ?? 0 })}- {:else if syncProgress.stage === "playlist_fetch"}- {syncProgress.current}/{syncProgress.total}: {syncProgress.name}- {/if}- </div>- {/if}- </div>- </section>- {/if}- </div>- </div>- </div>-{/if}--<style>- .overlay {- position: fixed;- inset: 0;- background: rgba(0, 0, 0, 0.55);- z-index: 320;- display: grid;- place-items: center;- backdrop-filter: blur(4px);- }- .dialog {- background: rgb(20, 20, 20);- color: rgba(255, 255, 255, 0.95);- border: 1px solid rgba(255, 255, 255, 0.08);- border-radius: 14px;- width: min(620px, 92vw);- max-height: 88vh;- box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);- display: flex;- flex-direction: column;- overflow: hidden;- }- .head { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }- .head-text { display: flex; flex-direction: column; gap: 4px; }- .head h3 { margin: 0; font-size: 16px; font-weight: 800; }- .state { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; width: fit-content; }- .state.on { background: rgba(34, 197, 94, 0.15); color: rgb(74, 222, 128); }- .state.off { background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.45); }- .close { width: 28px; height: 28px; background: transparent; border: 0; border-radius: 50%; color: rgba(255, 255, 255, 0.5); font-size: 18px; cursor: pointer; flex-shrink: 0; }- .body { padding: 8px 20px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }- .hint { margin: 0; color: rgba(255, 255, 255, 0.65); font-size: 13px; line-height: 1.5; }- .step { display: flex; gap: 12px; padding: 14px; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(255, 255, 255, 0.06); border-radius: 10px; }- .step.accent { background: color-mix(in oklab, var(--accent) 10%, rgba(255,255,255,0.03)); border-color: color-mix(in oklab, var(--accent) 30%, transparent); }- .step-num { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent, white); border-radius: 50%; font-size: 12px; font-weight: 700; }- .step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }- .step-body h4 { margin: 0; font-size: 13px; font-weight: 700; }- .step-desc { margin: 0; color: rgba(255, 255, 255, 0.6); font-size: 12px; line-height: 1.5; }- .howto summary { cursor: pointer; font-size: 11px; color: rgba(255, 255, 255, 0.55); margin-bottom: 4px; }- .howto ol { margin: 4px 0 8px 16px; padding: 0; font-size: 11px; color: rgba(255, 255, 255, 0.7); line-height: 1.5; }- .howto li { margin-bottom: 2px; }- .field { display: flex; flex-direction: column; gap: 4px; margin: 4px 0; }- .field span { font-size: 11px; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; letter-spacing: 0.06em; }- .field input, .field textarea { padding: 8px 10px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 6px; color: rgba(255, 255, 255, 0.95); font-family: ui-monospace, monospace; font-size: 11px; outline: none; resize: vertical; }- .field input:focus, .field textarea:focus { border-color: var(--accent); }- .field small { font-size: 11px; color: rgba(255, 255, 255, 0.4); }- .row-actions { display: flex; align-items: center; gap: 8px; }- .cta-secondary { padding: 7px 14px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 999px; background: transparent; color: rgba(255, 255, 255, 0.95); font-family: inherit; font-size: 12px; cursor: pointer; }- .cta-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }- .cta-secondary:disabled { opacity: 0.4; cursor: default; }- .cta { padding: 8px 18px; border: 0; border-radius: 999px; background: var(--accent); color: var(--on-accent, white); font-family: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }- .cta.wide { width: 100%; padding: 10px 18px; }- .cta:disabled { opacity: 0.5; cursor: default; }- .link { background: transparent; border: 0; color: rgba(255, 255, 255, 0.5); font-family: inherit; font-size: 11px; cursor: pointer; padding: 0; }- .link.danger:hover { color: rgb(248, 113, 113); }- .import-row { display: flex; gap: 8px; }- .import-row input { flex: 1; padding: 9px 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; color: rgba(255, 255, 255, 0.95); font-family: ui-monospace, monospace; font-size: 12px; outline: none; }- .import-row input:focus { border-color: var(--accent); }- .example-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 11px; }- .example-list code { background: rgba(0, 0, 0, 0.4); padding: 1px 6px; border-radius: 4px; color: rgba(255, 255, 255, 0.75); font-size: 10px; margin-right: 6px; }- .example-list span { color: rgba(255, 255, 255, 0.55); }- .progress-line { margin-top: 4px; padding: 6px 10px; background: rgba(0, 0, 0, 0.3); border-radius: 6px; font-size: 11px; color: rgba(255, 255, 255, 0.7); font-family: ui-monospace, monospace; }- .ext-shortcut { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: color-mix(in oklab, var(--accent) 8%, transparent); border: 1px solid color-mix(in oklab, var(--accent) 30%, transparent); border-radius: 8px; }- .ext-shortcut .cta-secondary { display: inline-flex; align-items: center; gap: 6px; }- .ext-hint { font-size: 11px; color: rgba(255, 255, 255, 0.65); flex: 1; }- .manual-divider { display: flex; align-items: center; margin: 4px 0; color: rgba(255, 255, 255, 0.35); font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; }- .manual-divider::before, .manual-divider::after { content: ""; flex: 1; height: 1px; background: rgba(255, 255, 255, 0.08); }- .manual-divider span { padding: 0 10px; }-</style>diff --git a/src/lib/study-music/ui-store.svelte.ts b/src/lib/study-music/ui-store.svelte.tsindex e849514e..6c709e49 100644--- a/src/lib/study-music/ui-store.svelte.ts+++ b/src/lib/study-music/ui-store.svelte.ts@@ -94,13 +94,6 @@ class MusicUI {closeDiscord() {this.discordOpen = false;}- youtubeOpen = $state(false);- openYoutube() {- this.youtubeOpen = true;- }- closeYoutube() {- this.youtubeOpen = false;- }qualityOpen = $state(false);openQuality() {this.qualityOpen = true;diff --git a/src/routes/courses/[platform]/+page.svelte b/src/routes/courses/[platform]/+page.svelteindex bdf0da4f..e0266d81 100644--- a/src/routes/courses/[platform]/+page.svelte+++ b/src/routes/courses/[platform]/+page.svelte@@ -457,7 +457,7 @@placeholder={$t("courses.search_placeholder")}bind:value={searchQuery}oninput={() => { currentPage = 1; }}- onkeydown={(e) => { if (e.key === "Enter" && config.features.has_search) handleSearch(); }}+ onkeydown={(e) => { if (e.key === "Enter" && config?.features.has_search) handleSearch(); }}/>{#if config.features.has_search}<button class="button" onclick={handleSearch} disabled={!searchQuery.trim()}>diff --git a/src/routes/downloads/+page.svelte b/src/routes/downloads/+page.svelteindex c5f09c28..db8cf8a1 100644--- a/src/routes/downloads/+page.svelte+++ b/src/routes/downloads/+page.svelte@@ -15,6 +15,7 @@getSpeedHistory,type CourseDownloadItem,type GenericDownloadItem,+ type QueueKind,} from "$lib/stores/download-store.svelte";import { getDownloadStats } from "$lib/stores/download-stats.svelte";import PlatformIcon from "$components/icons/PlatformIcon.svelte";@@ -23,6 +24,10 @@import ContextHint from "$components/hints/ContextHint.svelte";import DownloadSpeedGraph from "$components/download/DownloadSpeedGraph.svelte";import DownloadLog from "$components/download/DownloadLog.svelte";+ import ReencodeDialog from "$components/dialog/ReencodeDialog.svelte";+ import { locale as i18nLocale } from "$lib/i18n";+ import { get } from "svelte/store";+ import timeAgo from "$lib/time-ago";let studyAvailable = $state(false);@@ -208,6 +213,24 @@}}+ async function pauseAll() {+ try {+ await invoke("pause_all_downloads");+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ }+ }++ async function resumeAll() {+ try {+ await invoke("resume_all_downloads");+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ }+ }+async function revealFile(path: string) {try {await invoke("reveal_file", { path });@@ -216,9 +239,192 @@showToast("error", msg);}}++ let reencodePath = $state<string | null>(null);++ function openReencode(path: string) {+ reencodePath = path;+ }++ type HistoryEntry = {+ id: number;+ url: string;+ platform: string;+ title: string;+ file_path: string | null;+ file_size_bytes: number | null;+ total_bytes: number | null;+ success: boolean;+ error: string | null;+ completed_at: number;+ thumbnail_url: string | null;+ kind: QueueKind | null;+ };++ let viewMode = $state<"active" | "history">("active");+ let historyEntries = $state<HistoryEntry[]>([]);+ let historyLoading = $state(false);++ async function loadHistory() {+ historyLoading = true;+ try {+ historyEntries = await invoke<HistoryEntry[]>("get_download_history");+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ } finally {+ historyLoading = false;+ }+ }++ async function clearHistory() {+ if (!confirm($t("downloads.history_clear_confirm") as string)) return;+ try {+ await invoke("clear_download_history");+ historyEntries = [];+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ }+ }++ function toggleHistoryView() {+ if (viewMode === "history") {+ viewMode = "active";+ } else {+ viewMode = "history";+ loadHistory();+ }+ }++ async function historyRetry(url: string, platform: string) {+ try {+ const settings = (await import("$lib/stores/settings-store.svelte")).getSettings();+ const outputDir = settings?.download.default_output_dir ?? "";+ if (!outputDir) {+ showToast("error", $t("common.error") as string);+ return;+ }+ await invoke("download_from_url", {+ url,+ outputDir,+ downloadMode: null,+ quality: settings?.download.video_quality ?? "best",+ formatId: null,+ referer: null,+ });+ viewMode = "active";+ showToast("info", $t("downloads.history_requeued") as string);+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ }+ }++ function fmtHistoryTime(unixSec: number): string {+ const ms = unixSec * 1000;+ const loc = get(i18nLocale) || "en";+ const lookup = loc.startsWith("pt") ? "pt" : "en";+ return timeAgo(ms, lookup);+ }++ function canPlayInStudyHistory(entry: HistoryEntry): boolean {+ return (+ studyAvailable &&+ entry.success &&+ !!entry.file_path &&+ (entry.kind === "video" || entry.kind === "audio")+ );+ }++ function openHistoryInStudy(filePath: string) {+ const parts = filePath.replace(/\\/g, "/").split("/");+ const name = parts[parts.length - 1] ?? "";+ const url = `/study/watch?path=${encodeURIComponent(filePath)}&name=${encodeURIComponent(name)}`;+ goto(url);+ }++ let dragId = $state<number | null>(null);+ let dropTargetId = $state<number | null>(null);+ let dropPosition = $state<"before" | "after">("before");++ function onDragStart(e: DragEvent, id: number) {+ dragId = id;+ if (e.dataTransfer) {+ e.dataTransfer.effectAllowed = "move";+ e.dataTransfer.setData("text/plain", String(id));+ }+ }++ function onDragOver(e: DragEvent, id: number) {+ if (dragId === null || dragId === id) return;+ e.preventDefault();+ if (e.dataTransfer) e.dataTransfer.dropEffect = "move";+ const target = e.currentTarget as HTMLElement;+ const rect = target.getBoundingClientRect();+ const midpoint = rect.top + rect.height / 2;+ dropPosition = e.clientY < midpoint ? "before" : "after";+ dropTargetId = id;+ }++ function onDragLeave(e: DragEvent, id: number) {+ if (dropTargetId === id) {+ dropTargetId = null;+ }+ }++ async function onDrop(e: DragEvent, targetId: number) {+ e.preventDefault();+ const movingId = dragId;+ const position = dropPosition;+ dragId = null;+ dropTargetId = null;+ if (movingId === null || movingId === targetId) return;++ const order = grouped.queued.map((q) => q.id);+ const fromIdx = order.indexOf(movingId);+ if (fromIdx === -1) return;+ order.splice(fromIdx, 1);+ let targetIdx = order.indexOf(targetId);+ if (targetIdx === -1) return;+ if (position === "after") targetIdx += 1;+ order.splice(targetIdx, 0, movingId);++ try {+ await invoke<boolean>("reorder_queue", { ids: order });+ } catch (e: any) {+ const msg = typeof e === "string" ? e : e.message ?? $t("common.error");+ showToast("error", msg);+ }+ }++ function onDragEnd() {+ dragId = null;+ dropTargetId = null;+ }++ function onKeydown(e: KeyboardEvent) {+ const target = e.target as HTMLElement | null;+ const tag = target?.tagName?.toLowerCase();+ const isEditable =+ tag === "input" ||+ tag === "textarea" ||+ tag === "select" ||+ target?.isContentEditable;+ if (isEditable) return;+ if (e.ctrlKey && !e.altKey && !e.metaKey && !e.shiftKey && (e.key === "h" || e.key === "H")) {+ e.preventDefault();+ toggleHistoryView();+ }+ }++ onMount(() => {+ window.addEventListener("keydown", onKeydown);+ return () => window.removeEventListener("keydown", onKeydown);+ });</script>-{#if hasDownloads}+{#if hasDownloads || viewMode === "history"}<div class="downloads-page"><div class="downloads-header"><div class="downloads-title-row">@@ -227,13 +433,44 @@<span class="downloads-stats">{$t('downloads.stats_line', { count: String(dlStats.totalDownloads), size: formatBytes(dlStats.totalBytes) })}</span>{/if}</div>- {#if finishedCount > 0}- <button class="clear-btn" onclick={clearFinished}>- {$t('downloads.clear_finished')}+ <div class="bulk-actions">+ {#if viewMode === "active"}+ {#if grouped.active.length > 0}+ <button class="clear-btn" onclick={pauseAll} title={$t('downloads.pause_all') as string}>+ {$t('downloads.pause_all')}+ </button>+ {/if}+ {#if grouped.paused.length > 0}+ <button class="clear-btn" onclick={resumeAll} title={$t('downloads.resume_all') as string}>+ {$t('downloads.resume_all')}+ </button>+ {/if}+ {#if finishedCount > 0}+ <button class="clear-btn" onclick={clearFinished}>+ {$t('downloads.clear_finished')}+ </button>+ {/if}+ {:else if historyEntries.length > 0}+ <button class="clear-btn" onclick={clearHistory}>+ {$t('downloads.history_clear')}+ </button>+ {/if}+ <button+ class="history-toggle"+ class:on={viewMode === "history"}+ onclick={toggleHistoryView}+ aria-label={$t('downloads.history_toggle') as string}+ title={$t('downloads.history_toggle_hint') as string}+ >+ <svg viewBox="0 0 24 24" width="15" height="15" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="9" />+ <polyline points="12 7 12 12 15 14" />+ </svg></button>- {/if}+ </div></div>+ {#if viewMode === "active"}<div class="filter-pills" role="tablist" aria-label={$t('downloads.filter_label')}>{#each [{ value: 'all', labelKey: 'downloads.filter.all', count: filterCounts.all },@@ -272,9 +509,28 @@{/if}{#if showSection.queued && grouped.queued.length > 0}- <h5 class="section-label">{$t('downloads.section_queued')}</h5>+ <h5 class="section-label">+ {$t('downloads.section_queued')}+ {#if grouped.queued.length > 1}+ <span class="queue-reorder-hint">{$t('downloads.reorder_hint')}</span>+ {/if}+ </h5>{#each grouped.queued as item (item.id)}- {@render genericItem(item)}+ <div+ class="queue-drop-zone"+ class:drop-before={dropTargetId === item.id && dropPosition === "before"}+ class:drop-after={dropTargetId === item.id && dropPosition === "after"}+ class:dragging={dragId === item.id}+ draggable="true"+ role="listitem"+ ondragstart={(e) => onDragStart(e, item.id)}+ ondragover={(e) => onDragOver(e, item.id)}+ ondragleave={(e) => onDragLeave(e, item.id)}+ ondrop={(e) => onDrop(e, item.id)}+ ondragend={onDragEnd}+ >+ {@render genericItem(item)}+ </div>{/each}{/if}@@ -293,14 +549,123 @@{/if}{/if}</div>+ {:else}+ <div class="history-view">+ {#if historyLoading}+ <p class="history-empty">{$t('downloads.history_loading')}</p>+ {:else if historyEntries.length === 0}+ <div class="history-empty-state">+ <svg viewBox="0 0 24 24" width="36" height="36" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <circle cx="12" cy="12" r="9" />+ <polyline points="12 7 12 12 15 14" />+ </svg>+ <p class="history-empty-text">{$t('downloads.history_empty')}</p>+ </div>+ {:else}+ <ul class="history-list">+ {#each historyEntries as entry (entry.id)}+ <li class="history-item" data-success={entry.success}>+ <div class="history-item-head">+ {#if entry.thumbnail_url}+ <img+ src={entry.thumbnail_url}+ alt=""+ class="queue-thumb"+ loading="lazy"+ onerror={(e) => { (e.target as HTMLImageElement).style.display = 'none'; }}+ />+ {/if}+ <PlatformIcon platform={entry.platform} size={16} />+ {#if entry.kind}+ <QueueKindBadge kind={entry.kind} size={14} />+ {/if}+ <span class="history-title">{entry.title || entry.url}</span>+ <span class="history-time">{fmtHistoryTime(entry.completed_at)}</span>+ </div>+ <div class="history-item-meta">+ {#if entry.success && entry.file_size_bytes}+ <span class="history-meta-chip">{formatBytes(entry.file_size_bytes)}</span>+ {/if}+ {#if !entry.success && entry.error}+ <span class="history-meta-chip history-meta-error">{entry.error}</span>+ {/if}+ </div>+ <div class="history-item-actions">+ {#if canPlayInStudyHistory(entry) && entry.file_path}+ <button+ class="action-icon-btn"+ onclick={() => openHistoryInStudy(entry.file_path!)}+ aria-label={$t('downloads.open_in_study')}+ title={$t('downloads.open_in_study')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <circle cx="12" cy="12" r="10" />+ <polygon points="10 8 16 12 10 16 10 8" fill="currentColor" stroke="none" />+ </svg>+ </button>+ {/if}+ {#if entry.success && entry.file_path}+ <button+ class="action-icon-btn"+ onclick={() => revealFile(entry.file_path!)}+ aria-label={$t('downloads.open_folder')}+ title={$t('downloads.open_folder')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" />+ </svg>+ </button>+ {/if}+ {#if entry.success && entry.file_path && entry.kind === "video"}+ <button+ class="action-icon-btn"+ onclick={() => openReencode(entry.file_path!)}+ aria-label={$t('reencode.action_label')}+ title={$t('reencode.action_label')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <polyline points="4 14 10 14 10 20" />+ <polyline points="20 10 14 10 14 4" />+ <line x1="14" y1="10" x2="21" y2="3" />+ <line x1="3" y1="21" x2="10" y2="14" />+ </svg>+ </button>+ {/if}+ <button+ class="action-icon-btn"+ onclick={() => historyRetry(entry.url, entry.platform)}+ aria-label={$t('downloads.history_redownload')}+ title={$t('downloads.history_redownload')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <polyline points="23 4 23 10 17 10" />+ <path d="M20.49 15a9 9 0 11-2.12-9.36L23 10" />+ </svg>+ </button>+ </div>+ </li>+ {/each}+ </ul>+ {/if}+ </div>+ {/if}</div>{:else}<div class="downloads-empty"><Mascot emotion="idle" /><p class="empty-text">{$t('downloads.empty')} <ContextHint text={$t('hints.downloads_empty')} dismissKey="downloads_empty" /></p>+ <button class="history-link" onclick={toggleHistoryView}>+ <svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">+ <circle cx="12" cy="12" r="9" />+ <polyline points="12 7 12 12 15 14" />+ </svg>+ {$t('downloads.history_view_link')}+ </button></div>{/if}+<ReencodeDialog bind:inputPath={reencodePath} />+{#snippet genericItem(item: GenericDownloadItem)}<div class="download-item" data-status={item.status}><div class="item-header">@@ -438,6 +803,21 @@<path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z" /></svg></button>+ {#if item.queueKind === "video"}+ <button+ class="action-icon-btn"+ onclick={() => openReencode(item.filePath!)}+ aria-label={$t('reencode.action_label')}+ title={$t('reencode.action_label')}+ >+ <svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">+ <polyline points="4 14 10 14 10 20" />+ <polyline points="20 10 14 10 14 4" />+ <line x1="14" y1="10" x2="21" y2="3" />+ <line x1="3" y1="21" x2="10" y2="14" />+ </svg>+ </button>+ {/if}<buttonclass="action-icon-btn"class:confirm-remove={pendingRemove === item.id}@@ -685,6 +1065,13 @@font-weight: 400;}+ .bulk-actions {+ display: flex;+ align-items: center;+ gap: calc(var(--padding) / 3);+ flex-shrink: 0;+ }+.clear-btn {font-size: 12.5px;font-weight: 500;@@ -1035,4 +1422,208 @@font-size: 13px;padding: calc(var(--padding) / 2) var(--padding);}++ .history-toggle {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 26px;+ height: 26px;+ background: transparent;+ border: 1px solid transparent;+ border-radius: calc(var(--border-radius) / 2);+ color: var(--tertiary);+ cursor: pointer;+ flex-shrink: 0;+ }++ @media (hover: hover) {+ .history-toggle:hover {+ color: var(--secondary);+ background: var(--button-elevated);+ }+ }++ .history-toggle.on {+ color: var(--accent);+ background: var(--accent-soft, color-mix(in srgb, var(--accent) 12%, transparent));+ border-color: color-mix(in srgb, var(--accent) 25%, transparent);+ }++ .history-toggle:focus-visible {+ outline: var(--focus-ring);+ outline-offset: var(--focus-ring-offset);+ }++ .history-view {+ display: flex;+ flex-direction: column;+ gap: 6px;+ }++ .history-empty {+ color: var(--tertiary);+ font-size: 13px;+ padding: var(--padding) 0;+ }++ .history-empty-state {+ display: flex;+ flex-direction: column;+ align-items: center;+ gap: calc(var(--padding) / 2);+ padding: calc(var(--padding) * 3) var(--padding);+ color: var(--tertiary);+ }++ .history-empty-text {+ font-size: 13.5px;+ margin: 0;+ }++ .history-list {+ list-style: none;+ margin: 0;+ padding: 0;+ display: flex;+ flex-direction: column;+ gap: 4px;+ }++ .history-item {+ display: grid;+ grid-template-columns: 1fr auto;+ grid-template-areas:+ "head actions"+ "meta actions";+ column-gap: calc(var(--padding) / 2);+ align-items: center;+ padding: 8px 10px;+ border-radius: var(--border-radius);+ background: var(--button);+ }++ .history-item[data-success="false"] {+ background: color-mix(in srgb, var(--error, #c33) 6%, var(--button));+ }++ .history-item-head {+ grid-area: head;+ display: flex;+ align-items: center;+ gap: 8px;+ min-width: 0;+ }++ .history-title {+ font-size: 13.5px;+ color: var(--secondary);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ flex: 1;+ min-width: 0;+ }++ .history-time {+ font-size: 11.5px;+ color: var(--tertiary);+ flex-shrink: 0;+ }++ .history-item-meta {+ grid-area: meta;+ display: flex;+ gap: 6px;+ margin-top: 2px;+ padding-left: 24px;+ }++ .history-meta-chip {+ font-size: 11px;+ color: var(--tertiary);+ background: var(--button-elevated);+ padding: 2px 6px;+ border-radius: calc(var(--border-radius) / 2);+ }++ .history-meta-error {+ color: var(--error, #c33);+ background: color-mix(in srgb, var(--error, #c33) 12%, transparent);+ overflow: hidden;+ text-overflow: ellipsis;+ white-space: nowrap;+ max-width: 320px;+ }++ .history-item-actions {+ grid-area: actions;+ display: flex;+ gap: 2px;+ align-items: center;+ }++ .history-link {+ margin-top: calc(var(--padding) / 2);+ display: inline-flex;+ align-items: center;+ gap: 5px;+ font-size: 12.5px;+ color: var(--tertiary);+ background: transparent;+ border: none;+ cursor: pointer;+ padding: 4px 6px;+ border-radius: calc(var(--border-radius) / 2);+ }++ @media (hover: hover) {+ .history-link:hover {+ color: var(--secondary);+ background: var(--button);+ }+ }++ .queue-reorder-hint {+ font-size: 10.5px;+ font-weight: 400;+ color: var(--tertiary);+ text-transform: none;+ letter-spacing: 0;+ margin-left: 8px;+ }++ .queue-drop-zone {+ position: relative;+ cursor: grab;+ transition: opacity 0.12s;+ }++ .queue-drop-zone:active {+ cursor: grabbing;+ }++ .queue-drop-zone.dragging {+ opacity: 0.4;+ }++ .queue-drop-zone.drop-before::before,+ .queue-drop-zone.drop-after::after {+ content: "";+ position: absolute;+ left: 8px;+ right: 8px;+ height: 2px;+ background: var(--accent);+ border-radius: 1px;+ pointer-events: none;+ }++ .queue-drop-zone.drop-before::before {+ top: -2px;+ }++ .queue-drop-zone.drop-after::after {+ bottom: -2px;+ }</style>diff --git a/src/routes/settings/+page.svelte b/src/routes/settings/+page.svelteindex 9956d6e7..f52485d5 100644--- a/src/routes/settings/+page.svelte+++ b/src/routes/settings/+page.svelte@@ -16,6 +16,7 @@import SettingsDownloads from "$components/settings/SettingsDownloads.svelte";import SettingsTypography from "$components/settings/SettingsTypography.svelte";import SettingsBrowserExtension from "$components/settings/SettingsBrowserExtension.svelte";+ import SettingsCookies from "$components/settings/SettingsCookies.svelte";type DependencyStatus = {name: string;@@ -137,7 +138,7 @@await updateSettings({ download: { video_quality: value } });}- type SettingsCategory = "downloads" | "appearance" | "typography" | "network" | "plugins" | "advanced";+ type SettingsCategory = "downloads" | "appearance" | "typography" | "network" | "cookies" | "plugins" | "advanced";let activeCategory = $state<SettingsCategory>("downloads");let searchQuery = $state("");@@ -401,6 +402,7 @@["appearance", "settings.cat_appearance"],["typography", "settings.cat_typography"],["network", "settings.cat_network"],+ ["cookies", "settings.cat_cookies"],["plugins", "settings.cat_plugins"],["advanced", "settings.cat_advanced"],] as [cat, key] (cat)}@@ -438,6 +440,10 @@<SettingsNetwork />{/if}+ {#if isSearching || activeCategory === "cookies"}+ <SettingsCookies />+ {/if}+{#if isSearching || activeCategory === "advanced"}<SettingsAdvanced {resetting} onReset={handleReset} />{/if}diff --git a/src/routes/study/+layout.svelte b/src/routes/study/+layout.svelteindex 3396adbe..cb510993 100644--- a/src/routes/study/+layout.svelte+++ b/src/routes/study/+layout.svelte@@ -25,7 +25,6 @@import EqualizerPanel from "$lib/study-music-components/EqualizerPanel.svelte";import LastFmPanel from "$lib/study-music-components/LastFmPanel.svelte";import MusicThemePanel from "$lib/study-music-components/MusicThemePanel.svelte";- import YoutubePanel from "$lib/study-music-youtube-components/YoutubePanel.svelte";import QualityPresetPanel from "$lib/study-music-components/QualityPresetPanel.svelte";import SourceOrderPanel from "$lib/study-music-components/SourceOrderPanel.svelte";import QobuzPanel from "$lib/study-music-components/QobuzPanel.svelte";@@ -795,11 +794,6 @@onClose={() => musicUI.closeTranslationSettings()}/>-<YoutubePanel- open={musicUI.youtubeOpen}- onClose={() => musicUI.closeYoutube()}-/>-<QualityPresetPanelopen={musicUI.qualityOpen}onClose={() => musicUI.closeQuality()}diff --git a/src/routes/study/music/+layout.svelte b/src/routes/study/music/+layout.svelteindex a16125af..88616356 100644--- a/src/routes/study/music/+layout.svelte+++ b/src/routes/study/music/+layout.svelte@@ -81,7 +81,6 @@if (musicUI.lastfmOpen) return;if (musicUI.themeOpen) return;if (musicUI.discordOpen) return;- if (musicUI.youtubeOpen) return;if (musicUI.contextMenu.open) return;if (musicUI.selectedCount() > 0) return;e.preventDefault();diff --git a/vite.config.js b/vite.config.jsindex 07382e32..d677277a 100644--- a/vite.config.js+++ b/vite.config.js@@ -52,7 +52,7 @@ function i18nKeysPlugin({ strict } = { strict: false }) {};}-export default defineConfig(async ({ command }) => {+export default defineConfig(({ command }) => {const gitInfo = getGitInfo();const isBuild = command === "build";const strictI18n =