TikTok AutoPlay & Next Video Web Browser

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

目前为 2025-03-10 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name TikTok AutoPlay & Next Video Web Browser
  3. // @namespace https://www.tiktok.com/
  4. // @version 0.5
  5. // @description Automatically plays TikTok videos and scrolls to the next one after it finishes.
  6. // @author MumuAlpaka
  7. // @match *://www.tiktok.com/*
  8. // @grant none
  9. // @run-at document-idle
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15.  
  16. function autoplayNextVideo() {
  17. const video = document.querySelector('video');
  18.  
  19. if (!video) return;
  20.  
  21. video.onended = () => {
  22. console.log('Video ended. Moving to next...');
  23. const nextButton = document.querySelector('[data-e2e="arrow-right"]');
  24.  
  25. if (nextButton) {
  26. nextButton.click(); // Click next video button
  27. } else {
  28. window.scrollBy(0, window.innerHeight); // Scroll down (alternative method)
  29. }
  30. };
  31. }
  32.  
  33. function waitForVideo() {
  34. const observer = new MutationObserver(() => {
  35. autoplayNextVideo();
  36. });
  37.  
  38. observer.observe(document.body, { childList: true, subtree: true });
  39. }
  40.  
  41. waitForVideo();
  42. })();

QingJ © 2025

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