corrected working of magnet link

This commit is contained in:
Manan Jethwani 2021-07-13 00:23:38 +05:30
parent a517d3b529
commit a8a96a99f4
3 changed files with 12 additions and 3 deletions

View File

@ -330,7 +330,11 @@ body {
text-decoration: none;
}
.modal-content a>div {
.modal-content span {
cursor: pointer;
}
.modal-content a>div, .modal-content span>div {
position: relative;
top: -26px;
left: 50px;

View File

@ -153,10 +153,10 @@
</a>
</div>
<div class="modal-regular-download">
<a href="${downloadLink}.magnet">
<span onclick="fetchAndRedirect('${downloadLink}.magnet')">
<img src="../skin/magnet.png" alt="download magnet" />
<div>Download magnet link</div>
</a>
</span>
</div>
<div class="modal-regular-download">
<a href="${downloadLink}.torrent" download>

View File

@ -77,5 +77,10 @@
modal.remove();
}
}
async function fetchAndRedirect(link) {
const response = await fetch(link);
const magnetLink = await response.text();
window.location = magnetLink;
}
</script>
</html>