const e = VU[o], i = (o + 1) / (VU.length + 1), t = (sniffUrls.length + 1) / MAX_SNIFF_PLAY_COUNT, a = Math.min(10 * (2.5 * i + 2.5 * t + 5 * Math.max(i, t) + .5), 99).toFixed(4) + "%";
if (log("【".concat(o, " - ").concat(a, " (thread ").concat($("oo-iframes > iframe").length, ")】goSniff:"), e),
$(".o--sniff-progress").css({
width: a
}), !e) {
const n = setInterval((function() {
0 === $("oo-iframes > iframe").length && (clearInterval(n), 0 === sniffUrls.length ? sniffFail() : sniffDone());
}), 1e3);
return;
}
if (sniffUrls.length >= MAX_SNIFF_PLAY_COUNT + (player && player.ready && player.duration > 0 ? -1 : 2)) return void sniffDone();
const r = getVipTargetUrl(), l = mVU(e) + r;
log("sniff: " + l), sniffTimes[fixIframeUrl(l)] = Date.now();
const s = addIframe(l), c = 12e3, p = isMobile ? 7 : 5;
s.onload = function() {
setTimeout((function() {
removeIframe(s, "TIMEOUT");
}), c);
}, setTimeout((function() {
removeIframe(s, "MAX TIMEOUT");
}), c + 3e3), n();
}
async function autoSniffPlay() {
log("autoSniffPlay"), await playBefore(), sniffTick > 0 && sniffDone(), sniffStartTime = Date.now(),
sniff(++sniffTick), $(".o--vip").removeClass("is-sniff-success is-sniff-done").addClass("is-sniffing");
}
function getVipPlayer() {
let n = $(PlayerSelector).eq(0);
return 0 === n.length && (n = $("#player, .player").eq(0)), n;
}
function playInPage(n) {
$(".o--player").removeClass("is-loaded"), 0 === getVipPlayer().length ? location.href = n : (pausePlay(),
insertPlayerHtml('<iframe id="o--player-iframe" style="'.concat("width: 100%; height: 100%; border: none; outline: none;", '" ').concat(' width="100%" height="100%" allowfullscreen="true" allowtransparency="true" frameborder="0" scrolling="no" sandbox="allow-scripts allow-same-origin allow-forms"', ' src="').concat(n, '"></iframe>'))),
setTimeout((function() {
$(".o--player").addClass("is-loaded");
}), 1500);
}
function playVipUrl(n) {
if (!n) return void log("[playVipUrl] No vipUrl:", n);
const o = n + getVipTargetUrl();
log("playVipUrl: " + o), $(".o--vip").removeClass("is-sniff-success is-sniff-done is-sniffing").addClass("is-play-in-page"),
updateQrcode(o), isPlayingInPage && !/http:/.test(n) ? playInPage(o) : (pausePlay(),
$("#o--player-iframe").remove(), $(".o--player").removeClass("is-loaded"), setTimeout((function() {
window.open(o, "_blank");
}), 100));
}
async function updateQrcode() {
let url = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : Href;
isMobile || (log("updateQrcode:", url), !qrcodeCode && (qrcodeCode = await fetchCdnUrl("/qrcode-generator/1.4.4/qrcode.min.js")),
eval(qrcodeCode), QR = qrcode(0, "L"), QR.addData(url), QR.make(), log("updateQrcode success"),
$(".o--qrcode-box").removeClass("o--hide"), $(".o--qrcode").html(QR.createImgTag()));
}
function playVipItem(n) {
const o = $(n).length > 0;
let e = o ? $(n).hasClass("o--vip-sniff") ? "auto" : $(n).attr("_href") : Store.get("lastPlayChoice", "");
log(o ? "✔" : "× playVipItem - lastPlayChoice: " + (e || "auto")), $(".o--vip-item").removeClass("is-active"),
o ? $(n).addClass("is-active") : e.startsWith("http") ? ($(".o--vip-item:not(.o--vip-sniff)").each((function() {
$(this).attr("_href") === e && $(this).addClass("is-active");
})), playVipUrl(e)) : $(".o--vip-item.o--vip-sniff").addClass("is-active"), isSniffing && sniffDone(),
e.startsWith("http") ? playVipUrl(e) : autoSniffPlay(), Store.set("lastPlayChoice", e);
}
function insertVipSource(n) {
function o() {
$(".o--setting-button").off("click").on("click", (function() {
$(".o--vip").toggleClass("is-setting-on");
})), $(".o--toggle").off("click").on("click", (function() {
$(this).toggleClass("is-n"), $(this).hasClass("o--action-pip") && (isPlayingInPage = !isPlayingInPage,
GlobalStore.set("isPlayingInPage", isPlayingInPage));
})), $(".o--edit-vip-source-panel textarea").off("input").on("input", (function() {
GlobalStore.set("VipUrls", $(this).val());
})), $(".o--vip-item").off("click").on("click", (function() {
playVipItem(this);
})), $(".o--log-button").off("click").on("click", (function() {
$("oo-logs").toggleClass("is-active");
}));
}
let e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "after", i = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : 0;
if ($(".o--vip").length > 0 || i > 20) return;
const t = $(n);
if (0 === t.length) return void setTimeout((function() {
insertVipSource(n, e, i + 1);
}), 250);
log("insertVipSource"), t.eq(0)[e]('<div class="o--vip'.concat(isAllowSniff ? " is-allow-sniff" : "", '"><div class="o--sniff-progress"></div><div class="o--vip-panel"><div class="o--vip-title"><span class="o--vip-title-text">').concat(PLUGIN_NAME, '<span class="o--vip-small">v').concat(VERSION, "</span></span>").concat(_D ? '<span class="o--log-button">LOG</span>' : "", '</div><div class="o--menus"><div class="o--qrcode-box o--hide">').concat(Icon.qrcode, '<div class="o--qrcode-text">手机扫码看</div><div class="o--qrcode"></div></div><div class="o--setting-button">').concat(Icon.settings, '</div></div></div><div class="o--setting-panel"><div class="o--actions"><div class="o--action o--toggle o--action-pip').concat(isPlayingInPage ? "" : " is-n", '"><span class="o--y">是</span><span class="o--n">否</span>开启原网页解析播放</div><div class="o--action"><a href="https://greasyfork.org/scripts/393284" target="_blank">油猴地址</a></div></div><div class="o--edit-vip-source-panel"><div class="o--edit-hint">编辑后,刷新页面生效,清空会恢复为默认(原网页解析只支持 https 开头的解析)</div><textarea>').concat(customVipUrls.trim(), '</textarea></div></div><div class="o--vip-list"><span class="o--vip-item o--vip-sniff">').concat(Icon.vip, "</span>").concat(vipUrls.map((function(n) {
return '<span class="o--vip-item' + (n.url.startsWith("https") ? " is-play-in-page" : "") + '" _href="' + n.url + '">' + n.

Prev | Next
Pg.: 1 2 3 4 5 6 7 8 ... 10


Back to home | File page

Subscribe | Register | Login | N