Skip to content

Instantly share code, notes, and snippets.

@alexmercerind
Created May 26, 2020 17:21
Show Gist options
  • Save alexmercerind/e6e60566c62825c9e8f3496bfed54042 to your computer and use it in GitHub Desktop.
Save alexmercerind/e6e60566c62825c9e8f3496bfed54042 to your computer and use it in GitHub Desktop.
Script to search music in JioSaavn
//github.com/alexmercerind
let axios = require('axios');
function search(mode, keyword) {
axios.get(`https://www.jiosaavn.com/search/${mode}/${keyword}`)
.then((response, resolve, reject) => {
let page_source = (response.data).split(",");
let id_array = [];
for (let i = 0; i<page_source.length; i++) {
let element = page_source[i];
if (element.length == 10 && !isNaN(element[1])) {
id_array.push(Number(element.substring(1, element.length-1)));
};
};
console.log(id_array); //print album/song id
});
};
search("album", "voicenotes"); //search here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment