Greasy Fork

Greasy Fork is available in English.

爱恋动漫BT下载快速获取磁链 只需双击特征码即可

爱恋脚本快速获取磁链 只需要双击特征码即可

目前为 2022-08-19 提交的版本,查看 最新版本

// ==UserScript==
// @name         爱恋动漫BT下载快速获取磁链 只需双击特征码即可
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  爱恋脚本快速获取磁链 只需要双击特征码即可
// @author       __Kirie__
// @match        https://www.kisssub.org/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=kisssub.org
// @require      https://cdn.staticfile.org/jquery/3.5.0/jquery.min.js
// @grant        GM_xmlhttpRequest
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    // Your code here...
    const log = console.log;




    $('#text_hash_id').on('dblclick',function() {
        var oldtext = $('#text_hash_id').text();

        var fcreg = /(?<=特征码:).*/;
        var fcode = oldtext.match(fcreg);
        // log(fcode);
        if(fcode != null) {
            $('#text_hash_id').text(',正在查询磁链请稍等一会儿 马上就好...');
            fc(fcode[0]).then(function(value){$('#text_hash_id').text(`,磁链🐎:${value}`);});
        }
    });

    async function fc(featureCode) {
        var newurl = 'https://www.kisssub.org/search.php?keyword=' + featureCode;
        return new Promise(function (resolve, reject) {
            GM_xmlhttpRequest({
                method: 'GET',
                url: newurl,
                onload: function (res) {
                    if (res.status == 200) {
                        var parse = new DOMParser();
                        var doc = parse.parseFromString(res.response, 'text/html');
                        var btm = doc.querySelector('#btm');
                        var magnet = $(btm).find('.main').find('.content').text();
                        resolve(magnet);
                        // log($(btm).find('.main').find('.content').text());
                    } else {
                        // log(res);
                    }
                },
                onerror: function (err) {
                    log(err);
                }
            });
        });


    }


    // fc('093d790ad7bd1f2340dc7dd6b39e3cab06539978').then(function(value) {log('success');log(value);});

})();