nyaa show

自动加载nyaa图片并显示!

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         nyaa show
// @namespace    http://tampermonkey.net/
// @version      0.4
// @description  自动加载nyaa图片并显示!
// @author       You
// @grant        GM_xmlhttpRequest
// @include      https://sukebei.nyaa.si/*
// @require https://cdn.staticfile.org/jquery/3.6.0/jquery.min.js
// ==/UserScript==
(function () {
    var a = document.getElementById("torrent-description");
    var patt1 = new RegExp("https://hentai-covers.site/image/[0-9a-zA-Z]*");
    if (patt1.test(a.innerHTML)) {
        var im = patt1.exec(a.innerHTML);
        GM_xmlhttpRequest({
            method: "GET",
            url: im[0],
            Referer: im[0],
            headers: {
                'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36',
                'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
            },
            onload: function (response) {
                var regex1 = new RegExp("https\:\/\/hentai\-covers\.site\/images\/[0-9]+\/[0-9]+\/[0-9]+\/[a-zA-Z0-9-_.]*.(jpg|webp)");
                var temp = regex1.exec(response.responseText);
                var board = document.getElementById("torrent-description");
                var img = document.createElement("img");
                GM_xmlhttpRequest({
                    method: "GET",
                    url: temp[0],
                    Referer:im[0],
                    responseType :'blob',
                    headers: {
                        'User-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36',
                        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
                        'Referer':im[0],
                    },
                    onload: function (response) {
                        if (this.status == 200) {
                            var blob = this.response
                            var link = window.URL.createObjectURL(blob)
                            img.src = link
                            img.onload = function() {
                                window.URL.revokeObjectURL(this.src);
                            }
                            board.appendChild(img)
                        }
                    }
                })


            }
        });
    }

})();