Refresh Youtube Next Video in Playlist

When a video in a playlist ends and the next video starts, this refreshes the new video immediately as workaround to issue of some YouTube videos running into playback error and requires manual refresh.

目前为 2024-01-29 提交的版本。查看 最新版本

// ==UserScript==
// @name         Refresh Youtube Next Video in Playlist
// @namespace    http://tampermonkey.net/
// @description  When a video in a playlist ends and the next video starts, this refreshes the new video immediately as workaround to issue of some YouTube videos running into playback error and requires manual refresh.
// @version      2024-01-29
// @author       1000MilesAway
// @match        https://www.youtube.com/watch*
// @icon         https://banner2.cleanpng.com/20210611/tvj/transparent-refresh-icon-reload-icon-creative-outlines-icon-60c2e81fd1a1a6.5252411116233861438587.jpg
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    let checkID = localStorage.getItem('checkID') || null;

    setInterval(() => {
        const videoID = new URLSearchParams(window.location.search).get('v');
        if (videoID !== checkID) {
            checkID = videoID;
            localStorage.setItem('checkID', checkID);
            setTimeout(() => {
                location.reload();
            }, 500);
        }
    }, 3000);
})();

QingJ © 2025

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