-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
48 lines (44 loc) · 1.37 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="referrer" content="no-referrer"/>
<script>
window.onload = function () {
var api_url = 'https://cloud-api.yandex.net/v1/disk/public/resources'
var download_path = '/app/deflate/Mtgdb.Gui.zip'
var key = 'oZys52trJjEUJ9U7XSb4cKpduHKboapl4JvINZqbpIEC85CkM4GdTyqrS2JkBEt5q/J6bpmRyOJonT3VoXnDag=='
var get_link_url = api_url + '/download?public_key=' + key + '&path=' + download_path
var xhr = new XMLHttpRequest();
xhr.open('GET', get_link_url, true);
xhr.send();
function append_anchor(href, innerText, dlTarget) {
var a = document.createElement('a');
a.href = href;
if (dlTarget !== undefined) {
a.download = dlTarget;
}
a.innerText = innerText;
document.body.appendChild(a);
return a;
}
xhr.onreadystatechange = function () {
if (xhr.readyState !== 4) {
return;
}
if (xhr.status !== 200) {
append_anchor('https://disk.yandex.ru/d/vJ19nJ5n_omPxQ', 'Yandex.Disk page for downloading Mtgdb.Gui.zip')
return;
}
var link_model = JSON.parse(xhr.responseText);
var a = append_anchor(link_model.href, 'download', 'Mtgdb.Gui.zip');
a.click();
}
}
</script>
<title>Mtgdb.Gui download</title>
</head>
<body>
<h2>Mtgdb.Gui download page</h2>
<p>The download should begin automatically. If it doesn't, click download link below.</p>
</body>
</html>