From eb9ae7f6ed64faf2f7b43afb8a21969f4d172d51 Mon Sep 17 00:00:00 2001 From: JMcrafter26 <77780772+JMcrafter26@users.noreply.github.com> Date: Fri, 6 Feb 2026 01:12:02 +0100 Subject: [PATCH] fix: s.to module - add base URL to relative links and images, update version to 0.4.2 --- s.to/sToEngDub.json | 2 +- s.to/sToEngDub_v2.js | 24 +++++++++++++++++++++--- s.to/sToGerDub.json | 2 +- s.to/sToGerDub_v2.js | 24 +++++++++++++++++++++--- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/s.to/sToEngDub.json b/s.to/sToEngDub.json index fb2c639..d10d3b5 100644 --- a/s.to/sToEngDub.json +++ b/s.to/sToEngDub.json @@ -6,7 +6,7 @@ "icon": "https://files.catbox.moe/ttj4fc.gif", "url": "https://github.com/JMcrafter26" }, - "version": "0.4.1", + "version": "0.4.2", "language": "English (DUB)", "streamType": "HLS", "quality": "720p", diff --git a/s.to/sToEngDub_v2.js b/s.to/sToEngDub_v2.js index a3456df..492bc9b 100644 --- a/s.to/sToEngDub_v2.js +++ b/s.to/sToEngDub_v2.js @@ -4,6 +4,7 @@ async function searchResults(keyword) { try { + const baseUrl = 'https://s.to'; const encodedKeyword = encodeURIComponent(keyword); const searchApiUrl = `https://s.to/suche?term=${encodedKeyword}`; const response = await soraFetch(searchApiUrl); @@ -15,11 +16,11 @@ async function searchResults(keyword) { while ((match = searchRegex.exec(text)) !== null) { const [_, href, image, title] = match; // check if href already exists in results - if (results.some(result => result.href === href.trim())) { - continue; + if (results.some(result => result.href === baseUrl + href.trim())) { + continue; // skip if href already exists } - results.push({ title: title.trim(), image: image.trim(), href: href.trim() }); + results.push({ title: title.trim(), image: baseUrl + image.trim(), href: baseUrl + href.trim() }); } @@ -223,6 +224,7 @@ async function sendLog(message) { // Site specific structure function getSeasonLinks(html) { const seasonLinks = []; + const baseUrl = 'https://s.to'; //