Greasy Fork

Greasy Fork is available in English.

TheTVDB Hide Non-Episodic Specials from All Seasons

Show only "Episodic Special" episodes on All Seasons pages on TheTVDB.com

当前为 2024-03-20 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         TheTVDB Hide Non-Episodic Specials from All Seasons
// @version      1.3
// @description  Show only "Episodic Special" episodes on All Seasons pages on TheTVDB.com
// @author       xdpirate
// @license      GPLv3
// @match        https://thetvdb.com/series/*/allseasons/*
// @match        https://www.thetvdb.com/series/*/allseasons/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=thetvdb.com
// @grant        none
// @namespace http://tampermonkey.net/
// ==/UserScript==

let labels = document.querySelectorAll("span.label-sunglow");
for(let i = 0; i < labels.length; i++) {
    let labelName = labels[i].innerText.trim();
    if(!labelName.includes("Episodic Special")) {
        labels[i].closest("li").style.display = "none";
    }
}

// Find unlabeled specials and hide them too
let episodeLabels = document.querySelectorAll("small.episode-label");
for(let i = 0; i < episodeLabels.length; i++) {
    if(episodeLabels[i].innerText.trim().startsWith("SPECIAL")) {
        if(!episodeLabels[i].parentElement.previousElementSibling) {
            episodeLabels[i].closest("li").style.display = "none";
        }
    }
}