Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions PRIVACY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 و صدا در این درخواست‌ها نیست و درخواست‌ها بدون کوکی ورود فرستاده می‌شوند.
Expand Down Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions README.En.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@

- Google Gemini
- OpenRouter
- Gisoo ([gisoo.pro](https://gisoo.pro/?utm_source=github&utm_medium=referral&utm_campaign=subify)): از بخش «API اختصاصی» اضافه می‌شود؛ دکمهٔ «پر کردن با گیسو» فرم را پر می‌کند
- OpenAI

### 🌍 محتوای چندزبانه
Expand Down
7 changes: 5 additions & 2 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)]);
Expand All @@ -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]();
Expand Down
1 change: 1 addition & 0 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ <h3>API اختصاصی: سرویس خودت را اضافه کن</h3>
<button id="cp-test" type="button">تست اتصال</button>
<button id="cp-models" type="button">دریافت مدل‌ها</button>
<button id="cp-new" type="button">+ سرویس جدید</button>
<button id="cp-gisoo" type="button" title="نام، آدرس API و مدل پیش‌فرض گیسو را پر می‌کند">پر کردن با گیسو</button>
<button id="cp-delete" type="button">حذف سرویس</button>
</div>
<div class="grid" style="margin-top:10px">
Expand Down
11 changes: 11 additions & 0 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down