Skip to content

Commit 75fa7f7

Browse files
committed
Add a Gisoo preset on top of v2.9.30
Gisoo (gisoo.pro) is OpenAI-compatible, so it needs no new provider code: it is a Custom API with a ready-made name, base URL and model. - Options > Custom API: a "Fill with Gisoo" button prefills name, base URL (https://gisoo.pro/api/v1) and model; the user only pastes the key. - Auto mode: a saved Custom API is now the last link of the subtitle chain (OpenRouter, OpenAI, Gemini, Custom). It takes over only after the others fail with a quota or temporary error, or when it is the only provider set up. - PRIVACY.md (fa + en): states that when Gisoo is active the subtitle text and the words selected for explanation are sent to gisoo.pro. - README (fa + en): Gisoo added to the provider lists.
1 parent a76a3ca commit 75fa7f7

6 files changed

Lines changed: 23 additions & 2 deletions

File tree

‎PRIVACY.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
## چه چیزی به بیرون ارسال می‌شود
1717

1818
- متن زیرنویس (برای ترجمه) و/یا صدای تب (برای دوبله) فقط به همان سرویسی که خودت در تنظیمات انتخاب و کلیدش را وارد کرده‌ای (Gemini، OpenRouter، OpenAI، یا یک Custom API دلخواه) ارسال می‌شود.
19+
- وقتی گیسو فعال است، متن زیرنویس و واژه‌های انتخاب‌شده برای توضیح، برای پردازش به gisoo.pro فرستاده می‌شوند. اگر گیسو فعال نباشد، چیزی به آن‌جا فرستاده نمی‌شود.
1920
- برای Custom API، افزونه پیش از اولین استفاده فقط برای همان یک دامنه که خودت وارد می‌کنی درخواست اجازهٔ دسترسی می‌کند (نه کل اینترنت).
2021
- وقتی معنی یک لغت انگلیسی را می‌خواهی، همان لغت (فقط خود کلمه، بدون متن زیرنویس) به `api.dictionaryapi.dev` فرستاده می‌شود. این سرویس برای جستجوی معنی لغت است و کلید یا داده دیگری دریافت نمی‌کند.
2122
- کش ترجمهٔ زیرنویس (برای همه، حتی بدون ورود): بعد از هر دستهٔ ترجمهٔ زیرنویس، این داده‌ها به `https://sub-ify.site/subify-api/cache` فرستاده می‌شود: شناسهٔ ویدیو، شناسهٔ آهنگ زیرنویس، زبان مقصد، زمان شروع و پایان هر خط، متن اصلی خط و ترجمه‌اش. این کش می‌تواند برای همان ویدیو دوباره خوانده شود تا هزینهٔ API تکرار نشود. کلید API و صدا در این درخواست‌ها نیست و درخواست‌ها بدون کوکی ورود فرستاده می‌شوند.
@@ -44,6 +45,9 @@
4445
- فونت Lalezar (`fonts/Lalezar-Regular.ttf`, مجوز OFL)، فقط برای نمایش زیرنویس.
4546

4647

48+
## Gisoo
49+
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.
50+
4751
## Account (only when login is required)
4852
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.
4953

‎README.En.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Current providers include:
122122

123123
- Google Gemini
124124
- OpenRouter
125+
- 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
125126
- OpenAI
126127

127128
### 🌍 Multilingual content

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122

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

127128
### 🌍 محتوای چندزبانه

‎background.js‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2006,11 +2006,12 @@ browser.runtime.onMessage.addListener((msg, sender, sendResponse) => {
20062006
break;
20072007
}
20082008
if (provider === "gemini" && !settings.apiKey) throw new Error("Gemini انتخاب شده، اما کلید Gemini ذخیره نشده است");
2009-
if (provider === "auto" && !settings.apiKey && !settings.openRouterKey && !settings.openaiKey) throw new Error("هیچ کلید Gemini، OpenRouter یا OpenAI ذخیره نشده است");
2009+
const customReady = (() => { const p = getCustomProvider(settings); return !!(p && p.apiKey && p.model); })();
2010+
if (provider === "auto" && !settings.apiKey && !settings.openRouterKey && !settings.openaiKey && !customReady) throw new Error("هیچ کلید Gemini، OpenRouter، OpenAI یا سرویس اختصاصی ذخیره نشده است");
20102011
let results, usedProvider;
20112012
if (provider === "auto") {
20122013
// Auto does NOT prefer Gemini. Each configured provider is tried in turn:
2013-
// OpenRouter, then OpenAI, then Gemini. A quota or temporary error moves the
2014+
// OpenRouter, then OpenAI, then Gemini, then a saved Custom API. A quota or temporary error moves the
20142015
// batch to the next one, and the popup shows which provider handled it.
20152016
const chain = [];
20162017
if (settings.openRouterKey) chain.push(["openrouter", () => translateSubtitleCuesOpenRouter(cues, settings)]);
@@ -2019,6 +2020,8 @@ browser.runtime.onMessage.addListener((msg, sender, sendResponse) => {
20192020
const chosen = settings.geminiSubtitleModel || settings.sttModel;
20202021
return withModelFallback({ ...settings, sttModel: chosen }, "sttModel", [chosen, ...STT_FALLBACKS], (m) => translateSubtitleCues(cues, { ...settings, subtitleProvider: "gemini" }, m));
20212022
}]);
2023+
// 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.
2024+
if (customReady) chain.push(["custom", () => translateSubtitleCuesCustom(cues, settings)]);
20222025
for (let i = 0; i < chain.length; i++) {
20232026
try {
20242027
results = await chain[i][1]();

‎options.html‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,7 @@ <h3>API اختصاصی: سرویس خودت را اضافه کن</h3>
469469
<button id="cp-test" type="button">تست اتصال</button>
470470
<button id="cp-models" type="button">دریافت مدل‌ها</button>
471471
<button id="cp-new" type="button">+ سرویس جدید</button>
472+
<button id="cp-gisoo" type="button" title="نام، آدرس API و مدل پیش‌فرض گیسو را پر می‌کند">پر کردن با گیسو</button>
472473
<button id="cp-delete" type="button">حذف سرویس</button>
473474
</div>
474475
<div class="grid" style="margin-top:10px">

‎options.js‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,17 @@ $("cp-new").addEventListener("click", () => {
351351
clearCustomProviderForm();
352352
$("cp-status").textContent = "اطلاعات سرویس جدید رو وارد کن و ذخیره بزن.";
353353
});
354+
// 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.
355+
$("cp-gisoo").addEventListener("click", () => {
356+
$("cp-list").dataset.newId = `custom_${Date.now()}`;
357+
$("cp-list").value = "";
358+
clearCustomProviderForm();
359+
$("cp-name").value = "Gisoo";
360+
$("cp-base").value = "https://gisoo.pro/api/v1";
361+
$("cp-model").value = "gemini-3.1-flash-lite";
362+
$("cp-key").focus();
363+
$("cp-status").textContent = "کلید API را از gisoo.pro بگیر و اینجا بگذار، بعد ذخیره بزن. اگر می‌خواهی گیسو فقط وقتی Gemini، OpenRouter یا OpenAI خطا دادند وارد شود، بعد از ذخیره موتور ترجمه را روی «خودکار» بگذار.";
364+
});
354365
$("cp-delete").addEventListener("click", async () => {
355366
const id = $("cp-list").value;
356367
if (!id) return;

0 commit comments

Comments
 (0)