Skip to content

Commit

Permalink
not using sumjay's jiosaavn api anymore, now fetching everything from…
Browse files Browse the repository at this point in the history
… jiosaavn.com

Fetching every details from jiosaavn.com/api.php however this is proxied with cloudflare workers.
  • Loading branch information
tuhinpal committed Sep 10, 2020
1 parent 1047efc commit 90dd279
Show file tree
Hide file tree
Showing 5 changed files with 104 additions and 94 deletions.
9 changes: 9 additions & 0 deletions css/download.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@
top: 0px;
}

.loading {
position: absolute;
margin: auto;
top: 0;
left: 0;
right: 0;
bottom: 0;
}


/**
* Made by Tuhin Kanti Pal
Expand Down
37 changes: 21 additions & 16 deletions download/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="author" content="Tuhin Kanti Pal">
<meta name="description" content="Stream with Lyrics or Download your Favourite Musics for free without any Ads">
<meta name="keywords" content="Music, Musicder, JavaScript , Download Free Music, Stream Music Online, Lyrics , Music API">
<meta name="description" content="Stream with Lyrics or Download your Favourite Musics for free without any Ads">
<meta name="keywords" content="Music, Musicder, JavaScript , Download Free Music, Stream Music Online, Lyrics , Music API">
<link href="https://fonts.googleapis.com/css?family=Krona+One" rel="stylesheet" />
<link href="https://fonts.googleapis.com/css2?family=Bitter:wght@900&display=swap" rel="stylesheet">
<link href="../css/download.css" rel="stylesheet" />
Expand All @@ -21,20 +21,25 @@
gtag('config', 'UA-177605755-1');
</script>
</head>
<body>
<h1 class="heading" id="songname"></h1>
<p class="quality">
Please select your preferred quality
</p>
<p class="center">
<a class="activityb" id="qone">96 Kbps</a>
<br> <br>
<a class="activityb" id="qtwo">128 Kbps</a>
<br> <br>
<a class="activityb" id="qthree">320 Kbps</a>
</p>
<div class="logodiv">
<h1 onclick="window.location.href='https://musicder.tk/';" class="logo">MUSICDER</h1>
<body onload="document.getElementById('content').style.display = 'none'; ">
<div id="content">
<h1 class="heading" id="songname"></h1>
<p class="quality">
Please select your preferred quality
</p>
<p class="center">
<a class="activityb" id="qone">96 Kbps</a>
<br> <br>
<a class="activityb" id="qtwo">128 Kbps</a>
<br> <br>
<a class="activityb" id="qthree">320 Kbps</a>
</p>
<div class="logodiv">
<h1 onclick="window.location.href='https://musicder.tk/';" class="logo">MUSICDER</h1>
</div>
</div>
<div id="loads">
<img id="image" src="../img/loading.gif" class="loading" width="150" height="150">
</div>
</body>
<script src="../js/download.js"></script>
Expand Down
9 changes: 5 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="author" content="Tuhin Kanti Pal">
<title>Musicder | Enjoy Music For Free</title>
<meta name="description" content="Stream with Lyrics or Download your Favourite Musics for free without any Ads">
<meta name="keywords" content="Music, Musicder, JavaScript , Download Free Music, Stream Music Online, Lyrics , Music API">
<meta name="description" content="Stream with Lyrics or Download your Favourite Musics for free without any Ads">
<meta name="keywords" content="Music, Musicder, JavaScript , Download Free Music, Stream Music Online, Lyrics , Music API">
<link href="https://fonts.googleapis.com/css?family=Krona+One|Gayathri|Poppins" rel="stylesheet" />
<link href="css/main.css" rel="stylesheet" />
<link href="css/style.css" rel="stylesheet" />
Expand Down Expand Up @@ -102,7 +102,8 @@ <h2 class="headingbelow">Type what do you want to Listen & Press Search</h2>
<p class="center">
<a id="dldfive" class="activityb">Download</a>
<a id="playfive" class="activityb">Play</a>
<br><br><br>
</p>
<br><br>
</div>
</div>
<div id="errresult" class="errres">
Expand Down Expand Up @@ -132,4 +133,4 @@ <h2 class="headingbelow">Type what do you want to Listen & Press Search</h2>
</body>
<script src="js/main.js"></script>
</html>
<!Made by Tuhin. Send Mail to me[at]mailtuhin[dot]ml for contact>
<!Made by Tuhin. Send Mail to me[at]mailtuhin[dot]ml for contact>
38 changes: 25 additions & 13 deletions js/download.js
Original file line number Diff line number Diff line change
@@ -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
*/
*/
105 changes: 44 additions & 61 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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);
Expand All @@ -47,96 +39,86 @@ 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") {
document.getElementById("errresult").style.display = "block";
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 = "<h1 class='headingtwo'>" + songnameone + "</h1><br><p class='parag'>" + artistone + "</p><br><p class='parag'> Album : " + albumone + "</p>";
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 = "<h1 class='headingtwo'>" + songnametwo + "</h1><br><p class='parag'>" + artisttwo + "</p><br><p class='parag'> Album : " + albumtwo + "</p>";
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 = "<h1 class='headingtwo'>" + songnamethree + "</h1><br><p class='parag'>" + artistthree + "</p><br><p class='parag'> Album : " + albumthree + "</p>";
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 = "<h1 class='headingtwo'>" + songnamefour + "</h1><br><p class='parag'>" + artistfour + "</p><br><p class='parag'> Album : " + albumfour + "</p>";
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 = "<h1 class='headingtwo'>" + songnamefive + "</h1><br><p class='parag'>" + artistfive + "</p><br><p class='parag'> Album : " + albumfive + "</p>";
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;
}
}
});
Expand All @@ -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
*/

1 comment on commit 90dd279

@vercel
Copy link

@vercel vercel bot commented on 90dd279 Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.