Universal Video Ad Skip Tool

인터넷 사이트의 동영상 광고를 16배속으로 넘기고, SKIP 버튼이 활성화되면 자동으로 클릭합니다. (Greasy Fork 규정 준수 버전)

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         Universal Video Ad Skip Tool
// @namespace    https://greasyfork.org/users/your-id
// @version      1.1
// @description  인터넷 사이트의 동영상 광고를 16배속으로 넘기고, SKIP 버튼이 활성화되면 자동으로 클릭합니다. (Greasy Fork 규정 준수 버전)
// @author       You
// @match        *://*/*
// @exclude      *://www.youtube.com/*
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    /**
     * 광고 스킵 및 배속 처리 함수
     * 5초 강제 광고는 16배속으로 빠르게 통과시키고, 버튼은 즉시 클릭합니다.
     */
    const skipAdTask = () => {
        // 1. 모든 비디오 요소 검사
        const videos = document.querySelectorAll('video');
        videos.forEach(video => {
            // 광고 컨테이너(vjs-ad-playing 등) 내에 있는지 확인
            const isAd = video.closest('[class*="ad"], [id*="ad"], .vjs-ad-playing, .vjs-ad-container');
            
            if (isAd) {
                video.muted = true;      // 광고 소리 끄기
                video.playbackRate = 16; // 16배속 설정
                // 재생 시간이 확인되면 끝으로 강제 이동
                if (video.duration > 0 && isFinite(video.duration)) {
                    video.currentTime = video.duration;
                }
            }
        });

        // 2. 스킵 버튼 자동 클릭
        // 이미지 속 '4초 뒤 광고 SKIP' 버튼의 클래스와 텍스트를 추적합니다.
        const skipButtons = document.querySelectorAll('.vjs-ad-skip-button, [class*="skip"], button');
        skipButtons.forEach(btn => {
            const btnText = btn.innerText || "";
            // 버튼이 화면에 보이고 'SKIP' 또는 '스킵' 문구가 포함된 경우 클릭
            if ((btnText.toUpperCase().includes('SKIP') || btnText.includes('스킵')) && btn.offsetParent !== null) {
                btn.click();
            }
        });
    };

    // DOM 변화를 감시하여 실시간으로 광고가 삽입될 때 대응
    const observer = new MutationObserver(skipAdTask);
    observer.observe(document.body || document.documentElement, { 
        childList: true, 
        subtree: true 
    });

    // 초기 실행
    skipAdTask();
})();