javdb预告片修复

预告片

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name            javdb预告片修复
// @namespace       javdb预告片修复
// @version         0.0.4
// @author          blc
// @license         轻肥不肥
// @description     预告片
// @match           https://javdb.com/*
// @icon            https://javdb.com/favicon.ico
// ==/UserScript==

(function() {
    'use strict';

    // 等待页面加载完成
    window.onload = function() {
        setTimeout(function() {
            // 找到所有视频标签
            var videos = document.querySelectorAll('video');

            // 遍历所有视频,修改链接
            videos.forEach(function(video) {
                var source = video.querySelector('source');
                if (source) {
                    var src = source.getAttribute('src');
                    if (src && src.includes('cc3001.dmm.co.jp')) {
                        // 修改src链接
                        var newSrc = src.replace('cc3001.dmm.co.jp', 'cc3001.dmm.com');
                        source.setAttribute('src', newSrc);
                        video.load(); // 重新加载视频
                        console.log('视频链接已修改:', src, '->', newSrc);
                    }
                }
            });
        }, 2000); // 延时1秒,确保页面完全加载
    };
})();