uyx-pro

将播放器替换为更强大的DPlayer,以支持弹幕、键盘控制和下载功能

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

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

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         uyx-pro
// @namespace    krytro.com
// @version      0.1
// @description  将播放器替换为更强大的DPlayer,以支持弹幕、键盘控制和下载功能
// @author       NitroFire
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/DPlayer.min.js
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js
// @include      https://apppc.uyxedu.com/*
// @license MIT
// @grant        none
// ==/UserScript==

(function() {
    'use strict'
    var dp = null
    setInterval(() => {
        if (!document.location.href.match('https://apppc.uyxedu.com/uycourse/detail')) {
            dp && dp.destroy()
            dp = null
            return
        }
        var video = $('.video-js video')
        if (video.length !== 0 && video.attr('src')) {
            var src = video.attr('src')
            $('.video-js').remove()
            dp = new DPlayer({
                container: $('.video-wrap')[0],
                screenshot: true,
                video: {
                    url: src,
                },
                playbackSpeed: [0.5, 0.75, 1, 1.25, 1.5, 2, 3],
                danmaku: {
                    id: 'uxy-pro-' + src.match(/[0-9a-f\-]{10,100}/)[0],
                    api: 'https://api.krytro.com:1443/dplayer/',
                },
                contextmenu: [
                    {
                        text: '原视频',
                        link: src,
                    }
                ]
            })
        }
    }, 100)
})();