diff --git a/PRIVACY.md b/PRIVACY.md index 8f3115f..0d93f69 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -16,6 +16,7 @@ ## چه چیزی به بیرون ارسال می‌شود - متن زیرنویس (برای ترجمه) و/یا صدای تب (برای دوبله) فقط به همان سرویسی که خودت در تنظیمات انتخاب و کلیدش را وارد کرده‌ای (Gemini، OpenRouter، OpenAI، یا یک Custom API دلخواه) ارسال می‌شود. +- وقتی گیسو فعال است، متن زیرنویس و واژه‌های انتخاب‌شده برای توضیح، برای پردازش به gisoo.pro فرستاده می‌شوند. اگر گیسو فعال نباشد، چیزی به آن‌جا فرستاده نمی‌شود. - برای Custom API، افزونه پیش از اولین استفاده فقط برای همان یک دامنه که خودت وارد می‌کنی درخواست اجازهٔ دسترسی می‌کند (نه کل اینترنت). - وقتی معنی یک لغت انگلیسی را می‌خواهی، همان لغت (فقط خود کلمه، بدون متن زیرنویس) به `api.dictionaryapi.dev` فرستاده می‌شود. این سرویس برای جستجوی معنی لغت است و کلید یا داده دیگری دریافت نمی‌کند. - کش ترجمهٔ زیرنویس (برای همه، حتی بدون ورود): بعد از هر دستهٔ ترجمهٔ زیرنویس، این داده‌ها به `https://sub-ify.site/subify-api/cache` فرستاده می‌شود: شناسهٔ ویدیو، شناسهٔ آهنگ زیرنویس، زبان مقصد، زمان شروع و پایان هر خط، متن اصلی خط و ترجمه‌اش. این کش می‌تواند برای همان ویدیو دوباره خوانده شود تا هزینهٔ API تکرار نشود. کلید API و صدا در این درخواست‌ها نیست و درخواست‌ها بدون کوکی ورود فرستاده می‌شوند. @@ -44,6 +45,9 @@ - فونت Lalezar (`fonts/Lalezar-Regular.ttf`, مجوز OFL)، فقط برای نمایش زیرنویس. +## Gisoo +When Gisoo is active, the subtitle text and the words selected for explanation are sent to gisoo.pro for processing. When Gisoo is not active, nothing is sent there. Gisoo is set up as a Custom API; the browser asks for access to gisoo.pro only when you add it. + ## Account (only when login is required) The extension contacts `https://sub-ify.site/auth/me.php` (and `/auth/logout.php` when you sign out) to check whether you are signed in. The session cookie is HttpOnly on sub-ify.site; the extension does not read or store it. Only the account name and e-mail returned by the server are shown in the popup. diff --git a/README.En.md b/README.En.md index 2474bc0..28d0c4d 100644 --- a/README.En.md +++ b/README.En.md @@ -122,6 +122,7 @@ Current providers include: - Google Gemini - OpenRouter +- Gisoo ([gisoo.pro](https://gisoo.pro/?utm_source=github&utm_medium=referral&utm_campaign=subify)): added under Custom API; the "Fill with Gisoo" button prefills the form - OpenAI ### 🌍 Multilingual content diff --git a/README.md b/README.md index 7541f94..3a03489 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,7 @@ - Google Gemini - OpenRouter +- Gisoo ([gisoo.pro](https://gisoo.pro/?utm_source=github&utm_medium=referral&utm_campaign=subify)): از بخش «API اختصاصی» اضافه می‌شود؛ دکمهٔ «پر کردن با گیسو» فرم را پر می‌کند - OpenAI ### 🌍 محتوای چندزبانه diff --git a/background.js b/background.js index c35c428..cbeb56f 100644 --- a/background.js +++ b/background.js @@ -2006,11 +2006,12 @@ browser.runtime.onMessage.addListener((msg, sender, sendResponse) => { break; } if (provider === "gemini" && !settings.apiKey) throw new Error("Gemini انتخاب شده، اما کلید Gemini ذخیره نشده است"); - if (provider === "auto" && !settings.apiKey && !settings.openRouterKey && !settings.openaiKey) throw new Error("هیچ کلید Gemini، OpenRouter یا OpenAI ذخیره نشده است"); + const customReady = (() => { const p = getCustomProvider(settings); return !!(p && p.apiKey && p.model); })(); + if (provider === "auto" && !settings.apiKey && !settings.openRouterKey && !settings.openaiKey && !customReady) throw new Error("هیچ کلید Gemini، OpenRouter، OpenAI یا سرویس اختصاصی ذخیره نشده است"); let results, usedProvider; if (provider === "auto") { // Auto does NOT prefer Gemini. Each configured provider is tried in turn: - // OpenRouter, then OpenAI, then Gemini. A quota or temporary error moves the + // OpenRouter, then OpenAI, then Gemini, then a saved Custom API. A quota or temporary error moves the // batch to the next one, and the popup shows which provider handled it. const chain = []; if (settings.openRouterKey) chain.push(["openrouter", () => translateSubtitleCuesOpenRouter(cues, settings)]); @@ -2019,6 +2020,8 @@ browser.runtime.onMessage.addListener((msg, sender, sendResponse) => { const chosen = settings.geminiSubtitleModel || settings.sttModel; return withModelFallback({ ...settings, sttModel: chosen }, "sttModel", [chosen, ...STT_FALLBACKS], (m) => translateSubtitleCues(cues, { ...settings, subtitleProvider: "gemini" }, m)); }]); + // A saved Custom API (for example Gisoo) is the last link: it takes over only after the others fail with a quota or temporary error, or when it is the only one set up. + if (customReady) chain.push(["custom", () => translateSubtitleCuesCustom(cues, settings)]); for (let i = 0; i < chain.length; i++) { try { results = await chain[i][1](); diff --git a/options.html b/options.html index f28ee46..625115d 100644 --- a/options.html +++ b/options.html @@ -469,6 +469,7 @@

API اختصاصی: سرویس خودت را اضافه کن

+
diff --git a/options.js b/options.js index cb539c2..341eb84 100644 --- a/options.js +++ b/options.js @@ -351,6 +351,17 @@ $("cp-new").addEventListener("click", () => { clearCustomProviderForm(); $("cp-status").textContent = "اطلاعات سرویس جدید رو وارد کن و ذخیره بزن."; }); +// Preset for Gisoo (https://gisoo.pro): an OpenAI-compatible gateway, so it is just a Custom API with a ready-made name, URL and model. +$("cp-gisoo").addEventListener("click", () => { + $("cp-list").dataset.newId = `custom_${Date.now()}`; + $("cp-list").value = ""; + clearCustomProviderForm(); + $("cp-name").value = "Gisoo"; + $("cp-base").value = "https://gisoo.pro/api/v1"; + $("cp-model").value = "gemini-3.1-flash-lite"; + $("cp-key").focus(); + $("cp-status").textContent = "کلید API را از gisoo.pro بگیر و اینجا بگذار، بعد ذخیره بزن. اگر می‌خواهی گیسو فقط وقتی Gemini، OpenRouter یا OpenAI خطا دادند وارد شود، بعد از ذخیره موتور ترجمه را روی «خودکار» بگذار."; +}); $("cp-delete").addEventListener("click", async () => { const id = $("cp-list").value; if (!id) return;