Auto Scroll for YouTube shorts + extra features

Auto Scroll, Also ignores SponsorBlock videos, right click gives immunity to move mouse. thumbs down auto scrolls to next video

2025/11/20のページです。最新版はこちら

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

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

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

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

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

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

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

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

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

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

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

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

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

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

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Auto Scroll for YouTube shorts + extra features
// @namespace    http://tampermonkey.net/
// @version      4.2
// @description  Auto Scroll, Also ignores SponsorBlock videos, right click gives immunity to move mouse. thumbs down auto scrolls to next video
// @author       Justn
// @match        https://www.youtube.com/shorts/*
// @grant        none
// @run-at       document-end
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    let mouseMoved = false;
    let isEnabled = true;
    let rightClickHeld = false;
    let lastX = 0;
    let lastY = 0;
    const MIN_MOVE = 12;

    const toggle = document.createElement('div');
    toggle.style.cssText = 'position:fixed;bottom:20px;right:20px;padding:0 18px;height:60px;border-radius:30px;background:#ff0000;color:white;font:bold 18px Arial;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:9999999;box-shadow:0 0 20px black;user-select:none;transition:all 0.3s;min-width:100px;';
    toggle.textContent = 'AUTO';
    toggle.title = 'Click to toggle auto-scroll';
    document.body.appendChild(toggle);

    const updateToggle = () => {
        if (!isEnabled) {
            toggle.style.background = '#666';
            toggle.textContent = 'OFF';
            toggle.style.color = 'white';
            toggle.style.textShadow = 'none';
        } else {
            toggle.style.background = '#ff0000';
            toggle.textContent = mouseMoved ? 'MANUAL' : 'AUTO';
            toggle.style.color = mouseMoved ? '#000000' : 'white';
            toggle.style.textShadow = mouseMoved ? '0 0 10px white' : 'none';
        }
    };
    updateToggle();

    toggle.onclick = () => {
        isEnabled = !isEnabled;
        mouseMoved = false;
        updateToggle();
    };

    const smashNext = () => {
        const btn = document.querySelector('button[aria-label="Next (shortcut: ↓)"]') || document.querySelector('button[aria-label*="Next"]');
        if (btn) btn.click();
    };

    const resetMouse = () => {
        if (!rightClickHeld) {
            mouseMoved = false;
            updateToggle();
        }
    };

    document.addEventListener('mousedown', e => {
        if (e.button === 2) {
            rightClickHeld = true;
            lastX = e.clientX;
            lastY = e.clientY;
        }
    });

    document.addEventListener('mouseup', e => {
        if (e.button === 2) {
            rightClickHeld = false;
            lastX = e.clientX;
            lastY = e.clientY;
        }
    });

    document.addEventListener('contextmenu', e => e.preventDefault());

    document.addEventListener('mousemove', e => {
        if (!isEnabled || rightClickHeld) return;

        const dx = Math.abs(e.clientX - lastX);
        const dy = Math.abs(e.clientY - lastY);
        if (dx >= MIN_MOVE || dy >= MIN_MOVE) {
            mouseMoved = true;
            updateToggle();
            lastX = e.clientX;
            lastY = e.clientY;
        }
    });

    document.addEventListener('click', e => {
        if (!isEnabled) return;
        const target = e.target.closest('button');
        if (target && target.getAttribute('aria-label') && target.getAttribute('aria-label').toLowerCase().includes('dislike')) {
            setTimeout(smashNext, 150);
        }
    });

    setInterval(() => {
        if (!isEnabled) return;
        if (document.querySelector('.ytp-sponsor-skip-button, .sbSkipButton, [data-sb-segment]')) {
            smashNext();
            return;
        }
        const video = document.querySelector('ytd-reel-video-renderer[is-active] video');
        if (!video || isNaN(video.duration)) return;
        if (video.currentTime < 0.5) resetMouse();
        if (video.currentTime >= video.duration - 0.2 && !mouseMoved) smashNext();
    }, 100);
})();