// ==UserScript== // @name 1Fichier Redirect to FastDebrid // @namespace https://violentmonkey.github.io/ // @version 1.1 // @description Save 1fichier link, redirect to FastDebrid and autofill the link. // @author Rust1667 // @match https://1fichier.com/* // @match https://fastdebrid.com/* // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Function to check if the Cloudflare captcha is solved function checkCloudflareCaptchaSolved() { if (document.querySelector('.cf-turnstile') || document.querySelector('#captcha-turnstile')) { return unsafeWindow.turnstile && unsafeWindow.turnstile.getResponse().length !== 0; } return true; } // On 1fichier page const currentUrl = window.location.href; if (currentUrl.includes('1fichier.com')) { GM_setValue('saved1FichierLink', currentUrl); window.location.assign('https://fastdebrid.com/'); // On FastDebrid page } else if (currentUrl === 'https://fastdebrid.com/') { window.addEventListener('load', function() { const fichierOption = document.querySelector('[data-name="1fichier"]'); if (fichierOption) { fichierOption.click(); } function fillForm() { const savedLink = GM_getValue('saved1FichierLink'); if (savedLink) { const inputField = document.querySelector('#link'); if (inputField) { inputField.value = savedLink; GM_deleteValue('saved1FichierLink'); } } } function clickDebridButton() { const debridButton = document.querySelector('button.btn-primary'); if (debridButton && debridButton.innerText.includes('Debrid my link')) { debridButton.click(); } } // Wait for cloudflare captcha to be solved to fill the form let captchaCheckInterval = setInterval(() => { if (checkCloudflareCaptchaSolved()) { clearInterval(captchaCheckInterval); fillForm(); clickDebridButton(); } }, 1000); }); // On fastdebrid page with link ready for download } else if (/https:\/\/fastdebrid.com\/.*/.test(currentUrl)) { window.location.assign(document.querySelector('a.btn-primary.mx-1').href); window.location.assign(document.querySelector('a.btn-success.mx-1').href); } })();