SerienStream / AniWorld - Priority Hoster

Fügt einen Kommentar zu jedem Hoster hinzu mit Infos über die Kompatibilität zum Downloaden mit JDownloader 2

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         SerienStream / AniWorld - Priority Hoster
// @description  Fügt einen Kommentar zu jedem Hoster hinzu mit Infos über die Kompatibilität zum Downloaden mit JDownloader 2
// @namespace    https://github.com/M4RC-XX
// @version      2.7.1
// @author       M4RC-XX
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAMAAABEpIrGAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABhlBMVEU9mtgpaJI3jcY+nd0oZpA7l9Q4jcY+nd1Ao+VApOZDq/BErvRErfRErfNErPJDrPFDq/FErPFDqu9Dqu5Cqe1CqOxApuo/pelBpulCp+pCqOtCp+lltuxvuuxHpuU+ouVApOdot+vp9Pz3+/6/3/VqteY/oOE+o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CswMjowMKVVr8QAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTgtMDctMTBUMDA6Mzc6MzQrMDI6MDDUCBd4AAAAV3pUWHRSYXcgcHJvZmlsZSB0eXBlIGlwdGMAAHic4/IMCHFWKCjKT8vMSeVSAAMjCy5jCxMjE0uTFAMTIESANMNkAyOzVCDL2NTIxMzEHMQHy4BIoEouAOoXEXTyQjWVAAAAAElFTSuQmCC
// @match        https://*.to/*/stream/*/staffel-*/episode-*
// @grant        none
// @license      CC BY 4.0
// ==/UserScript==

(function() {
    'use strict';

    const hosterAnpassungen = {
        "Vidmoly": {
            buttonText: "🟡",
            hoverText: "Temporäre Probleme\nAnti-Bot-Erkennung!"
        },
        "Vidoza": {
            buttonText: "✅ 1st",
            hoverText: "Absolut perfekt!!"
        },
        "VOE": {
            buttonText: "✅ 2nd",
            hoverText: "Manchmal Probleme den Link zu finden!\nDateigröße erst beim Download bekannt"
        },
        "Doodstream": {
            buttonText: "✅ 3rd",
            hoverText: "Manchmal Probleme den Link zu finden!\nDateigröße erst beim Download bekannt\nGeringe Downloadgeschwindigkeit"
        },
        "Filemoon": {
            buttonText: "🟡",
            hoverText: "Kein Dateiname!"
        },
        "LoadX": {
            buttonText: "❌",
            hoverText: "Captcha!"
        },
    };

    function anpassenDerButtons() {
        // Optimierung 1: Nur nach Elementen suchen, die noch nicht bearbeitet wurden.
        const alleListeneintraege = document.querySelectorAll('li[data-link-id]:not([data-processed])');

        alleListeneintraege.forEach(eintrag => {
            const hosterIcon = eintrag.querySelector('i[title^="Hoster "]');
            if (!hosterIcon) {
                // Markieren, um nicht erneut zu prüfen, falls kein Icon gefunden wird.
                eintrag.dataset.processed = 'true';
                return;
            }

            const hosterName = hosterIcon.title.substring('Hoster '.length);
            const defektButton = eintrag.querySelector('.reportVideoStream');

            if (defektButton) {
                if (hosterAnpassungen.hasOwnProperty(hosterName)) {
                    const anpassung = hosterAnpassungen[hosterName];

                    // Optimierung 2: Button direkt bearbeiten statt ihn zu klonen.
                    defektButton.textContent = anpassung.buttonText;
                    defektButton.setAttribute('title', anpassung.hoverText);
                    defektButton.style.cursor = 'pointer';

                    const currentFontSize = window.getComputedStyle(defektButton).fontSize;
                    const newSize = parseFloat(currentFontSize) + 2;
                    defektButton.style.fontSize = `${newSize}px`;

                } else {
                    defektButton.parentElement.remove();
                }
            }
            // Den Eintrag als bearbeitet markieren.
            eintrag.dataset.processed = 'true';
        });
    }

    const observerCallback = (mutationsList, observer) => {
        // Die Verarbeitung wird nur ausgelöst, wenn tatsächlich neue Knoten hinzugefügt wurden.
        if (mutationsList.some(mutation => mutation.addedNodes.length > 0)) {
             anpassenDerButtons();
        }
    };

    const observer = new MutationObserver(observerCallback);

    // Einmal beim Start ausführen für bereits geladene Elemente.
    anpassenDerButtons();

    // Die Beobachtung starten.
    observer.observe(document.body, { childList: true, subtree: true });

})();