JAV Library Sukebei Link

A a link to search on Sukebei from a JAV Library video.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         JAV Library Sukebei Link
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  A a link to search on Sukebei from a JAV Library video.
// @author       ReaperUnreal
// @match        https://*.javlibrary.com/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=javlibrary.com
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';

    const movieId = document.title.split(' ')[0];
    if (movieId.match(/\w{2,7}-\d{2,5}/).length < 1) {
        console.warn(`Movie '${movieId}' is not in appropriate format.`);
        return;
    }

    const searchUrl = `https://sukebei.nyaa.si/?f=0&c=0_0&q=${movieId.toLocaleLowerCase()}`;

    const videoInfoSection = document.getElementById('video_info');

    const linkSection = document.createElement('div');
    videoInfoSection.appendChild(linkSection);

    const link = document.createElement('a');
    linkSection.appendChild(link);

    link.href = searchUrl;
    link.innerText = 'Sukebei Link';
    link.style.paddingLeft = '2em';
    link.style.paddingTop = '1em';
})();