OpenSubtitles Countdown Bypass

Instantly skips the 10-second download countdown on opensubtitles.com

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

Advertisement:

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

Advertisement:

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         OpenSubtitles Countdown Bypass
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Instantly skips the 10-second download countdown on opensubtitles.com
// @author       You
// @match        https://www.opensubtitles.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==

(function() {
    'use strict';

    // Function to skip countdown and reveal download link
    function skipCountdown() {
        // Find the countdown clock element (id starts with "clock_")
        const clockDiv = document.querySelector('div[id^="clock_"]');
        if (!clockDiv) return;

        // Extract the numeric ID from the clock div
        const idMatch = clockDiv.id.match(/clock_(\d+)/);
        if (!idMatch) return;
        const dlId = idMatch[1];

        // Hide the clock/waiting div
        clockDiv.style.display = 'none';

        // Show the ready-to-download div
        const readyDiv = document.querySelector(`.download-ready_${dlId}`);
        if (readyDiv) {
            readyDiv.style.display = 'block';

            // Optionally auto-click the download link
            const downloadLink = readyDiv.querySelector('a[download]');
            if (downloadLink) {
                // Uncomment the line below to auto-start download:
                // downloadLink.click();
            }
        }
    }

    // Watch for download modals/popups appearing in the DOM
    const observer = new MutationObserver((mutations) => {
        for (const mutation of mutations) {
            if (mutation.addedNodes.length) {
                // Check if a download popup was added
                const popup = document.querySelector('.white-popup-block');
                if (popup && document.querySelector('div[id^="clock_"]')) {
                    skipCountdown();
                }
            }
        }
    });

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

    // Also check on initial page load (for pages where download is already visible)
    skipCountdown();

    // If countdown is handled via a JavaScript timer, try to intercept setInterval
    const originalSetInterval = window.setInterval;
    window.setInterval = function(callback, delay, ...args) {
        // If delay is around 1000ms (1 second) and we're on a download page
        if (delay === 1000 && document.querySelector('div[id^="clock_"]')) {
            // Speed up the timer animation but still let it fire
            const modifiedCallback = function() {
                skipCountdown();
                if (typeof callback === 'function') callback();
            };
            return originalSetInterval.call(window, modifiedCallback, 100, ...args);
        }
        return originalSetInterval.call(window, callback, delay, ...args);
    };
})();