Sadistic player replacer

目前為 2018-01-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name     Sadistic player replacer
// @description:pl  Skrypcik podmieniający nowy, chujowy player sadistica na wbudowany w nowsze przeglądarki player multimediów HTML5.
// @version  1
// @grant    none
// @include *sadistic.pl/*
// @require	https://code.jquery.com/jquery-3.2.1.min.js
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.13/jquery.mousewheel.min.js
// @namespace https://gf.qytechs.cn/users/120356
// ==/UserScript==

$( document ).ready( function() {
  
  players = $( '.player_embed' )
  
  scripts = players.children( 'script' )
  
  for( i = 0; i < scripts.length; i++ ) {
    start = scripts[ i ].text.search( 'file:"' ) + 6
    end = scripts[ i ].text.search( '.mp4' ) + 4
    link = scripts[ i ].text.slice( start, end )
    parent = players[ i ].parentElement
    $( parent ).append( "<video controls><source src='" + link + "' type='video/mp4'></video>" )
  }
  
  video = $( 'video' )
  video.css({
    'background': 'black',
    'width': '768px',
    'height': '432px',
  })
  
  video.mousewheel( function( e ) {
    
    w = parseInt( $( e.target ).css( 'width' ) )
    h = parseInt( $( e.target ).css( 'height' ) )
    x = e.offsetX
    y = e.offsetY
    
    if( x > w - 149 && x < w - 37 && y > h - 39 ) {
      e.preventDefault()
      vol = e.target.volume
      if( e.deltaY == 1 && vol < 1 ) e.target.volume = vol + .1
      if( e.deltaY == -1  && vol > 0 ) e.target.volume = vol - .1
    }
	})
  
  players.remove()
  
})

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址