-
Notifications
You must be signed in to change notification settings - Fork 0
/
AMLA.js
60 lines (54 loc) · 2.11 KB
/
AMLA.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
52
53
54
55
56
57
58
59
60
// ==UserScript==
// @name Automatic Mediafire Link Archiver
// @namespace Zopolis4
// @description Automatically archives all mediafire links on pages you visit by sending them to ArchiveTeam.
// @version 1.1.0
// @match *
// @run-at document-start
// ==/UserScript==
(function() {
document.addEventListener("DOMContentLoaded", function() {
var url = location.href
if (location.hostname == "app.mediafire.com") {
url = encodeURI(decodeURI(location.href).replace(/(https?:\/\/)?app\.mediafire\.com\/?/, "https://www.mediafire.com/?"));
fetch("https://urls.ajay.app/api/submitURLs", {
method: "POST",
body: JSON.stringify({
urls: [ url ]
}),
headers: {
"Content-Type": "application/json"
}
});
console.log("Sent " + url + " To https://urls.ajay.app/");
}
if (location.hostname == "www.mediafire.com") {
fetch("https://urls.ajay.app/api/submitURLs", {
method: "POST",
body: JSON.stringify({
urls: [ url ]
}),
headers: {
"Content-Type": "application/json"
}
});
console.log("Sent " + url + " To https://urls.ajay.app/");
}
});
window.addEventListener("load", function() {
for (var elements1 = document.getElementsByTagName("a"), i = elements1.length - 1; i >= 0; i--) {
if (elements1[i].hostname == "www.mediafire.com" || elements1[i].hostname == "www.mfi.re") {
fetch("https://urls.ajay.app/api/submitURLs", {
method: "POST",
body: JSON.stringify({
urls: [ elements1[i].href ]
}),
headers: {
"Content-Type": "application/json"
}
});
console.log("Sent " + elements1[i].href + " To https://urls.ajay.app/");
}
}
});
}());