fc2ppvdb.com to Sukebei Search

Extract FC2PPV ID and search on Sukebei

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         fc2ppvdb.com to Sukebei Search
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Extract FC2PPV ID and search on Sukebei
// @match        https://fc2ppvdb.com/articles/*
// @match        https://db.javfc2.xyz/articles/*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {

    'use strict';


    // Fonction pour extraire l'ID FC2PPV

    function extraireFC2PPVID(url) {

        const correspondance = url.match(/\/articles\/(\d+)/);

        return correspondance ? correspondance[1] : null;

    }


    // Fonction pour générer l'URL de recherche

    function genererURLRecherche(id) {

        return `https://sukebei.nyaa.si/?f=0&c=0_0&q=${id}`;

    }


    // Fonction principale

    function principal() {

        // Vérifier si le bouton existe déjà

        if (document.querySelector('#sukebei-search-button')) {

            return; // Terminer si le bouton existe déjà

        }


        const urlActuelle = window.location.href;

        const idFC2PPV = extraireFC2PPVID(urlActuelle);


        if (idFC2PPV) {

            const urlRecherche = genererURLRecherche(idFC2PPV);



            // Chercher le lien de la vidéo d'exemple

            const lienVideoExemple = document.querySelector('a[href^="https://adult.contents.fc2.com/embed/"]');



            if (lienVideoExemple) {

                // Créer le bouton de recherche

                const boutonRecherche = document.createElement('a');

                boutonRecherche.id = 'sukebei-search-button'; // Ajouter un ID

                boutonRecherche.textContent = 'Sukebei';

                boutonRecherche.href = urlRecherche;

                boutonRecherche.target = '_blank';

                boutonRecherche.className = 'inline-flex items-center mt-2';

                boutonRecherche.style.color = '#2563eb'; // Texte bleu

                boutonRecherche.style.textDecoration = 'underline';


                // Ajouter l'icône SVG (même style que les liens existants)

                boutonRecherche.innerHTML += `

                    <svg class="w-4 h-4 ml-1" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 18 18">

                        <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 11v4.833A1.166 1.166 0 0 1 13.833 17H2.167A1.167 1.167 0 0 1 1 15.833V4.167A1.166 1.166 0 0 1 2.167 3h4.618m4.447-2H17v5.768M9.111 8.889l7.778-7.778"></path>

                    </svg>

                `;


                // Insérer le bouton après le lien de la vidéo d'exemple

                lienVideoExemple.parentNode.insertAdjacentElement('afterend', boutonRecherche);

            }

        }

    }


    // Observer les changements du DOM et exécuter la fonction principale lorsque de nouveaux contenus sont ajoutés

    const observateur = new MutationObserver((mutations) => {

        mutations.forEach((mutation) => {

            if (mutation.type === 'childList') {

                principal();

            }

        });

    });


    observateur.observe(document.body, { childList: true, subtree: true });


    // Exécution initiale

    principal();

})();