jav_preview

添加jav官方预览影片

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

// ==UserScript==
// @name        jav_preview
// @version     0.1.3
// @include     *://*javbus.com/*
// @include     *://*javdb*/*
// @include     *://*javlibrary*/*
// @description 添加jav官方预览影片
// @grant       none
// @namespace https://sleazyfork.org/users/232476
// ==/UserScript==

// 根据网站域名判断视频插入位置
const domain = window.location.hostname;
var javbus_domains = ["www.javbus.com", "www.javbus.icu", "www.dmmsee.icu", "www.busjav.icu"];
var javlibrary_domains = ["www.javlibrary.com", "m34z.com"];
var javdb_domains = ["javdb.com"];

var $position;

if (javbus_domains.indexOf(domain) != -1) {
    $position = document.querySelector('#mag-submit-show');
} else if (javlibrary_domains.indexOf(domain) != -1) {
    $position = document.querySelector('#video_favorite_edit');
} else if (javdb_domains.indexOf(domain) != -1) {
    $position = document.querySelector('.video-meta-panel');
}


if (!$position) return;

// 根据avid构建预览链接
const avid = document.title.replace(/([^-]+)-([^ ]+) .*/, '$1-$2');
const [prefix, number] = avid.split('-');
const firstLetter = prefix.charAt(0).toLowerCase();
const firstThreeLetters = prefix.substring(0, 3).toLowerCase();
const formattedNumber = number.padStart(5, '0');

// 构建预览链接
const previewLink = `https://cc3001.dmm.co.jp/litevideo/freepv/${firstLetter}/${firstThreeLetters}/${prefix.toLowerCase()}${formattedNumber}/${prefix.toLowerCase()}${formattedNumber}hhb.mp4`;

// 插入视频预览
const html = `<video id="jav_preview" style="position:relative; width: 640px; height: 360px; margin: 10px 0;" controls muted>
                <source src="${previewLink}" type="video/mp4">
              </video>`;
$position.insertAdjacentHTML('afterend', html);