[精简版]JAV快速跳转到磁力下载&在线播放

Simplified JAV site navigation

// ==UserScript==
// @name         [精简版]JAV快速跳转到磁力下载&在线播放
// @version      1.6
// @description  Simplified JAV site navigation
// @license      GPL
// @match        *://*.javlibrary.com/*
// @match        *://*.javbus.com/*
// @require      https://cdn.jsdelivr.net/npm/jquery@4.0.0-beta.2/dist/jquery.min.js
// @connect      sukebei.nyaa.si
// @connect      jable.tv
// @connect      missav.com
// @connect      netflav.com
// @grant        GM_addStyle
// @namespace https://sleazyfork.org/zh-CN/scripts/428639-onejavoneweb
// ==/UserScript==

(() => {
    'use strict';

    // Simplified Configuration
    const jav_configuration = {
        javbus: 'https://www.javbus.com',
        javlibrary: 'https://www.javlibrary.com',
        magnet: 'https://sukebei.nyaa.si/',
        jable: 'https://jable.tv/videos/',
        missav: 'https://missav.com/',
        netflav: 'https://netflav.com/search?type=title&keyword='
    };

    // Basic Styles (Simplified)
    GM_addStyle(`.jav-table {font-family: sans-serif; font-size: 14px; background-color: #fff; border: 1px solid #ccc; padding: 5px; position: absolute; z-index: 9999;} .jav-link {display: block; margin-bottom: 3px; color: #337ab7;} .jav-link:hover {text-decoration: underline;}`);

    class JAV {
        constructor(i) {
            this.fanhao = i.trim().replace(/ +/, '-'); // Simplified fanhao handling
        }

        create_table() {
            const javbusLink = `${jav_configuration.javbus}/search/${this.fanhao}`;
            const javlibraryLink = `${jav_configuration.javlibrary}/cn/vl_searchbyid.php?keyword=${this.fanhao}`;
            const magnetLink = `${jav_configuration.magnet}/?f=0&c=0_0&q=${this.fanhao}`;
            const jableLink = `${jav_configuration.jable}${this.fanhao}/`;
            const missavLink = `${jav_configuration.missav}${this.fanhao}/`;
            const netflavLink = `${jav_configuration.netflav}${this.fanhao}`;

            return `<div class="jav-table">
                        <a class="jav-link" target="_blank" href="${javbusLink}">JavBus</a>
                        <a class="jav-link" target="_blank" href="${javlibraryLink}">JAVLibrary</a>
                        <a class="jav-link" target="_blank" href="${magnetLink}">Magnet Download</a>
                        <a class="jav-link" target="_blank" href="${jableLink}">Jable</a>
                        <a class="jav-link" target="_blank" href="${missavLink}">MissAV</a>
                        <a class="jav-link" target="_blank" href="${netflavLink}">NetFlav</a>
                    </div>`;
        }
    }

    // JavBus to JavLibrary and Magnet and others
    if ($('body div.container div.movie.row div.col-md-9.screencap')[0]) {
        $('body').on('mouseenter', 'div.container div.movie.row div.col-md-9.screencap', function () {
            const bango = $('body div.container h3').text().trim().split(' ')[0];
            const jav = new JAV(bango);
            $(this).prepend(jav.create_table());
        });
        $('body').on('mouseleave', 'div.container div.movie.row div.col-md-9.screencap', function () {
            $(this).find('.jav-table').remove();
        });
    }

    // JavLibrary to JavBus and Magnet and others
    if ($('body.main div#content div#rightcolumn table#video_jacket_info tbody tr td div#video_jacket')[0]) {
      $('body').on('mouseenter', '#video_jacket', function () {
          const bango = $('#video_title > h3').text().trim().split(' ')[0];
          const jav = new JAV(bango);
          $(this).prepend(jav.create_table());
      });
      $('body').on('mouseleave', '#video_jacket', function () {
          $(this).find('.jav-table').remove();
      });
    }
})();