-
Notifications
You must be signed in to change notification settings - Fork 0
/
jioSaavn.js
51 lines (51 loc) · 1.77 KB
/
jioSaavn.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
window.i = 3;
window.j = 1;
setInterval(function() {
new Promise(function(myResolve, myReject) {
var rightClick = document.createEvent('HTMLEvents');
rightClick.initEvent('contextmenu', true, false);
var song = document.getElementsByClassName("o-snippet__action-init u-centi")[i];
song.style.backgroundColor = "Black"
song.dispatchEvent(rightClick);
console.info(" Adding song:" + j);
j++;
console.info(" i:" + i);
i = i + 2;
myResolve();
}).then(function(value) {
new Promise(function(myResolve, myReject) {
setTimeout(function() {
var addToPlayListButton = document.getElementsByClassName("c-nav__list")[5].getElementsByClassName("c-nav__link")[3];
addToPlayListButton.click();
myResolve();
}, 3000);
}).then(function(value) {
new Promise(function(myResolve, myReject) {
setTimeout(function() {
var playlist = document.getElementsByClassName("c-nav__list")[7].getElementsByClassName("c-nav__item")[1].getElementsByClassName("c-nav__link")[0];
playlist.click();
myResolve();
}, 3000);
}).then(function(value) {
new Promise(function(myResolve, myReject) {
setTimeout(function() {
var myName = document.getElementsByClassName("u-margin-bottom-none@sm")[7];
myName.click();
myResolve();
}, 3000);
});
}).then(function() {
new Promise(function(myResolve, myReject) {
setTimeout(function() {
var rightClick = document.createEvent('HTMLEvents');
rightClick.initEvent('contextmenu', true, false);
var song = document.getElementsByClassName("o-snippet__action-init u-centi")[5];
song.style.backgroundColor = "Black"
song.dispatchEvent(rightClick);
myResolve();
}, 3000);
});
});
});
});
}, 15000);