From 04b924b86750a3bc27ab7e6655cb9b527d131a31 Mon Sep 17 00:00:00 2001 From: Dangrainage <99558179+Dangrainage@users.noreply.github.com> Date: Thu, 25 Apr 2024 08:55:32 +0200 Subject: [PATCH] Update Tester.HTML --- Tester.HTML | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Tester.HTML b/Tester.HTML index b5db79d..5b68a16 100644 --- a/Tester.HTML +++ b/Tester.HTML @@ -40,14 +40,13 @@ } else { let resultList = document.createElement('ul'); results.forEach(result => { - console.log('Result:', result); // Log the result object let listItem = document.createElement('li'); let link = document.createElement('a'); link.textContent = `${result.title} (${result.year})`; link.href = "#"; // Set a placeholder href link.addEventListener('click', function(event) { event.preventDefault(); - generateDynamic(result.link); + generateDynamic(result.href); }); listItem.appendChild(link); resultList.appendChild(listItem); @@ -57,8 +56,8 @@ } function generateDynamic(href) { - if (href) { - fetch(`https://filmer.anorak01.top/vid/${href.split("//")[1]}`) + if (href && href.startsWith('/')) { + fetch(`https://filmer.anorak01.top/vid/${href.split("/")[1]}`) .then(response => response.json()) .then(data => { if (data.url) {