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) {