UserScripts icon indicating copy to clipboard operation
UserScripts copied to clipboard

求适配bt4g

Open bmtttt opened this issue 1 year ago • 6 comments

The url of site The example urls of site. Do not paste only domain without pathname. https://bt4gprx.com/ Is your request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 快速提取磁力链接 Describe the result you'd like with the rule A clear and concise description of what you want to happen. 搜索内容后,搜索结果的链接【magnet/】后为磁力内容 Custom rule you've tried The rule you've made before.

Additional context Add any other context or screenshots about the feature request here.


提前祝大佬春节玉快

bmtttt avatar Feb 06 '24 19:02 bmtttt

同祝春节快乐,是说的哪个脚本?

hoothin avatar Feb 07 '24 01:02 hoothin

同祝春节快乐,是说的哪个脚本?

全載

bmtttt avatar Feb 07 '24 09:02 bmtttt

magnet 后面似乎不是磁链 hash,点进去之后的 hash 后面才是。 可以用这个油猴脚本来替换内页的磁链

// ==UserScript==
// @name         BT4G
// @namespace    hoothin
// @version      2024-02-07
// @description  BT4G
// @author       You
// @match        https://bt4gprx.com/magnet/*
// @grant        none
// @run-at       document-body
// ==/UserScript==

(function() {
    'use strict';
    const magnetImg = document.querySelector(`img[src="/static/img/magnet.png"]`);
    if (!magnetImg) return;
    const magnetLink = magnetImg.parentNode;
    magnetLink.href = magnetLink.href.replace(/.*\/hash\/(.*)\?name=(.*)/, "magnet:?xt=urn:btih:$1&dn=$2&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Ftracker.auctor.tv%3A6969%2Fannounce&tr=udp%3A%2F%2Fopentracker.i2p.rocks%3A6969%2Fannounce&tr=https%3A%2F%2Fopentracker.i2p.rocks%3A443%2Fannounce&tr=udp%3A%2F%2Fopen.demonii.com%3A1337%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce&tr=udp%3A%2F%2Ftracker.moeking.me%3A6969%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Fexplodie.org%3A6969%2Fannounce&tr=udp%3A%2F%2Fuploads.gamecoast.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.skyts.net%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.cubonegro.lol%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker-udp.gbitt.info%3A80%2Fannounce&tr=udp%3A%2F%2Fopentracker.io%3A6969%2Fannounce&tr=udp%3A%2F%2Fopen.tracker.ink%3A6969%2Fannounce&tr=udp%3A%2F%2Fnew-line.net%3A6969%2Fannounce&tr=udp%3A%2F%2Fmovies.zsw.ca%3A6969%2Fannounce&tr=udp%3A%2F%2Fbt.ktrackers.com%3A6666%2Fannounce&tr=https%3A%2F%2Ftracker.tamersunion.org%3A443%2Fannounce&tr=https%3A%2F%2Ftracker.bt4g.com%3A443%2Fannounce");
})();

hoothin avatar Feb 07 '24 09:02 hoothin

感谢 这个能适配一下不,https://btsow.motorcycles/ ,上面那个记错了,这个是网址直接是磁力

bmtttt avatar Feb 07 '24 10:02 bmtttt

// ==UserScript==
// @name         BTSOW
// @namespace    hoothin
// @version      2024-02-07
// @description  BT4G
// @author       You
// @match        https://btsow.motorcycles/search/*
// @grant        none
// @run-at       document-body
// ==/UserScript==

(function() {
    'use strict';
    [].forEach.call(document.querySelectorAll(`.row>a`), link => {
        const magnetLink = document.createElement("a");
        magnetLink.innerText = "🧲";
        magnetLink.style.cssText = "float: left; top: -25px; position: relative; left: -10px; margin-bottom: -25px;";
        magnetLink.href = link.href.replace(/.*\/hash\/(.*)/, "magnet:?xt=urn:btih:$1");
        link.parentNode.appendChild(magnetLink);
    });
})();

hoothin avatar Feb 07 '24 11:02 hoothin

感谢大佬,在新的一年事事顺利

bmtttt avatar Feb 11 '24 12:02 bmtttt