Scribd Auto Downloader by 3xploiton3

Otomatis input URL dokumen Scribd ke vDownloader dan unduh file PDF secara otomatis dalam 1 klik dari scribd.com

目前為 2025-08-14 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Scribd Auto Downloader by 3xploiton3
// @namespace    https://greasyfork.org/users/3xploiton3
// @version      1.1
// @description  Otomatis input URL dokumen Scribd ke vDownloader dan unduh file PDF secara otomatis dalam 1 klik dari scribd.com
// @author       3xploiton3
// @match        https://*.scribd.com/document/*
// @match        https://*.scribd.com/doc/*
// @match        https://scribd.vdownloaders.com/*
// @icon         https://scribd.vdownloaders.com/favicon.ico
// @license      MIT
// @run-at       document-end
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    const host = location.hostname;
    const path = location.pathname;

    // ====================================
    // 1. Tambahkan tombol di halaman Scribd
    // ====================================
    if (host.includes('scribd.com') && (path.includes('/document/') || path.includes('/doc/'))) {
        const currentURL = window.location.href;
        const vDownloadURL = `https://scribd.vdownloaders.com/?doc=${encodeURIComponent(currentURL)}`;

        const button = document.createElement('button');
        button.innerText = '⬇ Download via vDownloader';
        button.style.position = 'fixed';
        button.style.top = '80px';
        button.style.right = '20px';
        button.style.zIndex = '9999';
        button.style.padding = '10px 15px';
        button.style.backgroundColor = '#1a73e8';
        button.style.color = '#fff';
        button.style.border = 'none';
        button.style.borderRadius = '4px';
        button.style.cursor = 'pointer';
        button.style.fontSize = '14px';
        button.style.boxShadow = '0 2px 5px rgba(0,0,0,0.3)';

        button.onclick = () => {
            window.open(vDownloadURL, '_blank');
        };

        document.body.appendChild(button);
    }

    // ===================================================
    // 2. Auto-paste + auto-click "Get Download Now" button
    // ===================================================
    if (host === 'scribd.vdownloaders.com' && path === '/') {
        const params = new URLSearchParams(window.location.search);
        const docURL = params.get('doc');

        if (!docURL) return;

        const fillAndClick = () => {
            const input = document.querySelector('input[name="url"], #url');
            const button = document.querySelector('form button[type="submit"]');

            if (input && button) {
                input.value = docURL;

                // Simulate user input
                input.dispatchEvent(new Event('input', { bubbles: true }));
                input.dispatchEvent(new Event('change', { bubbles: true }));

                // Klik tombol setelah delay singkat
                setTimeout(() => {
                    button.click();
                    console.log("✅ Tombol 'Get Download Now' berhasil diklik.");
                }, 500);
            } else {
                // Retry sampai form tersedia
                setTimeout(fillAndClick, 500);
            }
        };

        fillAndClick();
    }

    // ================================
    // 3. Auto download setelah 11 detik
    // ================================
    if (host === 'scribd.vdownloaders.com' && path.startsWith('/vdoc')) {
        setTimeout(() => {
            const downloadBtn = document.querySelector('a.btn[href*="pdf"], a[href*="download"]');
            if (downloadBtn) {
                downloadBtn.click();
                console.log("✅ Tombol download PDF diklik otomatis.");
            } else {
                console.warn("⚠️ Tombol download PDF tidak ditemukan!");
            }
        }, 11000);
    }

})();