Greasy Fork is available in English.

Dyskusje » Propozycje stworzenia skryptu/stylu

filecr.com auto downloader

§
Napisano: 02-11-2024
Edytowano: 02-11-2024

I tried the following script as an autodownloader script for filecr.com
The script is meant for unattended / automatic initiation of downloads.

But, it didn't seem to work.


// ==UserScript==
// @name Auto Click Download Links on anygame.net (FileCR)
// @namespace https://greasyfork.org
// @version 1.0
// @description Automatically clicks links containing ai.net or ai.in on ai.com pages after they load
// @author Your Name
// @match https://anygame.net/*
// @grant none
// ==/UserScript==

(function() {
'use strict';

// Function to click on the links
function clickLinks() {
const links = document.querySelectorAll('a');
links.forEach(link => {
if (link.href.includes('download.xyz') || link.href.includes('filecr.xyz')) {
link.click();
}
});
}

// Create a MutationObserver to watch for new links
const observer = new MutationObserver(mutations => {
mutations.forEach(mutation => {
if (mutation.addedNodes.length) {
clickLinks(); // Click links whenever new nodes are added
}
});
});

// Start observing the document body for changes
observer.observe(document.body, {
childList: true,
subtree: true
});

// Optionally, also check for existing links right away
clickLinks();
})();

Odpowiedz

Zaloguj się, by odpowiedzieć.