diff --git a/public/index.html b/public/index.html index 94cb33e..c331e91 100644 --- a/public/index.html +++ b/public/index.html @@ -1281,6 +1281,10 @@ licenseActivating: false, licenseActivationError: null, licenseActivationKey: "", + // Free tier: once dismissed, the activation screen no longer + // hard-gates the UI. Persisted so returning unlicensed users land + // straight in the app. + activationSkipped: localStorage.getItem("yt-summarizer-activation-skipped") === "1", }; const MODELS = ["gemini-3.1-pro-preview", "gemini-3-pro-preview", "gemini-3-flash-preview"]; @@ -1320,23 +1324,54 @@ // ── Process ────────────────────────────────────────────────────────────── async function handleSubmit() { - const hasKey = state.apiKey.trim() || state.hasServerKey; - if (!state.url.trim() || !hasKey) return; + // Free tier requires BYO Gemini key — bundled key is licensed-only. + const free = !isLicensed(); + const hasKey = free ? !!state.apiKey.trim() : (state.apiKey.trim() || state.hasServerKey); + if (!state.url.trim() || !hasKey) { + if (free && !state.apiKey.trim() && state.url.trim()) { + showToast("Free mode needs your own Gemini API key — open Settings to enter one.", "🔑"); + } + return; + } const url = state.url.trim(); - state.url = ""; - // If already processing, add to queue + // If already processing — free tier blocks, paid tier queues. if (state.loading) { + if (free) { + showToast("Free mode handles one video at a time. Wait for the current one to finish.", "⏳"); + return; + } + state.url = ""; state.queue.push({ id: Date.now().toString(), url, status: "queued", error: null }); render(); return; } - // Start processing immediately + state.url = ""; await processUrl(url); } + function handleLibraryClick() { + // Library / history is a paid feature (history entitlement). For + // free-tier users, surface the upgrade prompt instead of opening an + // empty sidebar. + if (!hasEntitlement("history")) { + showToast("Library is a paid feature — keep every summary you process. Tap upgrade to unlock.", "📚"); + return; + } + toggleHistory(); + } + + function handleSubscribeClick() { + // Subscriptions / channel auto-queue is Pro-only. + if (!hasEntitlement("subscriptions")) { + showToast("Channel & podcast subscriptions are a Pro feature. Upgrade to auto-summarize new uploads.", "📡"); + return; + } + addSubscriptionFromInput(); + } + function extractVideoId(url) { const patterns = [ /(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/|youtube\.com\/v\/)([a-zA-Z0-9_-]{11})/, @@ -1586,11 +1621,11 @@ return `
${loading ? "Checking license…" - : "Paste your Keysat license key to unlock this app. Buy a key from the seller, then come back here." + : "Activate a Keysat license to unlock the full app — library, subscriptions, channel auto-queue, and the bundled API key. Or skip to use free mode (one video at a time, bring your own Gemini key)." }
${loading ? "" : ` @@ -1606,6 +1641,11 @@ ${state.licenseActivating ? "Activating…" : "Activate"} Buy a key → +