// ==UserScript==
// @name vipVideos_skipAd
// @namespace vipVideos_skipAd-xinggsf
// @author xinggsf~gmail。com
// @description 油库、土逗 VIP免费看;配合ABP去视频广告;开启GPU加速
// @homepageURL https://greasyfork.org/scripts/8561
// updateURL https://greasyfork.org/scripts/8561.js
// @include http*
// @exclude http://v.qq.com/*
// @exclude http://www.dj92cc.com/*
// @exclude http://*.baidu.com/*
//芒果TV加速不了!反而加大CPU占用,芒果真垃圾
// @exclude http://www.hunantv.com/*
//全面支持音悦台HTML5播放,详见 https://greasyfork.org/scripts/14593
// @exclude http://*.yinyuetai.com/*
// exclude http://www.flv.tv/*
// @version 2015.12.20
// @encoding utf-8
// @grant unsafeWindow
// grant GM_openInTab
// @downloadURL none
// ==/UserScript==
/*
作者的话:经过实际测试,高版本chrome,如46+已经解决CSS3动画BUG了。
此BUG在脚本表现为在某些页面使其原有菜单、DIV浮动框显示不出来!
所以这样的BUG反馈请不要再提,升级浏览器才是正道!
吐糟二大浏览器:chrome的class功能很早就出来了,但实现很简单的箭头函数却
至今未有!firefox则相反,箭头函数和其它ES6功能早出来了,类功能却迟迟盼不来!
2015-12-14 iqiyi播放器升级,外链视频最高分辨率只支持到高清。建议到iqiyi.com观看
2015-12-13感谢饭友"吃饭好香"提供播放器空间;解决油库不能全屏的问题
2015-12-11用严格模式重构;使用ES6字符串模板、大幅使用本地变量let,const
2015-12-8更新油库播放器,可选择P1080分辨率;
彻底解决油库盗链问题;
解决NNAPI Flash不能播放的问题
2015-12-6增加对acfun.tv的油库、iqiyi外链支持
开启GPU硬件加速,如显卡不支持,换direct!参考了thunderhit的代码:
https://greasyfork.org/zh-CN/scripts/6479,但用定时器太低效了
doc.querySelectorAll('div') instanceof NodeList
bd.childNodes instanceof NodeList
true
bd.children instanceof NodeList == false
bd.children.constructor: HTMLCollection
*/
-function(doc, bd) {
"use strict";
let isEmbed, style = doc.createElement('style');
style.textContent = '@-webkit-keyframes gAnimatAct{from{opacity:0.99;}to{opacity:1;}}@keyframes gAnimatAct{from{opacity:0.99;}to{opacity:1;}}embed,object{animation:gAnimatAct 1ms;-webkit-animation:gAnimatAct 1ms;}';
doc.head.appendChild(style);
let PLAYER_URL = [
{
urls: [
/^http:\/\/static\.youku\.com\/.*?q?(?:play|load)er\w*\.swf/,
/^http:\/\/player\.youku\.com\/player\.php\/.*?sid\/(.*?)\/.*?v\.swf$/,
/^http:\/\/cdn\.aixifan\.com\/player\/cooperation\/AcFunXYouku\.swf/,
],
varsMatch: /VideoIDS=(\w+)/,
format: youkuFormat,
isProc: function(p, fv, src) {
//console.log('isProc func');
switch(true){
case doc.domain.endsWith('acfun.tv'):
fv = fv.match(/vid=(\w+)/);
fv && setPlayer(p, youkuFormat(fv[1]));
return !1;
case !doc.domain.endsWith('youku.com'):
fv = src.match(this.urls[1]) || src.match(this.varsMatch) || fv.match(this.varsMatch);
fv && ykOutsitePlayer(fv[1], p);
return !1;
default:
doc.addEventListener('DOMNodeInserted', function (ev) {
let e = ev.target;
if (/SCRIPT|IKUADAPTER/.test(e.tagName) ||
e.id === 'ikuadapter'
) ev.relatedNode.removeChild(e);
}, !1);
setTimeout(scrollTo(0, 99), 9);
//加入一个按钮
unsafeWindow._ssPlayer = p.outerHTML.replace('direct','gpu');
doc.querySelector("div#ab_pip").outerHTML =
'换原播放器';
return !0;
}
}
},{
urls: [/^http:\/\/js\.tudouui\.com\/.*?Player.*?\.swf/],
format: youkuFormat,
varsMatch: /vcode=([^&]+)/,
isProc: function(p, fv, src) {
if (!doc.domain.endsWith('tudou.com')) {
openFlashGPU(p);
}
return !1;
setTimeout(scrollTo(0, 99), 9);
//有播放时间限制即替换播放器
if (! /paidTime=\d{2,}&/.test(fv)) {
setObjectVal(p, 'wmode', 'gpu');
return !1;
}
var div = doc.querySelector("#summary>div:last-of-type");
div.innerHTML = '换原播放器';
div.style.display = 'block';
unsafeWindow.document.getElementById('a-rpPlayer')._ssPlayer = p.outerHTML.replace('direct','gpu');
return !0;
}
},{
urls: [
/^http:\/\/www\.iqiyi\.com\/common\/flashplayer\/\d+\/MainPlayer_\w+\.swf/,
/^http:\/\/cdn\.aixifan\.com\/player\/cooperation\/AcFunXQiyi\.swf/,
/^http:\/\/dispatcher\.video\.qiyi\.com\/disp\/shareplayer\.swf/,
],
run: function(p, src) {
var v = getFlashvars(p);
if (doc.domain.endsWith('iqiyi.com')){
v = v.replace(/&(?:cid|tipdataurl|\w+?Time|cpn\w|\w*?loader|adurl|yhls|exclusive|webEventID|videoIsFromQidan)=[^&]*/g,'') + '&cid=qc_100001_300089';
setPlayer(p, iqiyiFormat(src,v));
} else {
var tvid = v.match(/\btvId=(\w+)/i)[1],
definitionID = v.match(/\b(?:definitionID|sourceId|vid)=(\w+)/)[1];
setPlayer(p, `