DataVaults - Auto download

Takes you to the actual download, auto-fills captcha, waits for timer, then auto-downloads the file.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         DataVaults - Auto download
// @version      05-18-26
// @description  Takes you to the actual download, auto-fills captcha, waits for timer, then auto-downloads the file.
// @author       WATCH_TEXHNOLYZE
// @match        https://datavaults.co/*
// @grant        none
// @namespace https://greasyfork.org/users/1122886
// ==/UserScript==

(function() {
'use strict';
function fillCaptcha() {
    const d=document.querySelector('td div[style*="background"]');
    if(!d) return;
    const s=d.querySelectorAll('span[style*="padding-left"]');
    if(!s.length) return;
    const a=[];
    s.forEach(e=>{
        const t=e.textContent.trim(),
              m=e.getAttribute('style').match(/padding-left\s*:\s*(\d+)px/);
        if(m && t.length===1) a.push({digit:t, pos:+m[1]});
    });
    a.sort((x,y)=> x.pos-y.pos);
    const c=a.map(x=>x.digit).join(''),
          i=document.querySelector('input.captcha_code[name="code"]');
    if(i&&c) i.value=c;
}
function clickIntermediate() {
    const b=document.getElementById('original');
    if(b) b.click();
}
function waitAndSubmit() {
    const b=document.getElementById('downloadbtn');
    if(!b) return;
    const t=setInterval(()=>{
        if(!b.disabled) {
            clearInterval(t);
            const f=document.querySelector('form[name="F1"]')||document.forms[0];
            if(f) f.submit();
        }
    },500);
}
function handle() {
    const i=document.querySelector('input.captcha_code[name="code"]');
    if(i) { fillCaptcha(); waitAndSubmit(); }
    else if(document.getElementById('original')) clickIntermediate();
}
handle();
new MutationObserver(handle).observe(document.body,{childList:true,subtree:true,attributes:true,attributeFilter:['style','class']});
})();