m-team大图浏览

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

// ==UserScript==
// @name         m-team大图浏览
// @namespace    mteam
// @version      0.6.0-beta.9
// @description  种子列表/详情/演员列表 大图浏览。列表短视频预览,标题翻译。详情视频在线播放。
// @description  适配 2024.03 新版介面,由于全部要重新做,目前仅有列表页、演员大图功能
// @author       AfAn,Krad
// @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, e;
    t = window.history, e = t.pushState, t.pushState = function (n) {
        return "function" == typeof t.onpushstate && t.onpushstate({
            state: n
        }), e.apply(t, arguments)
    }, window.history.onpushstate = function (t) {
        setTimeout((function () {}), 0)
    };
    var n = {
            "/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-spin-container table thead tr th: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 r(1e3), n = document.querySelectorAll("div.ant-spin-container table tbody tr");
                        let t = +e.data.pageSize,
                            o = +e.data.total;
                        if (n.length == t) break;
                        if (o < t && n.length == o) break
                    }
                    n.forEach((async (t, n) => {
                        let img = t.querySelector("td:nth-of-type(2) img.torrent-list__thumbnail");
                        if(!img){
                            const td = t.querySelector("td:nth-of-type(2)");
                            img = document.createElement("img");
                            img.className='torrent-list__thumbnail';
                            td.append(img);
                        }
                        img.style.objectFit = 'contain';
                        img.style.height = 'auto';
                        img.style.width = 'auto';
                        img.style.maxWidth = '100%';
                        img.src = e.data.data[n].imageList[0];
                        img.addEventListener("click", (function (t) {
                            t.stopPropagation();
                            window.open(`https://kp.m-team.cc/detail/${e.data.data[n].id}`, "_blank");
                        }));
                    }))
                }(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-spin-container table thead tr th: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 && (await r(1e3), n = document.querySelectorAll("div.ant-spin-container table tbody tr"), n.length != e.data.list.length); t++);
                    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.list[n].id}`, "_blank")
                        })), t.querySelector("td:nth-of-type(2) div.ant-image-mask").remove()
                    }))
                }(t)
            }
        },
        o = XMLHttpRequest.prototype.send,
        i = XMLHttpRequest.prototype.open;

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