Kufirc 大图

在Kufirc的torrent列表显示大图

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Kufirc 大图
// @namespace    Kufirc
// @version      2.0
// @description  在Kufirc的torrent列表显示大图
// @author       Ms Studio
// @match        https://kufirc.com/torrents.php*
// @match        https://kufirc.com/top10.php
// @icon         https://kufirc.com/favicon.ico
// @grant        GM_xmlhttpRequest
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';

    var torrents = function torrentlist(){
        $('tr.torrent').each(function(){
            $(this).find('td script').each(function(){
                var pattern = /src=([^>]+)>/;
                console.log($(this).html().match(pattern)[1])
                var imgsrc = $(this).html().match(pattern)[1].replace(/\\"/g, '').replace(/\/\//g,'/').replace(/(?!:)\\\//g,'/');
                //console.log(imgsrc);
                $(this).after('<td><img src="'+imgsrc+'" style="max-width:700px;height:auto;"></td>');
            });
        });
    };
    torrents();
})();