SUPJAV Download

给SUPJAV作品详情页添加Sukebei搜索

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         SUPJAV Download
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  给SUPJAV作品详情页添加Sukebei搜索
// @author       Adam
// @match        *://supjav.com/*
// ==/UserScript==

(function() {
    'use strict';

    // thumb Image
    const FC2Num = GetFC2Num();
    if(FC2Num == 0)
        return;

    //SearchMagnet + Watch Online
    const sukebeiSearchURL = "https://sukebei.nyaa.si/?f=0&c=0_0&q=" + FC2Num;
    AddQuickLink();

    function GetFC2Num()
    {
        // Get the text content of the <h1> tag
        const titleText = document.querySelector('.archive-title h1').textContent;

        // Use a regular expression to find the number after "FC2PPV"
        const match = titleText.match(/FC2PPV (\d+)/);

        // Check if a match was found and log it
        if (match) {
            console.log("Extracted number:", match[1]);
            return match[1];
        } else {
            console.log("Number not found");
        }
    }

    function AddQuickLink()
    {
        // Get the parent div where we want to add the new link
        const downscaseDiv = document.querySelector('.downscase');

        if (downscaseDiv) {
            // Create a new <a> element
            const newLink = document.createElement('a');

            // Set the href, text content, and other attributes
            newLink.href = sukebeiSearchURL;
            newLink.className = 'btn-down';  // Add the same class as other links
            newLink.rel = 'nofollow';
            newLink.target = '_blank';
            newLink.textContent = 'Sukebei搜索';  // The text of the new link

            // Append the new <a> tag to the <div>
            downscaseDiv.appendChild(newLink);
        }
    }


})();