From 5bfc45cd23557aa95e327d0c897b05ade65f5e55 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 7 Aug 2026 09:09:56 +0200 Subject: [PATCH] The sources form no longer insists on prehraj.to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The addon accepts either host on its own as of stremio_prehrajto 7ef248d, so the page that mints the URLs stops claiming otherwise. Each host stays all-or-nothing and at least one must be complete — the same rule /encode enforces, checked here too so the message arrives in Czech rather than as a 400. --- pb_public/index.html | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/pb_public/index.html b/pb_public/index.html index c22af77..ca90d9d 100644 --- a/pb_public/index.html +++ b/pb_public/index.html @@ -227,25 +227,25 @@

Amber si z tvých přihlašovacích údajů poskládá adresy zdrojů sám. Údaje jdou přímo do doplňku, přes náš server neprojdou.

-

prehraj.to

+

prehraj.to — nebo webshare níž

-

Povinné — český doplněk stojí na prehraj.to a bez něj - se nespustí. webshare se přidává k němu, samostatně zatím nefunguje.

+

Vyplň prehraj.to, webshare, nebo obojí — stačí jeden + z nich. Obojí najde nejvíc.

-

webshare.cz — volitelné

+

webshare.cz

-

Druhý český host. Buď obojí, nebo nic — půlka údajů - selže při každém hledání.

+

Druhý český host, funguje i sám o sobě. U každého + hosta ale buď obojí, nebo nic — půlka údajů selže při každém hledání.

TorBox — volitelné, ale doporučené

@@ -688,14 +688,20 @@ $("byGo").onclick=async function(){ var ptU=$("byPtUser").value.trim(), ptP=$("byPtPass").value; var wsU=$("byWsUser").value.trim(), wsP=$("byWsPass").value; var tb=$("byTbKey").value.trim(), tmdb=$("byTmdb").value.trim(); - if(!ptU || !ptP){ - setMsg($("adMsg"),"prehraj.to je zatím povinný — bez něj český doplněk nefunguje.","err"); + // Each host is all-or-nothing, and at least one must be complete — the same + // rule the addon's own /encode enforces, checked here so the message is Czech. + if ((ptU && !ptP) || (!ptU && ptP)){ + setMsg($("adMsg"),"U prehraj.to vyplň jméno i heslo, nebo obojí nech prázdné.","err"); return; } if ((wsU && !wsP) || (!wsU && wsP)){ setMsg($("adMsg"),"U webshare vyplň jméno i heslo, nebo obojí nech prázdné.","err"); return; } + if (!(ptU && ptP) && !(wsU && wsP)){ + setMsg($("adMsg"),"Vyplň aspoň jednoho hosta — prehraj.to nebo webshare.","err"); + return; + } busy($("byGo"),true,"Nastavuji…"); setMsg($("adMsg"),""); var out={ tmdbKey:tmdb }; try { @@ -703,7 +709,7 @@ $("byGo").onclick=async function(){ // from this browser to the addon and never through our server. var enc=await fetch(PREHRAJTO_BASE+"/encode",{ method:"POST", headers:{"Content-Type":"application/json"}, - body:JSON.stringify({ username:ptU, password:ptP, + body:JSON.stringify({ username:ptU||"", password:ptP||"", wsUsername:wsU||"", wsPassword:wsP||"" })}); var ed=await enc.json(); if(!enc.ok || !ed.token) throw new Error(ed.error||"encode failed");