-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenload.ts
38 lines (33 loc) · 1.6 KB
/
openload.ts
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
if (url.indexOf('/f/')!= -1){
url=url.split('/f/')[1].split('/')[0];
}
var http = new XMLHttpRequest();
http.open('GET','https://api.openload.co/1/streaming/get?file='+url,true)
http.onloadend= function (){
console.log(JSON.parse(http.responseText))
if(JSON.parse(http.responseText).msg.indexOf("not")>0){
let confirm = hosterControllerBSAPI.promp.create({
title: 'Use this lightsaber?',
message: 'You are not paired. Pair your device to use openload with 3rd party applications.',
buttons: [
{
text: 'Different hoster',
handler: () => {
}
},
{
text: 'Pair now and try again',
handler: () => {
window.open("https://openload.co/pair","_self").onabort = function(){
alert("unload");
}
}
}
]
});
confirm.present();
}else{
doOnComplete(JSON.parse(http.responseText).result);
}
}
http.send();