m-team大图浏览

种子列表/详情/演员列表 大图浏览。列表短视频预览,标题翻译。详情视频在线播放。

// ==UserScript==
// @name         m-team大图浏览
// @namespace    mteam
// @version      0.6.0-beta.3
// @description  种子列表/详情/演员列表 大图浏览。列表短视频预览,标题翻译。详情视频在线播放。
// @description  适配 2024.03 新版介面,由于全部要重新做,目前仅有列表页、演员大图功能
// @author       AfAn
// @license      MIT
// @match        https://kp.m-team.cc/*
// @connect      translate.google.com
// @connect      api.avgle.com
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @grant        GM_getValue
// @grant        GM_setValue
// @grant        GM_notification
// @grant        GM_setClipboard
// @grant        GM_getResourceURL

// ==/UserScript==

(function() {
    "use strict";
    var t = {
            "/api/torrent/search": function (t) {
                !async function (t) {
                    if (0 !== window.location.href.indexOf("https://kp.m-team.cc/browse/adult")) return;
                    let e = JSON.parse(t);
                    if (!e || !("code" in e) || "0" != e.code) return !1;
                    document.querySelector("div.ant-table-wrapper table colgroup col:nth-of-type(2)").style.width = window.innerWidth >= 1400 ? "700px" : "500px", document.querySelector("div.app-content__inner div.mx-auto").style.maxWidth = "100%";
                    let n = [];
                    for (let t = 0; t < 30; t++) {
                        await o(1e3), n = document.querySelectorAll("div.ant-table-wrapper table tbody.ant-table-tbody tr.ant-table-row-level-0");
                        let t = +e.data.pageSize,
                            r = +e.data.total;
                        if (n.length == t) break;
                        if (r < t && n.length == r) break
                    }
                    n.forEach(((t, n) => {
                        t.querySelector("td:nth-of-type(2) img.torrent-list__thumbnail").style.height = "auto", t.querySelector("td:nth-of-type(2) img.torrent-list__thumbnail").addEventListener("click", (function (t) {
                            t.stopPropagation(), window.open(`https://kp.m-team.cc/detail/${e.data.data[n].id}`, "_blank")
                        })), t.querySelector("td:nth-of-type(2) div.ant-image-mask").remove();
                        const o = t.querySelector("td:nth-of-type(3)");
                        let r = o.querySelectorAll("span.ant-typography-single-line");
                        r[0].style.whiteSpace = "normal", r.length > 1 && (r[1].style.whiteSpace = "normal"), o.querySelector("div.ant-col").style.flex = "none", o.querySelector("div.ant-row").style.display = "block", o.querySelector("br") && o.querySelector("br").remove();
                        let a = o.querySelector("div.ant-col:first-child div:first-child");
                        a.classList.remove("inline-flex");
                        let i = a.querySelectorAll(":scope > *"),
                            l = document.createElement("div");
                        i.forEach(((t, e) => {
                            0 == e && "span" === t.tagName.toLowerCase() || l.appendChild(t)
                        })), a.appendChild(l)
                    }))
                }(t)
            },
            "/api/dmm/showcase/fetchList": function (t) {
                !async function (t) {
                    if (0 !== window.location.href.indexOf("https://kp.m-team.cc/showcaseDetail?id=")) return;
                    let e = JSON.parse(t);
                    if (!e || !("code" in e) || "0" != e.code) return !1;
                    document.querySelector("div.ant-table-wrapper table colgroup col:nth-of-type(3)").style.width = window.innerWidth >= 1400 ? "700px" : "500px", document.querySelector("div.app-content__inner div.mx-auto").style.maxWidth = "100%";
                    let n = [];
                    for (let t = 0; t < 30 && (await o(1e3), n = document.querySelectorAll("div.ant-table-wrapper table tbody.ant-table-tbody tr.ant-table-row-level-0"), n.length != e.data.list.length); t++);
                    n.forEach(((t, n) => {
                        t.querySelector("td:nth-of-type(3) img.torrent-list__thumbnail").style.height = "auto", t.querySelector("td:nth-of-type(3) img.torrent-list__thumbnail").addEventListener("click", (function (t) {
                            t.stopPropagation(), window.open(`https://kp.m-team.cc/detail/${e.data.list[n].id}`, "_blank")
                        })), t.querySelector("td:nth-of-type(3) div.ant-image-mask").remove()
                    }))
                }(t)
            }
        },
        e = XMLHttpRequest.prototype.send,
        n = XMLHttpRequest.prototype.open;

    function o(t) {
        return new Promise((e => setTimeout(e, t)))
    }
    XMLHttpRequest.prototype.open = function (t, e) {
        return this.url = e, n.apply(this, arguments)
    }, XMLHttpRequest.prototype.send = function () {
        return this.addEventListener("load", (function () {
            4 === this.readyState && 200 === this.status && Object.keys(t).forEach((e => {
                this.url.includes(e) && t[e](this.response)
            }))
        })), e.apply(this, arguments)
    }
})();