// ==UserScript==
// @name 觅影
// @version 20.3.33
// @author (o˘◡˘o)
// @description 平平无奇的原网页解析VIP视频
// @note 最近更新:修复: `芒果TV` 部分页面改版不显示解析;更新解析
// @namespace (o˘◡˘o)
// @supportURL https://gitee.com/ecruos/oo
// @icon https://p.pstatp.com/origin/fe690000c9141955bbac
// @license GPL License
// @include *
// @grant GM_setValue
// @grant GM_getValue
// @grant GM_deleteValue
// @grant unsafeWindow
// ==/UserScript==

!async function() {
function Is(n) {
let o = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Href;
return "string" == typeof n ? o.includes(n) : n.test(n.source.includes("=http") ? o : o.replace(/=http[^&]+/, ""));
}
function IsNot(n, o) {
return !Is(n, o);
}
function magicSource(n) {
return n.match(/\w+/g).forEach((function(o) {
n = n.replace(o, magicString(o));
})), n;
}
function mVU(n) {
const o = magicSource(n);
return "https://" + o + (o.includes("?") ? "" : (o.endsWith(".") ? "php" : o.includes("/") ? "" : "/") + "?url") + "=";
}
function ensureArray(n) {
return Array.isArray(n) ? n : n.trim().split(/[\n\s]*\n+[\n\s]*/);
}
function toUrlRegex(n) {
return new RegExp(n.map((function(n) {
return n.replace(/.+\/\/|\/.+/g, "").replace(/\./g, "\\.");
})).join("|"));
}
function getCdnUrl(n) {
return "https://cdn.bootcss.com" + n;
}
async function fetchCdnUrl(n, o) {
let e, i;
const t = /^\/\w/.test(n);
if (n = t ? getCdnUrl(n) : n, !o && t) {
const o = n.match(/cdn.bootcss.com\/([^\/]+)\/([^\/]+)\/.+(\.\w+)$/);
e = o[1] + o[3], i = o[2];
} else e = o.name || n, i = o.version || VERSION;
const a = GlobalStore.get(e);
let r;
return r = a && a.version === i ? a.data : await window.fetch(n).then((function(n) {
return n.text();
})).then((function(n) {
return GlobalStore.set(e, {
data: n,
version: i
}), n;
})), r;
}
async function addJs(url, opts) {
const data = await fetchCdnUrl(url, opts);
return eval(data);
}
async function addCssUrl(n) {
addCss(await fetchCdnUrl(n));
}
function addCss(n) {
let o;
return /^(http|\/)/.test(n) ? addCssUrl(n) : (n = n.replace(/\n+\s*/g, " "), o = document.createElement("style"),
o.styleSheet ? o.styleSheet.cssText = n : o.appendChild(document.createTextNode(n)),
o.type = "text/css", void document.getElementsByTagName("head")[0].appendChild(o));
}
function $$(n, o) {
let e = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
return 0 === $(n).length ? void (e > 100 ? log("× waitToRun:", n, "warn") : setTimeout((function() {
waitToRun(n, o, e + 1);
}), 100)) : (log("✔ waitToRun:", n), void $((function() {
o();
})));
}
function uuid() {
let n = 46656 * Math.random() | 0, o = 46656 * Math.random() | 0;
return n = ("000" + n.toString(36)).slice(-2), o = ("000" + o.toString(36)).slice(-3),
"o" + n + o;
}
function emitter(n) {
return n = n || Object.create(null), {
on(o, e) {
(n[o] || (n[o] = [])).push(e);
},
off(o, e) {
n[o] && n[o].splice(n[o].indexOf(e) >>> 0, 1);
},
emit(o, e) {
(n[o] || []).slice().map((function(n) {
n(e);
})), (n["*"] || []).slice().map((function(n) {
n(o, e);
}));
}
};
}
function log() {}
function fixUrl(n) {
return n.replace(/[\?#].+/g, "");
}
function fixVipUrl(n) {
const o = BETTER_ADDONS.find((function(o) {
return o.fixUrl && o.match.test(n);
}));
return o ? !0 === o.fixUrl ? fixUrl(n) : o.fixUrl(n) : n;
}
function getVipTargetUrl() {
if (ooPlayUrl) return ooPlayUrl;
let n = Is(isVipUrlRegex) ? location.href.replace(/.+=http/, "http") : location.href.replace(/&?\w+=http[^&]+/, "").replace(/.+http/, "http");
return n = decodeURI(fixVipUrl(n) || n), n;
}
function getGlobal(n) {
return (hasUnsafeWindow ? unsafeWindow : window)[n];
}
function setGlobal(n, o) {
window[n] = o, hasUnsafeWindow && (unsafeWindow[n] = o);
}
function pausePlay() {
log("pausePlay");
try {
$("video:not(.o--video), audio").each((function(n, o) {
o.pause(), o.muted = !0, $("video:not(.o--video), audio").remove();
}));
const n = Date.now(), o = setInterval((function() {
const e = Date.now() - n, i = getGlobal("playerObject") || getGlobal("MGTVPlayer") && getGlobal("MGTVPlayer").player || getGlobal("videoPlayer") || getGlobal("PLAYER");
i && i.pause instanceof Function && i.pause(), (!i || e > 6e4) && clearInterval(o);
}), 60);
} catch (n) {
console.error(PLUGIN_NAME + " play: " + n);
}
}
function canPlayInPage(n) {
return !isOnlyDownloadVideoUrlRegex.test(n) && (!/\/\/vwecam.tc.qq.com/.test(n) || Is("v.qq.com"));
}
function isValidVideoUrl(n) {
return isValidUrlRegex.test(n) && isVideoUrlRegex.test(n) && !isInvalidSniffUrlRegex.test(n);
}
function toShortVideoUrl(n) {
const o = n.match(shortVideoUrlRegex) || n.match(shortVideoUrlLoseRegex);
return o ? o[1].split(".").slice(-2).join(".") + " ... " + o[o.length - 2].slice(-10) + "<span> . " + o[o.length - 1] + "</span>" : n;
}
async function playBefore() {
$(".o--vip-play").removeClass("is-hide"), !isLoadPlayer && (addCss("/plyr/3.5.10/plyr.css"),
await addJs("/hls.js/0.13.2/hls.min.js"), await addJs("/plyr/3.5.10/plyr.min.js"),
isLoadPlayer = !0);
}
function formatPassedTime(n) {
return ((Date.now() - n) / 1e3).toFixed(2) + "s";
}
function getSniffTime(n) {
const o = sniffTimes[fixIframeUrl(n)];
return o ? formatPassedTime(o) : "0s";
}
function sniffStart() {
isSniffing = !0, sniffTimestamp = Date.now(), sniffUrls = [], sniffUrlsKey = [],
$("html").addClass("o--on"), $(".o--vip").removeClass("is-play-in-page");
}
function sniffDone() {
const n = formatPassedTime(sniffStartTime);
log("Sniff done ✔ - usedTime ".concat(n)), isSniffing = !1, emptyIframes(), $(".o--sniff-progress").

Next
Pg.: 1 2 3 4 5 6 ... 10


Back to home | File page

Subscribe | Register | Login | N