diff --git a/css/download.css b/css/download.css index 1aad223..8b84345 100644 --- a/css/download.css +++ b/css/download.css @@ -75,6 +75,15 @@ top: 0px; } +.loading { + position: absolute; + margin: auto; + top: 0; + left: 0; + right: 0; + bottom: 0; +} + /** * Made by Tuhin Kanti Pal diff --git a/download/index.html b/download/index.html index 17742d0..72b4cf2 100644 --- a/download/index.html +++ b/download/index.html @@ -5,8 +5,8 @@ - - + + @@ -21,20 +21,25 @@ gtag('config', 'UA-177605755-1'); - -

-

- Please select your preferred quality -

-

- 96 Kbps -

- 128 Kbps -

- 320 Kbps -

-
-

MUSICDER

+ +
+

+

+ Please select your preferred quality +

+

+ 96 Kbps +

+ 128 Kbps +

+ 320 Kbps +

+
+

MUSICDER

+
+
+
+
diff --git a/index.html b/index.html index 40ec9c8..a85b268 100644 --- a/index.html +++ b/index.html @@ -6,8 +6,8 @@ Musicder | Enjoy Music For Free - - + + @@ -102,7 +102,8 @@

Type what do you want to Listen & Press Search

Download Play -


+

+

@@ -132,4 +133,4 @@

Type what do you want to Listen & Press Search

- + \ No newline at end of file diff --git a/js/download.js b/js/download.js index c8c34ee..0ba8661 100644 --- a/js/download.js +++ b/js/download.js @@ -1,27 +1,39 @@ /*! * Made by Tuhin Kanti Pal + * No More using Jiosaavn API by Sumanjay, Musicder is now fetch every Details from jiosaavn.com (Proxied using cloudflare worker) * Visit https://tu.hin.life */ let params = new URLSearchParams(location.search); -var name = params.get('n'); -var lnk = params.get('link'); +var id = params.get('id'); document.getElementById("songname").innerHTML = "Download " + name; -document.title = "Download " + name; -//96 kbps replace -var ninesix = lnk.replace("_320", "_96") ; -document.getElementById("qone").href = ninesix ; -//128 kbps replace -var onetwoeight = lnk.replace("_320", "_160") ; -document.getElementById("qtwo").href = onetwoeight ; - -//320 kbps -document.getElementById("qthree").href = lnk ; +var xmlhttp = new XMLHttpRequest(); +xmlhttp.onreadystatechange = function () { + if (this.readyState == 4 && this.status == 200) { + var datarawo = (this.responseText); + var dataraw = datarawo.replace(id, 'tuhinr'); + document.getElementById('content').style.display = 'block'; + document.getElementById('loads').style.display = 'none'; + var data = JSON.parse(dataraw); + var songname = data.tuhinr.song; + var link = data.tuhinr.tuhindownloadlink; + document.title = "Download " + songname; + document.getElementById("songname").innerHTML = "Download " + songname; + document.getElementById("qone").href = link; + var linkosz = link.replace("_96", "_160"); + document.getElementById("qtwo").href = linkosz; + var linkttz = link.replace("_96", "_320"); + document.getElementById("qthree").href = linkttz; + } +}; +xmlhttp.open("GET", "https://dldapi.musicder.tk/?pids=" + id, true); +xmlhttp.send(); /*! * Made by Tuhin Kanti Pal + * No More using Jiosaavn API by Sumanjay, Musicder is now fetch every Details from jiosaavn.com (Proxied using cloudflare worker) * Visit https://tu.hin.life - */ + */ \ No newline at end of file diff --git a/js/main.js b/js/main.js index 0ebc6f9..bf26801 100644 --- a/js/main.js +++ b/js/main.js @@ -1,20 +1,12 @@ /*! * Made by Tuhin Kanti Pal + * No More using Jiosaavn API by Sumanjay, Musicder is now fetch every Details from jiosaavn.com (Proxied using cloudflare worker) * Visit https://tu.hin.life */ function firstF() { var songname = document.getElementById("search").value; - var resa = songname.replace(" ", "+"); - var resb = resa.replace(" ", "+"); - var resc = resb.replace(" ", "+"); - var resd = resc.replace(" ", "+"); - var rese = resd.replace(" ", "+"); - var resf = rese.replace(" ", "+"); - var resg = resf.replace(" ", "+"); - var resh = resg.replace(" ", "+"); - var resi = resh.replace(" ", "+"); - var resj = resi.replace(" ", "+"); + var snformat = songname.replace(/ /g, "+"); document.getElementById("firsts").style.display = "none"; document.getElementById("footer").style.display = "none"; document.getElementById("loads").style.display = "block"; @@ -38,7 +30,7 @@ function firstF() { xhr.send(); }; - getJSON('https://api.musicder.tk/?query=' + resj, function (err, data) { + getJSON('https://searchapi.musicder.tk/?query=' + snformat, function (err, data) { if (err != null) { console.error(err); @@ -47,11 +39,11 @@ function firstF() { document.getElementById("seconds").style.display = "block"; document.getElementById("footer").style.display = "block"; - var tempone = `${data[0]}`; - var temptwo = `${data[1]}`; - var tempthree = `${data[2]}`; - var tempfour = `${data[3]}`; - var tempfive = `${data[4]}`; + var tempone = `${data.songs.data[0]}`; + var temptwo = `${data.songs.data[1]}`; + var tempthree = `${data.songs.data[2]}`; + var tempfour = `${data.songs.data[3]}`; + var tempfive = `${data.songs.data[4]}`; if (tempone === "undefined") { @@ -59,84 +51,74 @@ function firstF() { document.getElementById("sfirst").style.display = "none"; } else { document.getElementById("errresult").style.display = "none"; - var songnameone = `${data[0].song}`; - var albumone = `${data[0].album}`; - var imageone = `${data[0].image}`; - var linkone = `${data[0].media_url}`; - var artistone = `${data[0].singers}`; - var id_one = `${data[0].id}`; - var playone = id_one; + var songnameone = `${data.songs.data[0].title}`; + var albumone = `${data.songs.data[0].album}`; + var imageone = `${data.songs.data[0].image}`; + var artistone = `${data.songs.data[0].more_info.singers}`; + var id_one = `${data.songs.data[0].id}`; document.getElementById("tu").innerHTML = "

" + songnameone + "


" + artistone + "


Album : " + albumone + "

"; document.getElementById("imageone").src = imageone; - document.getElementById("dldone").href = "download/?n=" + songnameone + "&link=" + linkone; - document.getElementById("playone").href = "play/?id=" + playone + "&n=" + songnameone; + document.getElementById("dldone").href = "download/?id=" + id_one; + document.getElementById("playone").href = "play/?id=" + id_one + "&n=" + songnameone; } if (temptwo === "undefined") { document.getElementById("ssecond").style.display = "none"; } else { - var songnametwo = `${data[1].song}`; - var albumtwo = `${data[1].album}`; - var imagetwo = `${data[1].image}`; - var linktwo = `${data[1].media_url}`; - var artisttwo = `${data[1].singers}`; - var id_two = `${data[1].id}`; - var playtwo = id_two; + var songnametwo = `${data.songs.data[1].title}`; + var albumtwo = `${data.songs.data[1].album}`; + var imagetwo = `${data.songs.data[1].image}`; + var artisttwo = `${data.songs.data[1].more_info.singers}`; + var id_two = `${data.songs.data[1].id}`; document.getElementById("hin").innerHTML = "

" + songnametwo + "


" + artisttwo + "


Album : " + albumtwo + "

"; document.getElementById("imagetwo").src = imagetwo; - document.getElementById("dldtwo").href = "download/?n=" + songnametwo + "&link=" + linktwo; - document.getElementById("playtwo").href = "play/?id=" + playtwo + "&n=" + songnametwo; + document.getElementById("dldtwo").href = "download/?id=" + id_two; + document.getElementById("playtwo").href = "play/?id=" + id_two + "&n=" + songnametwo; } if (tempthree === "undefined") { document.getElementById("sthird").style.display = "none"; } else { - var songnamethree = `${data[2].song}`; - var albumthree = `${data[2].album}`; - var imagethree = `${data[2].image}`; - var linkthree = `${data[2].media_url}`; - var artistthree = `${data[2].singers}`; - var id_three = `${data[2].id}`; - var playthree = id_three; + var songnamethree = `${data.songs.data[2].title}`; + var albumthree = `${data.songs.data[2].album}`; + var imagethree = `${data.songs.data[2].image}`; + var artistthree = `${data.songs.data[2].more_info.singers}`; + var id_three = `${data.songs.data[2].id}`; document.getElementById("life").innerHTML = "

" + songnamethree + "


" + artistthree + "


Album : " + albumthree + "

"; document.getElementById("imagethree").src = imagethree; - document.getElementById("dldthree").href = "download/?n=" + songnamethree + "&link=" + linkthree; - document.getElementById("playthree").href = "play/?id=" + playthree + "&n=" + songnamethree; + document.getElementById("dldthree").href = "download/?id=" + id_three; + document.getElementById("playthree").href = "play/?id=" + id_three + "&n=" + songnamethree; } if (tempfour === "undefined") { document.getElementById("sfourth").style.display = "none"; } else { - var songnamefour = `${data[3].song}`; - var albumfour = `${data[3].album}`; - var imagefour = `${data[3].image}`; - var linkfour = `${data[3].media_url}`; - var artistfour = `${data[3].singers}`; - var id_four = `${data[3].id}`; - var playfour = id_four; + var songnamefour = `${data.songs.data[3].title}`; + var albumfour = `${data.songs.data[3].album}`; + var imagefour = `${data.songs.data[3].image}`; + var artistfour = `${data.songs.data[3].more_info.singers}`; + var id_four = `${data.songs.data[3].id}`; document.getElementById("iamtuhin").innerHTML = "

" + songnamefour + "


" + artistfour + "


Album : " + albumfour + "

"; document.getElementById("imagefour").src = imagefour; - document.getElementById("dldfour").href = "download/?n=" + songnamefour + "&link=" + linkfour; - document.getElementById("playfour").href = "play/?id=" + playfour + "&n=" + songnamefour; + document.getElementById("dldfour").href = "download/?id=" + id_four; + document.getElementById("playfour").href = "play/?id=" + id_four + "&n=" + songnamefour; } if (tempfive === "undefined") { document.getElementById("sfifth").style.display = "none"; } else { - var songnamefive = `${data[4].song}`; - var albumfive = `${data[4].album}`; - var imagefive = `${data[4].image}`; - var linkfive = `${data[4].media_url}`; - var artistfive = `${data[4].singers}`; - var id_five = `${data[4].id}`; - var playfive = id_five; + var songnamefive = `${data.songs.data[4].title}`; + var albumfive = `${data.songs.data[4].album}`; + var imagefive = `${data.songs.data[4].image}`; + var artistfive = `${data.songs.data[4].more_info.singers}`; + var id_five = `${data.songs.data[4].id}`; document.getElementById("ga").innerHTML = "

" + songnamefive + "


" + artistfive + "


Album : " + albumfive + "

"; document.getElementById("imagefive").src = imagefive; - document.getElementById("dldfive").href = "download/?n=" + songnamefive + "&link=" + linkfive; - document.getElementById("playfive").href = "play/?id=" + playfive + "&n=" + songnamefive; + document.getElementById("dldfive").href = "download/?id=" + id_five; + document.getElementById("playfive").href = "play/?id=" + id_five + "&n=" + songnamefive; } } }); @@ -153,5 +135,6 @@ document.addEventListener('contextmenu', event => event.preventDefault()); /*! * Made by Tuhin Kanti Pal + * No More using Jiosaavn API by Sumanjay, Musicder is now fetch every Details from jiosaavn.com (Proxied using cloudflare worker) * Visit https://tu.hin.life */ \ No newline at end of file