LinuxDo· lirose·· 2 小时前AI 评分51
作者用 AI 生成油猴脚本,实现多平台 VIP 视频解析
【最新实测】白嫖vip视频解析,ai了一个油猴脚本
AI 导读
作者发布了一个用 AI 生成的油猴脚本,可在腾讯视频、爱奇艺、优酷、芒果TV、B站等页面注入「解析」按钮,通过 aibox.eu.org 的解析接口在 iframe 中播放当前页面视频。脚本会自动隐藏各站 VIP 遮罩与推广浮层、静音官方播放器,并支持页面跳转后重新解析;作者同时给出一个保存为 .html 双击即可打开的本地版本,输入视频链接后同样调用该接口播放。
正文
最新实测好用,参考资料: 【油猴/篡改猴/暴力猴】iQiYi VIP / Bilibili Bangumi iQiYi 解析 / 二开 Tencent VIP
保存 .html文件 ,桌面上直接打开
<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>VIP视频解析</title><style>:root{color-scheme:light;--bg:#f3efe7;--card:#fffdf9;--ink:#1d1a16;--muted:#746b62;--line:#e6dfd4;--accent:#c4511a;--accent-dark:#9d3d12}*{box-sizing:border-box}body,html{height:100%;margin:0}body{display:flex;flex-direction:column;font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;background:var(--bg);color:var(--ink)}header{display:flex;align-items:center;gap:14px;padding:14px 18px;background:var(--card);border-bottom:1px solid var(--line)}h1{margin:0;font-size:16px;font-weight:650;letter-spacing:.02em;white-space:nowrap}form{display:flex;flex:1;gap:8px;min-width:0}input{flex:1;min-width:0;height:42px;padding:0 14px;border:1px solid var(--line);border-radius:11px;background:#fff;color:inherit;font:inherit;font-size:14px}input:focus{outline:2px solid #f3c7b0;border-color:var(--accent)}input.invalid{border-color:var(--accent);outline:2px solid #f3c7b0}button{height:42px;padding:0 18px;border:0;border-radius:11px;background:var(--accent);color:#fff;font:inherit;font-size:14px;font-weight:650;cursor:pointer}button:hover{background:var(--accent-dark)}button:active{transform:translateY(1px)}main{position:relative;flex:1;min-height:0;margin:14px;border-radius:16px;overflow:hidden;background:#111;box-shadow:0 10px 30px rgba(40,28,16,.08)}iframe{display:none;width:100%;height:100%;border:0;background:#000}iframe.show{display:block}.empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:24px;text-align:center;background:radial-gradient(circle at 50% 0,rgba(196,81,26,.16),transparent 42%),#171412;color:#f6efe6}.empty.hide{display:none}.empty strong{font-size:18px;font-weight:650}.empty span{max-width:28em;color:#cbbfb2;font-size:14px;line-height:1.7}@media (max-width:680px){header{flex-direction:column;align-items:stretch;gap:10px}main{margin:10px;border-radius:12px}}</style></head><body><header><h1>VIP视频解析</h1><form id="form"><input id="url" type="text" placeholder="粘贴视频页面地址,例如 https://v.qq.com/..." autocomplete="off" spellcheck="false"> <button type="submit">开始</button></form></header><main><div class="empty" id="empty"><strong>把链接贴到上面</strong> <span id="hint">点开始后直接播放。这个文件存到桌面,双击就能打开。</span></div><iframe id="player" title="播放器" allow="autoplay; encrypted-media; fullscreen" allowfullscreen referrerpolicy="no-referrer"></iframe></main><script>let PARSE_URL="https://aibox.eu.org/?url=",form=document.getElementById("form"),input=document.getElementById("url"),player=document.getElementById("player"),empty=document.getElementById("empty"),hint=document.getElementById("hint"),saved=localStorage.getItem("parse-url");saved&&(input.value=saved),form.addEventListener("submit",t=>{t.preventDefault();let e=input.value.trim();e?(/^https?:\/\//i.test(e)||(e="https://"+e),input.value=e,input.classList.remove("invalid"),localStorage.setItem("parse-url",e),player.classList.add("show"),empty.classList.add("hide"),player.src=PARSE_URL+e):(input.classList.add("invalid"),hint.textContent="请先粘贴视频链接",input.focus())})</script></body></html>
油猴脚本
// ==UserScript==
// @name VIP视频解析
// @namespace video_vip
// @version 1.1.9
// @description 等官方播放器出来后,点左侧「解析」再用 aibox 播放当前页面。
// @license GPL-3.0 License
// @include *://v.qq.com/x/page/*
// @include *://v.qq.com/x/cover/*
// @include *://v.qq.com/tv/*
// @include *://*.iqiyi.com/v_*
// @include *://*.iqiyi.com/a_*
// @include *://*.iqiyi.com/w_*
// @include *://*.iq.com/play/*
// @include *://*.youku.com/v_*
// @include *://*.youku.com/video*
// @include *://*.youku.com/*?vid=*
// @include *://*.mgtv.com/b/*
// @include *://*.tudou.com/v_*
// @include *://tv.sohu.com/v/*
// @include *://*.bilibili.com/video/*
// @include *://*.bilibili.com/bangumi/play/*
// @include *://v.pptv.com/show/*
// @include *://vip.pptv.com/show/*
// @include *://www.wasu.cn/Play/show/*
// @include *://*.le.com/ptv/vplay/*
// @include *://*.acfun.cn/v/*
// @include *://*.acfun.cn/bangumi/*
// @include *://*.1905.com/play/*
// @include *://m.v.qq.com/x/m/*
// @include *://m.v.qq.com/*
// @include *://m.iqiyi.com/*
// @include *://m.iqiyi.com/v_*
// @include *://m.youku.com/video/*
// @include *://m.youku.com/alipay_*
// @include *://m.mgtv.com/b/*
// @include *://m.tv.sohu.com/v/*
// @include *://m.tv.sohu.com/album/*
// @include *://m.pptv.com/show/*
// @include *://m.bilibili.com/anime/*
// @include *://m.bilibili.com/video/*
// @include *://m.bilibili.com/bangumi/play/*
// @grant none
// @charset UTF-8
// @compatible firefox
// @compatible chrome
// @compatible opera safari edge
// ==/UserScript==
const PARSE_URL = "https://aibox.eu.org/?url=";
const util = (function () {
return {
findTargetEle(selector) {
return new Promise((resolve, reject) => {
const el = document.querySelector(selector);
if (el) {
resolve(el);
return;
}
let tryTime = 0;
const maxTryTime = 120;
const timer = setInterval(() => {
const el = document.querySelector(selector);
if (el) {
clearInterval(timer);
resolve(el);
return;
}
if ((++tryTime) === maxTryTime) {
clearInterval(timer);
reject(new Error("findTargetEle timeout: " + selector));
}
}, 500);
});
}
};
})();
const superVip = (function () {
const iframeWrapperClass = "vip_jx_iframe_wrapper";
let fullscreenCleanupBound = false;
let wrapper = null;
let iframe = null;
let maintainTimer = null;
let hrefTimer = null;
let playingHref = "";
let pendingHref = "";
let starting = false;
const playerContainers = [
{
host: "v.qq.com",
container: "#mod_player,#player-container,.container-player",
displayNodes: ["#mask_layer", ".mod_vip_popup", "#mask_layer", ".panel-tip-pay"]
},
{
host: "m.v.qq.com",
container: ".mod_player,#player",
displayNodes: [".mod_vip_popup", "[class^=app_],[class^=app-],[class*=_app_],[class*=-app-],[class$=_app],[class$=-app]", "div[dt-eid=open_app_bottom]", "div.video_function.video_function_new", "a[open-app]", "section.mod_source", "section.mod_box.mod_sideslip_h.mod_multi_figures_h,section.mod_sideslip_privileges,section.mod_game_rec"]
},
{host: "w.mgtv.com", container: "#mgtv-player-wrap", displayNodes: []},
{host: "www.mgtv.com", container: "#mgtv-player-wrap", displayNodes: []},
{
host: "m.mgtv.com",
container: ".video-area",
displayNodes: ["div.adFixedContain,div.ad-banner,div.m-list-graphicxcy.fstp-mark", "div[class^=mg-app],div#comment-id.video-comment div.ft,div.bd.clearfix,div.v-follower-info", "div.ht.mgui-btn.mgui-btn-nowelt", "div.personal", "div[data-v-41c9a64e]"]
},
{host: "www.bilibili.com", container: "#player_module,#bilibiliPlayer,#bilibili-player", displayNodes: []},
{host: "m.bilibili.com", container: ".player-wrapper,.player-container,.mplayer", displayNodes: []},
{host: "www.iqiyi.com", container: "#areaLeftContainer,#outlayer,.iqp-player-videolayer", displayNodes: ["#playerPopup", "#vipCoversBox", "div.iqp-player-vipmask", "div.iqp-player-paymask", "div.iqp-player-loginmask", "div[class^=qy-header-login-pop]", ".covers_cloudCover__ILy8R", "#videoContent > div.loading_loading__vzq4j", ".iqp-player-guide", "#player-loading-layer", ".player_outer_video"], cleanupNodes: ["#player-loading-layer", ".player_outer_video"]},
{
host: "m.iqiyi.com",
container: ".m-video-player-wrap, .iqp-player-videolayer",
displayNodes: ["div.m-iqyGuide-layer", "a[down-app-android-url]", "div.iqp-player-vipmask", ".loading_loading__vzq4j", "[name=m-extendBar]", "[class*=ChannelHomeBanner]", "section.m-hotWords-bottom"]
},
{host: "www.iq.com", container: ".intl-video-wrap", displayNodes: []},
{host: "v.youku.com", container: ".player-container,#ykPlayer,#playerMouseWheel", displayNodes: ["#iframaWrapper", "#video_side_cashier", ".secondary-container.video_side_cashier_wrapper", "#youku-dashboard"], cleanupNodes: ["#youku-dashboard > div.kui-dashboard-dashboard-panel", "#youku-dashboard > div.kui-dashboard-dashboard-background", "#youku-dashboard > div.kui-dashboard-bar-container", "#youku-dashboard > div.kui-dashboard-timer-container", "#video_side_cashier", ".secondary-container.video_side_cashier_wrapper"]},
{host: "m.youku.com", container: "#playerMouseWheel,.h5-detail-player", displayNodes: []},
{host: "tv.sohu.com", container: "#player", displayNodes: []},
{host: "film.sohu.com", container: "#playerWrap", displayNodes: []},
{host: "www.le.com", container: "#le_playbox", displayNodes: []},
{host: "video.tudou.com", container: ".td-playbox", displayNodes: []},
{host: "v.pptv.com", container: "#pptv_playpage_box", displayNodes: []},
{host: "vip.pptv.com", container: ".w-video", displayNodes: []},
{host: "www.wasu.cn", container: "#flashContent", displayNodes: []},
{host: "www.acfun.cn", container: "#player", displayNodes: []},
{host: "vip.1905.com", container: "#player,#vodPlayer", displayNodes: []},
{host: "www.1905.com", container: "#player,#vodPlayer", displayNodes: []},
];
function applyInlineStyles(element, styles) {
Object.entries(styles || {}).forEach(([propertyName, propertyValue]) => {
if (propertyValue === undefined || propertyValue === null || propertyValue === "") {
return;
}
element.style[propertyName] = propertyValue;
});
}
function hideOverlays(playerNode) {
const selectors = [...new Set((playerNode.displayNodes || []).concat(playerNode.cleanupNodes || []).filter(Boolean))];
selectors.forEach((selector) => {
document.querySelectorAll(selector).forEach((node) => {
node.style.setProperty("display", "none", "important");
node.style.setProperty("opacity", "0", "important");
node.style.setProperty("pointer-events", "none", "important");
});
});
}
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function containerSignature(container) {
const rect = container.getBoundingClientRect();
return [
Math.round(rect.width),
Math.round(rect.height),
container.childElementCount,
container.querySelectorAll("video, audio").length
].join(":");
}
async function waitForSettle(playerNode) {
const first = await util.findTargetEle(playerNode.container);
const deadline = Date.now() + 12000;
let current = first;
let signature = containerSignature(current);
let href = window.location.href;
let stableSince = Date.now();
while (Date.now() < deadline) {
await sleep(400);
current = document.querySelector(playerNode.container) || current;
const nextSignature = containerSignature(current);
const nextHref = window.location.href;
if (nextSignature !== signature || nextHref !== href) {
signature = nextSignature;
href = nextHref;
stableSince = Date.now();
continue;
}
const rect = current.getBoundingClientRect();
if (rect.width > 80 && rect.height > 80 && Date.now() - stableSince >= 1200) {
return current;
}
}
return document.querySelector(playerNode.container) || first;
}
function silenceOfficialMedia(container) {
container.querySelectorAll("video, audio").forEach((media) => {
if (media.closest("." + iframeWrapperClass)) {
return;
}
try {
media.pause();
media.muted = true;
media.volume = 0;
} catch (e) {
}
});
}
function placeWrapper(container) {
const rect = container.getBoundingClientRect();
const height = Math.max(Math.round(rect.height) || 0, 180);
if (window.getComputedStyle(container).position === "static") {
container.style.position = "relative";
}
container.style.overflow = "hidden";
applyInlineStyles(wrapper, {
position: "absolute",
top: "0",
left: "0",
width: "100%",
height: height + "px",
background: "#000",
overflow: "hidden",
zIndex: "2147483646"
});
applyInlineStyles(iframe, {
width: "100%",
height: "100%",
border: "none",
display: "block",
background: "#000"
});
}
function mountPlayer(playerNode, container) {
hideOverlays(playerNode);
silenceOfficialMedia(container);
if (!wrapper) {
wrapper = document.createElement("div");
wrapper.className = iframeWrapperClass;
iframe = document.createElement("iframe");
iframe.frameBorder = "0";
iframe.allow = "autoplay; encrypted-media; fullscreen";
iframe.allowFullscreen = true;
iframe.referrerPolicy = "no-referrer";
playingHref = window.location.href;
iframe.src = PARSE_URL + playingHref;
wrapper.appendChild(iframe);
}
placeWrapper(container);
container.appendChild(wrapper);
}
function maintain(playerNode) {
const container = document.querySelector(playerNode.container);
if (!container || !wrapper) {
return;
}
hideOverlays(playerNode);
silenceOfficialMedia(container);
placeWrapper(container);
if (!container.contains(wrapper) || container.lastElementChild !== wrapper) {
container.appendChild(wrapper);
}
if (iframe && window.location.href !== playingHref && pendingHref !== window.location.href) {
pendingHref = window.location.href;
clearTimeout(hrefTimer);
hrefTimer = setTimeout(() => {
if (!iframe || window.location.href !== pendingHref) {
return;
}
playingHref = pendingHref;
pendingHref = "";
iframe.src = PARSE_URL + playingHref;
}, 1200);
}
}
function begin(playerNode, startButton) {
if (starting) {
return;
}
if (wrapper) {
const container = document.querySelector(playerNode.container);
if (!container) {
startButton.title = "还没找到播放器,等页面出来后再点";
return;
}
playingHref = window.location.href;
pendingHref = "";
iframe.src = PARSE_URL + playingHref;
mountPlayer(playerNode, container);
return;
}
starting = true;
startButton.disabled = true;
startButton.textContent = "等待";
waitForSettle(playerNode).then((container) => {
mountPlayer(playerNode, container);
if (!maintainTimer) {
maintainTimer = setInterval(() => maintain(playerNode), 1500);
}
if (!fullscreenCleanupBound) {
document.addEventListener("fullscreenchange", () => hideOverlays(playerNode));
fullscreenCleanupBound = true;
}
startButton.textContent = "解析";
startButton.title = "重新解析当前页面";
}).catch(() => {
startButton.textContent = "解析";
startButton.title = "还没找到播放器,等页面出来后再点";
}).finally(() => {
starting = false;
startButton.disabled = false;
});
}
function createControls(playerNode) {
const style = document.createElement("style");
style.textContent = `
#vip_jx_box {position:fixed; top:120px; left:8px; z-index:2147483647; display:flex; flex-direction:column; gap:6px;}
#vip_jx_box button {width:42px; height:42px; padding:0; border:0; border-radius:10px; color:#fff; font:700 13px/1 "PingFang SC","Microsoft YaHei",sans-serif; cursor:pointer; box-shadow:0 6px 16px rgba(0,0,0,.25);}
#vip_start {background:#6d28d9;}
#vip_reload {background:#be123c;}
#vip_jx_box button:disabled {cursor:wait; opacity:.75;}
`;
document.documentElement.appendChild(style);
const box = document.createElement("div");
box.id = "vip_jx_box";
const startButton = document.createElement("button");
startButton.id = "vip_start";
startButton.type = "button";
startButton.textContent = "解析";
startButton.title = "等官方播放器出来后,点这里再解析";
const reloadButton = document.createElement("button");
reloadButton.id = "vip_reload";
reloadButton.type = "button";
reloadButton.textContent = "刷";
reloadButton.title = "重新加载当前解析";
startButton.addEventListener("click", () => begin(playerNode, startButton));
reloadButton.addEventListener("click", () => {
if (!iframe) {
begin(playerNode, startButton);
return;
}
playingHref = window.location.href;
pendingHref = "";
iframe.src = PARSE_URL + playingHref;
const container = document.querySelector(playerNode.container);
if (container) {
mountPlayer(playerNode, container);
}
});
box.appendChild(startButton);
box.appendChild(reloadButton);
document.body.appendChild(box);
}
return {
start() {
const playerNode = playerContainers.find((value) => value.host === window.location.host);
if (!playerNode) {
console.warn(window.location.host + " 暂不支持");
return;
}
const boot = () => createControls(playerNode);
if (document.body) {
boot();
} else {
document.addEventListener("DOMContentLoaded", boot);
}
}
};
})();
superVip.start();
来源:LinuxDo · linux.do