飞猫云 AutoClick

feimaoyun AutoClick

// ==UserScript==
// @name               飞猫云 AutoClick
// @namespace          飞猫云 AutoClick
// @description        feimaoyun AutoClick
// @description:zh-cn  飞猫云 AutoClick
// @copyright          DandyClubs
// @version            1.2
// @include            https://www.feimaoyun.com/*
// @run-at             document-end
// ==/UserScript==

document.cookie = "fmdck=0";
document.cookie = "down_file_log=0";
var btn = document.querySelector('p.comdown');
var notice = document.querySelector('.el-notification');
var checkurl = document.location.href;
var btn2click = false;

if(/\/s\//.test(checkurl)){
    var clickbtntimer = setInterval(function () {
        if(!notice){
            btn.click();
            clearInterval(clickbtntimer);
        }
    }, 1000);
}

function clickbtn2() {
    var newbtn2 = document.querySelector('span.item3');
    var newgeetest = document.querySelector('.geetest_panel_next');
    var clicktimer = setInterval(function () {
        if(newbtn2){
            if(!newgeetest && !btn2click){
                newbtn2.click();
                btn2click = true;
            }
            else if (newgeetest) {
                clearInterval(clicktimer);
                observer.disconnect();
            }
        }
    }, 1000);
}
// Select the node that will be observed for mutations
const targetNode = document.querySelector('.main-body');

// Options for the observer (which mutations to observe)
const config = { attributes: true, childList: true, subtree: true };

// Callback function to execute when mutations are observed
const callback = function(mutationsList, observer) {
    for(let mutation of mutationsList) {
        clickbtn2();
    }
};

// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback);

// Start observing the target node for configured mutations
observer.observe(targetNode, config);

// Later, you can stop observing
//observer.disconnect();