-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
37 lines (34 loc) · 847 Bytes
/
script.js
File metadata and controls
37 lines (34 loc) · 847 Bytes
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
function byId(id) {
return document.getElementById(id);
}
let d;
let theme = `
#dl-info {
background: #111529;
}
#dl-bar {
background: #111529;
}
#dl-subcover {
background: #111529;
}
`;
byId("download").onclick = function() {
if (byId("input").value.trim() != "") {
d = new DownloadJS(byId("input").value.trim());
d.autoUseProxy();
d.setStyle(theme);
d.useWidget("#downloaders")
d.getFileInfo(function(size) {
if (size) {
let allowed = ((size / 1000) / 1000);
if (allowed > 100) {
d.removeWidget();
alert("File Can Not Be Larger Than 100mb to avoid crashing the browser");
return false;
}
}
d.start();
}, "Content-Length");
}
}