1
1
5
เก็บรวบรวม
รายงาน
แบ่งปัน
HTML5播放工具脚本
ไฟล์ปฏิบัติการที่กล่าวถึงในบทความนี้อาจต้องใช้ปลั๊กอินจำลอง ons เพื่อทำงานบนอุปกรณ์มือถือ (Android, iOS, HarmonyOS ฯลฯ) หรือแพลตฟอร์มอื่น หากจำเป็น กรุณาดาวน์โหลดปลั๊กอินหรือฟีเจอร์ที่ต้องการจากมินิโปรแกรมปลั๊กอินทั่วไปในแอป VikACG
// ==UserScript==
// @name 视频网HTML5播放小工具
//@description 需要配合油猴插件使用
// @homepage เว็บลิงค์(bbs.kafan.cn)
// @include เว็บลิงค์(*.qq.com)
// @exclude เว็บลิงค์(user.qzone.qq.com)
// @include เว็บลิงค์(www.weiyun.com)
// @include เว็บลิงค์(www.youku.com)
// @include เว็บลิงค์(v.youku.com)
// @include เว็บลิงค์(vku.youku.com)
// @include เว็บลิงค์(video.tudou.com)
// @include เว็บลิงค์(www.bilibili.com)
// @include เว็บลิงค์(www.acfun.cn)
// @include เว็บลิงค์(v.pptv.com)
// @include เว็บลิงค์(tv.sohu.com)
// @include เว็บลิงค์(film.sohu.com)
// @include เว็บลิงค์(www.mgtv.com)
// @include *://เว็บลิงค์(www.fun.tv)
// @include *://เว็บลิงค์(m.fun.tv)
// @include *://*.mtime.com/*
// @include *://เว็บลิงค์(www.miaopai.com)
// @version 1.5.3
// @include *://*.163.com/*
// @include *://*.icourse163.org/*
// @include *://*.sina.com.cn/*
// @include *://เว็บลิงค์(video.sina.cn)
// @include *://เว็บลิงค์(weibo.com)
// @include *://*.weibo.com/*
// @include เว็บลิงค์(pan.baidu.com)
// @include เว็บลิงค์(yun.baidu.com)
// @include *://เว็บลิงค์(v.yinyuetai.com)
// @include *://เว็บลิงค์(v.yinyuetai.com)
// @include *://เว็บลิงค์(www.365yg.com)
// @include *://เว็บลิงค์(v.ifeng.com)
// @GM_info
// @include เว็บลิงค์(www.youtube.com)
// @include เว็บลิงค์(www.ted.com)
// @noframes
// @include *://เว็บลิงค์(www.yy.com)
// @include *://เว็บลิงค์(v.huya.com)
// @include เว็บลิงค์(www.huya.com)
// @include เว็บลิงค์(v.douyu.com)
// @include เว็บลิงค์(www.douyu.com)
// @include *://เว็บลิงค์(star.longzhu.com)
// @include เว็บลิงค์(www.zhanqi.tv)
// @include เว็บลิงค์(www.yunbtv.com)
// @include เว็บลิงค์(www.dililitv.com)
// @include เว็บลิงค์(www.dililitv.com)
// @include เว็บลิงค์(www.vtuapp.com)
// @include เว็บลิงค์(www.66s.cc)
// @grant unsafeWindow
// @grant GM_addStyle
// @grant GM_registerMenuCommand
// @grant GM_setValue
// @grant GM_getValue
// @run-at document-start
// @namespace เว็บลิงค์(greasyfork.org)
// ==/UserScript==
'use strict';
const isEdge = เว็บลิงค์(navigator.useragent.includes)('Edge');
const w = isEdge ? window : unsafeWindow;
const observeOpt = {childList : true, subtree : true};
const q = (css, p = document) => เว็บลิงค์(p.queryselector)(css);
const delElem = e => เว็บลิงค์(e.remove)();
const $$ = (c, cb = delElem, doc = document) => {
if (!c || !เว็บลิงค์(c.length)) return;
if (typeof c === 'string') c = เว็บลิงค์(doc.queryselectorall)(c);
if (!cb) return c;
for (let e of c) {
if (e && cb(e)===false) break;
}
};
const gmFuncOfCheckMenu = (title, saveName, defaultVal = true) => {
const r = GM_getValue(saveName, defaultVal);
if (r) title += ' √';
GM_registerMenuCommand(title, () => {
GM_setValue(saveName, !r);
เว็บลิงค์(location.reload)();
});
return r;
};
const r1 = (regp, s) => เว็บลิงค์(regp.test)(s) && RegExp.$1;
const log = เว็บลิงค์(console.log.bind)(console, '%c脚本[%s] 反馈:%sn%s', 'color:#c3c;font-size:1.5em',
GM_info.script.name, GM_info.script.homepage);
const sleep = ms => new Promise(resolve => {
setTimeout(resolve, ms);
});
const getStyle = (o, s) => {
if (เว็บลิงค์(o.style)[s]) return เว็บลิงค์(o.style)[s];
if (getComputedStyle) {//DOM
var x = getComputedStyle(o, '');
//s = เว็บลิงค์(s.replace)(/([A-Z])/g,'-$1').toLowerCase();
return x && เว็บลิงค์(x.getpropertyvalue)(s);
}
};
const doClick = e => {
if (typeof e === 'string') e = q(e);
if (e) { เว็บลิงค์(e.click) ? เว็บลิงค์(e.click)() : เว็บลิงค์(e.dispatchevent)(new MouseEvent('click')) };
};
const firefoxVer = r1(/Firefox/(d+)/, เว็บลิงค์(navigator.useragent));
const fakeUA = ua => เว็บลิงค์(object.defineproperty)(navigator, 'userAgent', {
value: ua,
writable: false,
configurable: false,
enumerable: true
});
const getMainDomain = host => {
const re = /com|tv|net|org|gov|edu/;
const a = เว็บลิงค์(host.split)('.');
let i = เว็บลิงค์(a.length) - 2;
if (เว็บลิงค์(re.test)(a[i])) i--;
return a[i];
};
const ua_chrome = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3626.121 Safari/537.36';
const ua_ipad2 = 'Mozilla/5.0 (iPad; CPU OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3';
class FullScreen {
constructor(video) {
this._video = video;
const d = document, e = video;
this._exitFn = เว็บลิงค์(d.exitfullscreen) || เว็บลิงค์(d.webkitexitfullscreen) || เว็บลิงค์(d.mozcancelfullscreen) || เว็บลิงค์(d.msexitfullscreen);
this._enterFn = เว็บลิงค์(e.requestfullscreen) || เว็บลิงค์(e.webkitrequestfullscreen) || เว็บลิงค์(e.mozrequestfullscreen) || เว็บลิงค์(e.msrequestfullscreen);
}
static isFull() {
const d = document;
return !!(เว็บลิงค์(d.fullscreen) || เว็บลิงค์(d.webkitisfullscreen) || เว็บลิงค์(d.mozfullscreen) ||
เว็บลิงค์(d.fullscreenelement) || เว็บลิงค์(d.webkitfullscreenelement) || เว็บลิงค์(d.mozfullscreenelement));
}
enter() {
this._enterFn && this._enterFn.call(this._video);
}
exit() {
this._exitFn && this._exitFn.call(document);
}
toggle() {
เว็บลิงค์(fullscreen.isfull)() ? เว็บลิงค์(this.exit)() : เว็บลิงค์(this.enter)();
}
}
//万能网页全屏, CSS代码参考了:เว็บลิงค์(github.com)
class FullPage {
constructor(video, isFixView, onSwitch) {
this._video = video;
this._isFixView = isFixView;
this._isFull = !1;
this._onSwitch = onSwitch;
this._rects = new Map();
this._checkContainer();
GM_addStyle(
`.z-top {
position: relative !important;
z-index: 23333333 !important;
}
.webfullscreen {
display: block !important;
position: fixed !important;
width: 100% !important;
height: 100% !important;
top: 0 !important;
left: 0 !important;
background: #000 !important;
z-index: 23333333 !important;
}`
);
}
getPlayerContainer(video) {
let e = video, p = เว็บลิงค์(e.parentnode);
const { clientWidth: wid, clientHeight: h } = e;
for (;;) {
this._rects.set(e, {
width: เว็บลิงค์(e.clientwidth) + 'px',
height: เว็บลิงค์(e.clientheight) + 'px'
});
if (เว็บลิงค์(e.style.maxwidth)) เว็บลิงค์(e.style.maxwidth) = '100%';
if (เว็บลิงค์(e.style.maxheight)) เว็บลิงค์(e.style.maxheight) = '100%';
if (p==เว็บลิงค์(document.body) || เว็บลิงค์(p.clientwidth)-wid >3 || เว็บลิงค์(p.clientheight)-h >3) return e;
e = p;
p = เว็บลิงค์(e.parentnode);
}
}
_checkContainer() {
const c = this._container, e = this._video;
if (!c || c === e) this._container = เว็บลิงค์(this.getplayercontainer)(e);
}
get container() {
this._checkContainer();
return this._container;
}
fixView() {
if (!this._isFixView && !this._isFull) return;
if (this._video === this._container) return;
for (let [e, v] of this._rects) {
if (this._isFull) {
เว็บลิงค์(e.style.width) = เว็บลิงค์(e.style.height) = '100%';
} else {
เว็บลิงค์(e.style.width) = เว็บลิงค์(v.width);
เว็บลิงค์(e.style.height) = เว็บลิงค์(v.height);
}
}
}
static isFull(e) {
return เว็บลิงค์(w.innerwidth) - เว็บลิงค์(e.clientwidth) <5 && เว็บลิงค์(w.innerheight) - เว็บลิงค์(e.clientheight) <5;
}
toggle() {
const cb = this._onSwitch;
if (!this._isFull && cb) cb(true);
const d = เว็บลิงค์(document.body);
เว็บลิงค์(d.style.overflow) = this._isFull ? '' : 'hidden';
เว็บลิงค์(this.container.classlist.toggle)('webfullscreen');
let p = เว็บลิงค์(this.container.parentnode);
while (p !== d) {
เว็บลิงค์(p.classlist.toggle)('z-top');
p = เว็บลิงค์(p.parentnode);
}
this._isFull = !this._isFull;
setTimeout(เว็บลิงค์(this.fixview.bind)(this), 9);
if (!this._isFull && cb) setTimeout(cb, 199, !1);
}
}
let v, _fp, _fs;
const { host, pathname: path } = location;
const u = getMainDomain(host);
const events = {
on(name, fn) {
this[name] = fn;
}
};
const app = {
isLive: !1,
disableSpace: !1,
multipleV: !1, //单页面多视频
isFixFPView: !1, //退出网页全屏时是否修正DOM视图
checkMVVisible() {
if (เว็บลิงค์(this.vlist.length) < 2 || เว็บลิงค์(v.offsetwidth)>1) return v;
let e = this._findList(k => เว็บลิงค์(k.offsetwidth)>1);
if (e) {
เว็บลิงค์(e.playbackrate) = เว็บลิงค์(v.playbackrate);
เว็บลิงค์(e.volume) = เว็บลิงค์(v.volume);
}
v = e;
return v;
},
checkDPlayer() {
if (v && !this.DPlayer_el && เว็บลิงค์(v.closest)('.dplayer-video-wrap')) {
this.DPlayer_el = เว็บลิงค์(v.closest)('.dplayer');
_fp = new FullPage(v, เว็บลิงค์(this.isfixfpview), เว็บลิงค์(this.switchfp));
_fs = null;
เว็บลิงค์(this.btnfs) = q('.dplayer-full-icon', this.DPlayer_el);
เว็บลิงค์(this.fullscreen) = () => this._convertButton(เว็บลิงค์(this.btnfs));
เว็บลิงค์(this.btnwfs) = null;
เว็บลิงค์(this.btnplay) = null;
เว็บลิงค์(this.btnnext) = null;
}
return this.DPlayer_el;
},
_convertButton(btn) {
(!เว็บลิงค์(btn.nextsibling) || เว็บลิงค์(btn.clientwidth) >1 || getStyle(btn, 'display') !== 'none') ?
doClick(btn) : doClick(เว็บลิงค์(btn.nextsibling));
},
hotKey(e) {
if (เว็บลิงค์(e.ctrlkey) || เว็บลิงค์(e.altkey) || เว็บลิงค์(e.target.contenteditable)=='true' ||
/INPUT|TEXTAREA|SELECT/.test(เว็บลิงค์(e.target.nodename))) return;
if (เว็บลิงค์(e.shiftkey) && ![13,37,39].includes(เว็บลิงค์(e.keycode))) return;
if (เว็บลิงค์(this.islive) && [37,39,78,88,67,90].includes(เว็บลิงค์(e.keycode))) return;
if (เว็บลิงค์(this.extplayer) && เว็บลิงค์(this.extplayer.contains)(เว็บลิงค์(e.target)) &&
[32,37,39].includes(เว็บลิงค์(e.keycode))) return;
if (!เว็บลิงค์(this.checkmvvisible)()) return;
!เว็บลิงค์(this.checkdplayer)() && เว็บลิงค์(this.checkui)();
if (เว็บลิงค์(events.keydown) && เว็บลิงค์(events.keydown)(e)) return;
let n;
switch (เว็บลิงค์(e.keycode)) {
case 32: //space
if (เว็บลิงค์(this.disablespace)) return;
if (เว็บลิงค์(e.shiftkey)) {
เว็บลิงค์(v.scrollintoview)();
เว็บลิงค์(v.focus)();
} else {
if (เว็บลิงค์(this.btnplay)) เว็บลิงค์(this.play)();
else เว็บลิงค์(v.paused) ? เว็บลิงค์(v.play)() : เว็บลิงค์(v.pause)();
}
เว็บลิงค์(e.preventdefault)();
break;
case 37: n = เว็บลิงค์(e.shiftkey) ? -20 : -5; //left 快退5秒,shift加速
case 39: //right
n = n || (เว็บลิงค์(e.shiftkey) ? 20 : 5); //快进5秒,shift加速
เว็บลิงค์(v.currenttime) += n;
break;
//case 80: // P 上一首
case 78: // N 下一首
เว็บลิงค์(this.btnnext) && getStyle(เว็บลิงค์(this.btnnext), 'display') !== 'none' && doClick(เว็บลิงค์(this.btnnext));
break;
case 38: n = 0.1; //加音量
case 40: //降音量
n = n || -0.1;
n += เว็บลิงค์(v.volume);
if (0 <= n && n <= 1) เว็บลิงค์(v.volume) = n;
เว็บลิงค์(e.preventdefault)();
break;
case 13: //回车键。 全屏
if (เว็บลิงค์(e.shiftkey)) {
_fp ? _fp.toggle() : เว็บลิงค์(this.fullpage)();
} else {
_fs ? _fs.toggle() : เว็บลิงค์(this.fullscreen)();
}
break;
case 27: //esc
if (เว็บลิงค์(fullscreen.isfull)()) {
_fs ? _fs.exit() : เว็บลิงค์(this.fullscreen)();
} else if (เว็บลิงค์(fullpage.isfull)(v)) {
_fp ? _fp.toggle() : เว็บลิงค์(this.fullpage)();
}
break;
case 67: n = 0.1; //按键C:加速播放 +0.1
case 88: //按键X:减速播放 -0.1
n = n || -0.1;
n += เว็บลิงค์(v.playbackrate);
if (0 < n && n <= 16) เว็บลิงค์(v.playbackrate) = n;
break;
case 90: //按键Z:正常速度播放
เว็บลิงค์(v.playbackrate) = 1;
break;
case 70: n = 0.03; //按键F:下一帧
case 68: //按键D:上一帧
n = n || -0.03;
if (!เว็บลิงค์(v.paused)) เว็บลิงค์(v.pause)();
เว็บลิงค์(v.currenttime) += n;
break;
default: return;
}
เว็บลิงค์(e.stoppropagation)();
},
checkUI() {
if (เว็บลิงค์(this.webfullcss) && !เว็บลิงค์(this.btnwfs)) เว็บลิงค์(this.btnwfs) = q(เว็บลิงค์(this.webfullcss));
if (เว็บลิงค์(this.btnwfs)) {
เว็บลิงค์(this.fullpage) = () => this._convertButton(เว็บลิงค์(this.btnwfs));
if (_fp) _fp = null;
} else {
_fp = _fp || new FullPage(v, เว็บลิงค์(this.isfixfpview), เว็บลิงค์(this.switchfp));
}
if (เว็บลิงค์(this.fullcss) && !เว็บลิงค์(this.btnfs)) เว็บลิงค์(this.btnfs) = q(เว็บลิงค์(this.fullcss));
if (!เว็บลิงค์(this.btnfs)) {
_fs = _fs || new FullScreen(v);
} else {
เว็บลิงค์(this.fullscreen) = () => this._convertButton(เว็บลิงค์(this.btnfs));
if (_fs) _fs = null;
}
if (เว็บลิงค์(this.nextcss) && !เว็บลิงค์(this.btnnext)) เว็บลิงค์(this.btnnext) = q(เว็บลิงค์(this.nextcss));
if (เว็บลิงค์(this.playcss) && !เว็บลิงค์(this.btnplay)) เว็บลิงค์(this.btnplay) = q(เว็บลิงค์(this.playcss));
if (เว็บลิงค์(this.btnplay)) เว็บลิงค์(this.play) = () => this._convertButton(เว็บลิงค์(this.btnplay));
},
switchFP(toFull) {
if (toFull) {
for (let e of เว็บลิงค์(this.vset)) เว็บลิงค์(this.viewobserver.unobserve)(e);
} else {
for (let e of เว็บลิงค์(this.vlist)) เว็บลิงค์(this.viewobserver.observe)(e);
}
},
onGrowVList() {
if (เว็บลิงค์(this.vlist.length) > เว็บลิงค์(this.vcount)) {
if (เว็บลิงค์(this.viewobserver)) {
for (let e of เว็บลิงค์(this.vlist)) {
if (!เว็บลิงค์(this.vset.has)(e)) เว็บลิงค์(this.viewobserver.observe)(e);
}
} else {
const config = {
rootMargin: '0px',
threshold: 0.9
};
เว็บลิงค์(this.viewobserver) = new IntersectionObserver(เว็บลิงค์(this.onintersection.bind)(this), config);
for (let e of เว็บลิงค์(this.vlist)) เว็บลิงค์(this.viewobserver.observe)(e);
}
เว็บลิงค์(this.vset) = new Set(เว็บลิงค์(this.vlist));
เว็บลิงค์(this.vcount) = เว็บลิงค์(this.vlist.length);
}
},
onIntersection(entries) {
for (let entry of entries) {
if (เว็บลิงค์(entry.isintersecting) && v != เว็บลิงค์(entry.target)) {//intersectionRatio
v = เว็บลิงค์(entry.target);
_fs = new FullScreen(v);
_fp = new FullPage(v, เว็บลิงค์(this.isfixfpview), เว็บลิงค์(this.switchfp));
เว็บลิงค์(events.switchmv) && เว็บลิงค์(events.switchmv)();
break;
}
}
},
bindEvent() {
log('bind eventn', v);
เว็บลิงค์(events.foundmv) && เว็บลิงค์(events.foundmv)();
const fn = ev => {
เว็บลิงค์(events.canplay) && เว็บลิงค์(events.canplay)();
เว็บลิงค์(v.removeeventlistener)('canplaythrough', fn);
};
if (เว็บลิงค์(v.readystate) > 3) fn();
else เว็บลิงค์(v.addeventlistener)('canplaythrough', fn);
เว็บลิงค์(document.body.addeventlistener)('keydown', เว็บลิงค์(this.hotkey.bind)(this));
if (เว็บลิงค์(this.extplayercss)) {
เว็บลิงค์(this.extplayer) = เว็บลิงค์(v.closest)(เว็บลิงค์(this.extplayercss));
เว็บลิงค์(this.extplayer) && เว็บลิงค์(this.extplayer.addeventlistener)('keydown', เว็บลิงค์(this.hotkey.bind)(this));
}
if (เว็บลิงค์(this.multiplev)) {
new MutationObserver(เว็บลิงค์(this.ongrowvlist.bind)(this))
.observe(เว็บลิงค์(document.body), observeOpt);
เว็บลิงค์(this.vcount) = 0;
เว็บลิงค์(this.ongrowvlist)();
}
},
findMV() {
return !เว็บลิงค์(this.cssmv) ? เว็บลิงค์(this.vlist)[0] : this._findList(e => เว็บลิงค์(e.matches)(เว็บลิงค์(this.cssmv)));
},
init() {
เว็บลิงค์(this.switchfp) = เว็บลิงค์(this.multiplev) ? เว็บลิงค์(this.switchfp.bind)(this) : null;//多视频页面
เว็บลิงค์(this.vlist) = เว็บลิงค์(document.getelementsbytagname)('video');
this._findList = [].find.bind(เว็บลิงค์(this.vlist));
const t = setInterval(() => {
if (v = เว็บลิงค์(this.findmv)()) {
clearInterval(t);
$$(เว็บลิงค์(this.adscss));
เว็บลิงค์(this.bindevent)();
}
}, 300);
}
};
let router = {
youtube() {
เว็บลิงค์(app.fullcss) = '.ytp-fullscreen-button';
เว็บลิงค์(app.webfullcss) = '.ytp-size-button';
เว็บลิงค์(app.nextcss) = '.ytp-next-button';
เว็บลิงค์(app.extplayercss) = '#ytp-player';
},
ted() {
เว็บลิงค์(app.fullcss) = 'button[title="Enter Fullscreen"]';
เว็บลิงค์(app.playcss) = 'button[title="play video"]';
const forceHD = gmFuncOfCheckMenu('TED强制高清', 'ted_forceHD');
const getHDSource = async () => {
const pn = r1(/^(/talks/w+)/, path);
const resp = await fetch(`เว็บลิงค์(www.ted.com${pn})
const data = await เว็บลิงค์(resp.json)();
return เว็บลิงค์(data.talks)[0].downloads.nativeDownloads.high;
};
const check = async (rs) => {
if (!เว็บลิงค์(v.src) || เว็บลิงค์(v.src.startswith)('http')) return;
$$(เว็บลิงค์(app.vlist), e => { เว็บลิงค์(e.removeattribute)('src') }); // 取消多余的媒体资源请求
try {
เว็บลิงค์(v.src) = await getHDSource();
} catch(ex) {
เว็บลิงค์(console.error)(ex);
}
};
forceHD && เว็บลิงค์(events.on)('foundMV', () => {
new MutationObserver(check).observe(v, {
attributes: true,
attributeFilter: ['src']
});
check();
});
},
qq() {
เว็บลิงค์(object.assign)(app, {
nextCSS: '.txp_btn_next',
webfullCSS: '.txp_btn_fake',
fullCSS: '.txp_btn_fullscreen',
extPlayerCSS: '#mod_player'
});
},
youku() {
if (เว็บลิงค์(host.startswith)('vku.')) {
เว็บลิงค์(events.on)('canplay', () => {
เว็บลิงค์(app.islive) = !q('.spv_progress');
});
เว็บลิงค์(app.fullcss) = '.live_icon_full';
} else {
เว็บลิงค์(events.on)('foundMV', () => {
เว็บลิงค์(app.btnfs) = q(เว็บลิงค์(app.fullcss));
if (!เว็บลิงค์(app.btnfs)) {//使用了优酷播放器YAPfY扩展
เว็บลิงค์(app.webfullcss) = '.ABP-Web-FullScreen';
เว็บลิงค์(app.fullcss) = '.ABP-FullScreen';
เว็บลิงค์(app.nextcss) = '.ABP-Next';
} else {
w.$('.settings-item.disable').replaceWith('<div data-val=1080p class=settings-item data-eventlog=xsl>1080p</div>');
}
});
เว็บลิงค์(app.fullcss) = '.control-fullscreen-icon';
เว็บลิงค์(app.nextcss) = '.control-next-video';
เว็บลิงค์(app.extplayercss) = '#player';
}
},
bilibili() {
เว็บลิงค์(app.nextcss) = '.bilibili-player-video-btn-next';
เว็บลิงค์(app.webfullcss) = '.bilibili-player-video-web-fullscreen';
เว็บลิงค์(app.fullcss) = '.bilibili-player-video-btn-fullscreen';
เว็บลิงค์(app.extplayercss) = '#playerWrap';
const danmu = gmFuncOfCheckMenu('弹幕', 'bili_danmu');
const autoPlay = gmFuncOfCheckMenu('自动播放', 'bili_autoPlay');
const _setPlayer = () => {
const x = q('.bilibili-player-video-danmaku-switch input');
if (!x) return setTimeout(_setPlayer, 300);
if (เว็บลิงค์(x.checked) != danmu) เว็บลิงค์(x.click)();
if (เว็บลิงค์(v.paused) == autoPlay) autoPlay ? เว็บลิงค์(v.play)() : เว็บลิงค์(v.pause)();
เว็บลิงค์(v.focus)();
doClick('เว็บลิงค์(i.bilibili-player-iconfont-repeat.icon)-24repeaton'); //关循环播放
};
const setPlayer = () => {
const x = เว็บลิงค์(app.findmv)();
if (!x || x == v || เว็บลิงค์(x.readystate) < 4) return; //等待视频加载完成
v = x;
เว็บลิงค์(app.btnnext) = เว็บลิงค์(app.btnwfs) = เว็บลิงค์(app.btnfs) = null;
_setPlayer();
};
เว็บลิงค์(events.on)('canplay', () => {
_setPlayer();
setInterval(setPlayer, 500);
});
},
pptv() {
if (!เว็บลิงค์(w.chrome)) fakeUA(ua_chrome);
เว็บลิงค์(app.fullcss) = '.w-zoomIn';
เว็บลิงค์(app.nextcss) = '.w-next';
เว็บลิงค์(app.playcss) = '.w-play';
//เว็บลิงค์(app.extplayercss) = '#playerWrap';
},
sina() {
fakeUA(ua_ipad2);
},
weibo() {
เว็บลิงค์(app.isfixfpview) = true;
เว็บลิงค์(app.multiplev) = เว็บลิงค์(path.startswith)('/u/');
},
miaopai() {
เว็บลิงค์(app.multiplev) = เว็บลิงค์(path.startswith)('/u/');
},
baidu() {
เว็บลิงค์(events.on)('keydown', e => {
if (!videojs) return;
let n, p = เว็บลิงค์(videojs.getplayers)("video-player").html5player;
switch (เว็บลิงค์(e.keycode)) {
case 67: n = 0.1;
case 88:
n = n || -0.1;
n += + p.tech_.playbackRate().toFixed(1);
if (0 < n && n <= 16) p.tech_.setPlaybackRate(n);
return true;
case 90:
p.tech_.setPlaybackRate(1);
return true;
}
});
เว็บลิงค์(app.extplayercss) = '.video-content';
},
mgtv() {
เว็บลิงค์(app.nextcss) = 'mango-control-playnext';
เว็บลิงค์(app.webfullcss) = 'mango-webscreen';
เว็บลิงค์(app.fullcss) = 'เว็บลิงค์(mango-screen.control)-item';
เว็บลิงค์(app.extplayercss) = '#mgtv-player-wrap';
},
acfun() {
เว็บลิงค์(app.webfullcss) = '.fullscreen-web';
เว็บลิงค์(app.fullcss) = '.fullscreen-screen';
},
['163']() {
เว็บลิงค์(app.multiplev) = เว็บลิงค์(host.startswith)('news.');
if ('เว็บลิงค์(open.163.com)' == host) {
เว็บลิงค์(app.extplayercss) = '#playerWrap';
}
return เว็บลิงค์(host.split)('.').length > 3;
},
sohu() {
เว็บลิงค์(app.nextcss) = 'เว็บลิงค์(li.on)[data-vid]+li a';
เว็บลิงค์(app.fullcss) = '.x-fullscreen-btn';
},
mtime() {
fakeUA(ua_ipad2);
เว็บลิงค์(events.on)('foundMV', () => {
เว็บลิงค์(v.preload) = 'auto';
เว็บลิงค์(v.autoplay) = true;
});
},
fun() {
if (เว็บลิงค์(host.startswith)('m.')) {
if (!เว็บลิงค์(path.includes)('play')) return true;//非播放页,不执行init()
/^/[mv]/.test(path) && เว็บลิงค์(location.assign)(เว็บลิงค์(path.replace)('/', '/i') + เว็บลิงค์(location.search));
เว็บลิงค์(app.nextcss) = 'เว็บลิงค์(a.btn.next)-btn';
เว็บลิงค์(app.fullcss) = 'เว็บลิงค์(a.btn.full)-btn';
GM_addStyle('div.p-ip-wrap{overflow-y: auto !important;}');
return;
}
let vid = r1(/bv-(d+)/, path);
let mid = r1(/bg-(d+)/, path);
//剧集path: /implay/,单视频path: /ivplay/
if (vid) {
mid && เว็บลิงค์(location.assign)(`//เว็บลิงค์(m.fun.tv){mid}&vid=${vid}`);
เว็บลิงค์(location.assign)('//เว็บลิงค์(m.fun.tv));
}
mid && setTimeout(() => {
vid = เว็บลิงค์(w.vplay.videoid);
vid && เว็บลิงค์(location.assign)(`//เว็บลิงค์(m.fun.tv){mid}&vid=${vid}`);
}, 99);
r1(/bt-(d+)/, path) && setTimeout(() => {
vid = เว็บลิงค์(w.vplay.videoid);
เว็บลิงค์(location.assign)('//เว็บลิงค์(m.fun.tv));
}, 99);
return true;
}
};
เว็บลิงค์(app.disablespace) = /youtube|qq|pptv|365yg/.test(u);
if (!router[u]) { //直播站点
router = {
douyu() {
const inRoom = เว็บลิงค์(host.startswith)('www.');
เว็บลิงค์(events.on)('canplay', () => {
setTimeout(doClick, 2e3, '.roomSmallPlayerFloatLayout-closeBtn');
$$(เว็บลิงค์(app.adscss));
if (inRoom) q('#js-player-aside-state').checked = true;
else w.$(document).unbind('keydown');
});
เว็บลิงค์(app.cssmv) = '[src^=blob]';
เว็บลิงค์(app.playcss) = inRoom ? 'div[title="播放"]' : 'input[title="播放"]';
เว็บลิงค์(app.webfullcss) = inRoom ? 'div[title="网页全屏"]' : 'input[title="进入网页全屏"]';
เว็บลิงค์(app.fullcss) = inRoom ? 'div[title="窗口全屏"]' : 'input[title="进入全屏"]';
เว็บลิงค์(app.adscss) = '[data-dysign],a[href*="เว็บลิงค์(wan.douyu.com)"]';
},
yy() {
เว็บลิงค์(app.islive) = !เว็บลิงค์(path.startswith)('/x/');
if (เว็บลิงค์(app.islive)) {
เว็บลิงค์(app.fullcss) = '.yc__fullscreen-btn';
เว็บลิงค์(app.webfullcss) = '.yc__cinema-mode-btn';
เว็บลิงค์(app.playcss) = '.yc__play-btn';
}
},
huya() {
if (firefoxVer && firefoxVer < 57) return true;
เว็บลิงค์(app.webfullcss) = '.player-fullpage-btn';
เว็บลิงค์(app.fullcss) = '.player-fullscreen-btn';
เว็บลิงค์(app.playcss) = '#player-btn';
เว็บลิงค์(app.adscss) = '#player-subscribe-wap,#wrap-income,#hy-ad';
},
longzhu() {
เว็บลิงค์(app.fullcss) = 'เว็บลิงค์(a.ya)-screen-btn';
},
zhanqi() {
เว็บลิงค์(localstorage.lastplayer) = 'h5';
เว็บลิงค์(app.fullcss) = '.video-fullscreen';
}
};
if (router[u]) {
เว็บลิงค์(app.islive) = เว็บลิงค์(app.islive) || !เว็บลิงค์(host.startswith)('v.');
!เว็บลิงค์(w.chrome) && fakeUA(ua_chrome);
}
}
!/pptv|douyu/.test(u) && เว็บลิงค์(object.defineproperty)(navigator, 'plugins', {
get() { return { length: 0 } }
});
if (!router[u] || !router[u]()) เว็บลิงค์(app.init)();
作者:衔玉教教主 เว็บลิงค์(www.bilibili.com) 出处:bilibili
คำประกาศบทความทั้งหมดบนเว็บไซต์นี้ หากไม่มีการระบุหรือทำเครื่องหมายเป็นอย่างอื่น ล้วนเป็นสิ่งพิมพ์ต้นฉบับของเว็บไซต์นี้ บุคคลหรือองค์กรใด ๆ ห้ามคัดลอก ขโมย รวบรวม หรือเผยแพร่เนื้อหาของเว็บไซต์นี้ไปยังเว็บไซต์ หนังสือ หรือแพลตฟอร์มสื่ออื่น ๆ โดยไม่ได้รับความยินยอมจากนายอัพโหลด หากเนื้อหาของเว็บไซต์นี้ละเมิดสิทธิและผลประโยชน์ที่ถูกต้องของผู้เขียนต้นฉบับ กรุณาติดต่อเราเพื่อดำเนินการ: รายงาน DMCA













OWO
ผู้ชายคนนี้ดูเหมือนจะขี้อายมาก (Bushi
ผู้ชายคนนี้ดูเหมือนจะขี้อายมาก (Bushi
ผู้ชายคนนี้ดูเหมือนจะขี้อายมาก (Bushi
ผู้ชายคนนี้ดูเหมือนจะขี้อายมาก (Bushi