Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- javascript:
- /*InsertLinkFileInfo*/
- ((l, i, a) => {
- if (!document || !document.body || document.body.dataset.ilfi) return;
- document.body.dataset.ilfi = 1;
- if (!(l = document.querySelectorAll("A")).length) {
- delete document.body.dataset.ilfi;
- alert("No link found.");
- return
- }
- i = 0;
- (function pr(s, u) {
- while (a = l[i++]) {
- if (a.pathname.substr(-1) !== "/") {
- fetch(a.href, {method: "HEAD", redirect: "error", keepalive: true}).catch(e => {
- a.insertAdjacentHTML("afterend", ` [NetErr]`)
- pr()
- }).then((r, d) => {
- if (r.status < 400) {
- if (!isNaN(s = parseInt(r.headers.get("Content-Length")))) {
- if (s > 1023) {
- if ((s /= 1024) > 1023) {
- if ((s /= 1024) > 1023) {
- if ((s /= 1024) > 1023) {
- s = (s / 1024).toFixed(0) + "TB"
- } else s = s.toFixed(0) + "GB"
- } else s = s.toFixed(0) + "MB"
- } else s = s.toFixed(0) + "KB"
- }
- } else s = "???";
- if (d = r.headers.get("Last-Modified")) {
- s += ", " + (new Date(d)).toLocaleString()
- } else s+= ", ???";
- s = ` [${s}]`
- } else s = ` [Err${r.status}]`;
- a.insertAdjacentHTML("afterend", s);
- pr()
- });
- return
- }
- }
- delete document.body.dataset.ilfi
- })()
- })()
Add Comment
Please, Sign In to add comment