TikTok AutoPlay & Next Video

Automatically plays TikTok videos and scrolls to the next one after it finishes.

// ==UserScript==
// @name         TikTok AutoPlay & Next Video
// @namespace    https://www.tiktok.com/
// @version      0.6
// @description  Automatically plays TikTok videos and scrolls to the next one after it finishes.
// @author       MumuAlpaka
// @match        *://www.tiktok.com/*
// @grant        none
// @run-at       document-idle
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function autoplayNextVideo() {
        const video = document.querySelector('video');

        if (!video) return;

        video.onended = () => {
            console.log('Video ended. Moving to next...');
            const nextButton = document.querySelector('[data-e2e="arrow-right"]');

            if (nextButton) {
                nextButton.click(); // Click next video button
            } else {
                window.scrollBy(0, window.innerHeight); // Scroll down (alternative method)
            }
        };
    }

    function waitForVideo() {
        const observer = new MutationObserver(() => {
            autoplayNextVideo();
        });

        observer.observe(document.body, { childList: true, subtree: true });
    }

    waitForVideo();
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址