Jutsu +

Наведитесь на кнопку серии чтобы посмотреть названия и кадр, Автоматический пропуст интро и переключение на следующий эпизод

当前为 2025-05-23 提交的版本,查看 最新版本

// ==UserScript==
// @name         Jutsu +
// @namespace    
// @version      1.0
// @author       diorhc
// @description  Наведитесь на кнопку серии чтобы посмотреть названия и кадр, Автоматический пропуст интро и переключение на следующий эпизод
// @description:en  Hover over the series button to see the titles and frame - auto skip, intro and switch to the next episode on Jut.su
// @match        https://jut.su/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=jut.su
// @grant        none
// ==/UserScript==
(function() {
    'use strict';
 
    // Helper function to click the "Skip Intro" button
    function clickSkipIntroButton() {
        const skipButton = document.querySelector('.vjs-overlay-skip-intro');
        if (skipButton && !skipButton.classList.contains('vjs-hidden')) {
            skipButton.click();
        }
    }
 
    // Helper function to click the "Next Episode" button
    function clickNextEpisodeButton() {
        const nextEpisodeButton = document.querySelector('.vjs-overlay-bottom-right.vjs-overlay-skip-intro');
        if (nextEpisodeButton && !nextEpisodeButton.classList.contains('vjs-hidden')) {
            nextEpisodeButton.click();
        }
    }
 
    // Monitor the DOM for the "Skip Intro" and "Next Episode" buttons and click them if found
    const observer = new MutationObserver(() => {
        clickSkipIntroButton();
        clickNextEpisodeButton();
    });
 
    observer.observe(document.body, { childList: true, subtree: true });
 
    // Automatically navigate to the next episode after the current one ends
    const video = document.querySelector('video');
    if (video) {
        video.addEventListener('ended', () => {
            const nextEpisodeButton = document.querySelector('.vnright a');
            if (nextEpisodeButton) {
                window.location.href = nextEpisodeButton.href;
            }
        });
    }
})();

setTimeout(() => {
    let style = document.createElement('style');
    style.innerHTML = `
    #prevbox{
    margin-top: 55px;
    margin-left: -163px;
}
#prevbox > div{
    border-radius: 0 0 5px 5px;
    top: 10px;
    padding: 3px 14px;
    background-color: #363a37;
    min-height: max-content;
    border-top: 1px solid #505550;
}
#prevbox::before{
    left:-5px;
}
#prevbox::after{
    right: -5px;
}
#prevbox::after,
#prevbox::before{
    content: "" !important;
    display: inline-block;
    position: absolute;
    margin-top: -10px;
    top:5px;
    height: 10px;
    width: 10px;
    border-radius: 100%;
    border: 1px solid #666b66;
    background-color: #363a37;
}

        #prevbox > img{
            background: url(https://i.imgur.com/DLLjUig.png) center no-repeat rgb(54, 58, 55);
        }
        #prevbox{
            display: none;
            width: 200px;
            height: auto;
            position: absolute;
            z-index: 9999;
            opacity: 0;
            transition: all 0.2s ease 0s;
            box-shadow: black 0px 0px 15px;
            border-radius: 5px;
            border: 2px solid rgba(102, 107, 102, 0.8);
            text-align: center;
        }`
    document.head.append(style);
    const linkElements = document.querySelectorAll(`#dle-content > div > div:nth-child(2) > a[href*='${window.location.pathname}']`);

    linkElements.forEach(linkElement => {
        let timeoutId = null;
        let timeoutId2 = null;
        let prevbox = document.createElement('div');
        const imgElement = document.createElement('img');
        const nameBox = document.createElement('div');
        const nameElement = document.createElement('span');
        nameBox.append(nameElement);

        prevbox.id = "prevbox";
        imgElement.style.width = '200px';
        imgElement.style.height = '112.5px';


        let loaded = false;

        if (localStorage[linkElement.href] && localStorage[linkElement.href + "name"]) {
            loaded = true;
            imgElement.src = localStorage[linkElement.href];
            nameElement.innerText = localStorage[linkElement.href + "name"];

            prevbox.prepend(nameBox);
            prevbox.prepend(imgElement);
            linkElement.insertAdjacentElement('afterend', prevbox);
        }
        linkElement.addEventListener('mouseenter', () => {
            clearTimeout(timeoutId);
            clearTimeout(timeoutId2);

            timeoutId = setTimeout(() => {
                if (!loaded) {
                    loaded = true;
                    fetch(linkElement.href)
                        .then(response => response.arrayBuffer())
                        .then(buffer => {
                            prevbox.prepend(nameBox);
                            prevbox.prepend(imgElement);
                            linkElement.insertAdjacentElement('afterend', prevbox);
                            let html = new TextDecoder('windows-1251').decode(buffer);
                            const doc = document.createElement("div");
                            doc.innerHTML = html;
                            const imgMeta = doc.querySelector(`meta[property="og:image"]`);
                            const imgUrl = imgMeta ? imgMeta.content : '';
                            const titleElement = doc.querySelector("#dle-content div.video_plate_title h2");
                            const nameText = titleElement ? titleElement.innerHTML : '';
                            nameElement.innerText = nameText;
                            localStorage[linkElement.href + "name"] = nameText;
                            imgElement.src = imgUrl;

                            localStorage[linkElement.href] = imgUrl;
                        })
                        .catch(error => {
                            loaded = false;
                            console.error(error);
                        });
                }
                prevbox.style.opacity = '0';
                prevbox.style.display = "unset";
            }, 200);
            timeoutId2 = setTimeout(() => {
                prevbox.style.opacity = '1';
            }, 500)

        });

        linkElement.addEventListener('mouseleave', () => {
            clearTimeout(timeoutId);
            clearTimeout(timeoutId2);
            prevbox.style.opacity = '0';
            setTimeout(() => {
                prevbox.style.display = "none";
            }, 200)
        });
    });
}, 1000);

QingJ © 2025

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