Fixed Script in html

This commit is contained in:
UrloMythus
2024-09-02 17:02:29 +02:00 Unverified
parent f2352dbeb7
commit 6ead9ca685
+12 -11
View File
@@ -252,18 +252,19 @@ HTML = """
} }
} }
const instanceUrl = "{instance_url}"; // Keep http in the URL const instanceUrl = "{instance_url}"; // Keep http in the URL
manifest += "|"; const manifestUrl = instanceUrl + "/" + manifest + "/" + "manifest.json";
document.getElementById("manifestBox").innerText = manifest.replace(/\|+$/, ""); return manifestUrl;
document.getElementById("manifestBox").style.display = "block";
} }
document.getElementById("generateManifestButton").addEventListener("click", generateManifest); document.getElementById('generateManifestButton').addEventListener('click', function() {
const manifestUrl = generateManifest();
document.getElementById("installButton").addEventListener("click", function() { document.getElementById("manifestBox").style.display = "block";
const manifestText = document.getElementById("manifestBox").innerText; document.getElementById("manifestBox").innerText = manifestUrl;
const anchor = document.createElement('a'); });
anchor.href = "http://127.0.0.1:8050/" + manifestText; // Correct URL format document.getElementById('installButton').addEventListener('click', function() {
anchor.target = "_blank"; let manifestUrl = generateManifest();
anchor.click(); manifestUrl = manifestUrl.replace("http://", "");
const stremioUrl = "stremio://" + manifestUrl;
window.location.href = stremioUrl;
}); });
</script> </script>
</body> </body>