// ==UserScript== // @name 聚影 · 全网VIP视频解析【1.0 全新界面版】 // @namespace 爱国者 // @version 1.0 // @description 聚合多平台VIP视频免费解析|六边形悬浮球 + 拖拽控制台 + 自定义线路 + 自动换源 + 源健康监测 + 打赏置顶。仅限学习交流! // @author 聚合解析 // @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.youku.com/video/* // @include *://m.mgtv.com/b/* // @include *://m.tv.sohu.com/v/* // @include *://m.pptv.com/show/* // @include *://m.bilibili.com/video/* // @include *://m.bilibili.com/bangumi/play/* // @require https://cdn.jsdmirror.com/npm/jquery@3.7.1/dist/jquery.min.js // @grant unsafeWindow // @grant GM_addStyle // @grant GM_openInTab // @grant GM_getValue // @grant GM_setValue // @grant GM_registerMenuCommand // @grant GM_xmlhttpRequest // @charset UTF-8 // @license GPL License // @tag 免费看剧 // @tag 高清视频 // @run-at document-idle // ==/UserScript== /* ============================================================ * 聚影 1.0 · 界面全面重做 + 能力整合 * ------------------------------------------------------------ * 【本次改版做了什么】 * 1. 全新 UI:左侧六边形悬浮球(收起态只露半个球,几乎不遮挡画面) * → 点开是「聚影控制台」玻璃拟态面板,含顶部打赏横幅、源卡片网格、 * 状态统计条、底部工具条。 * 2. 打赏前置:面板最顶部常驻金色渐变横幅(❤ 支持作者 · 扫码打赏), * 点开即显示微信 / 支付宝双二维码;悬浮球头像点一下也是打赏。 * 收起态下悬浮球下方常驻一枚脉动的 🎁 角标,任何页面都看得到。 * 3. 整合影瞳 v6.3.0 的能力: * - 线路地址统一走 encodeURIComponent 编码(避免 & # 之类的字符截断) * - 「浏览器新窗口播放」独立通道,绕开各家防盗链 / 禁止内嵌 * - 自定义线路:换行分隔「名称 地址」,持久化保存,自动解析 * - 面板可拖拽 + 边界钳制 + 位置记忆 * - 油猴菜单入口 + toast 轻提示 * 4. 线路实测(2026-11-27 复测,详见下方 videoParseList 注释) * ============================================================ */ /* 屏蔽站点自带的 Google / 百度广告脚本(保持原脚本逻辑) */ (function () { const _adPatterns = [/pagead2\.googlesyndication\.com/, /pos\.baidu\.com/, /cpro\.baidu\.com/, /googleadservices\.com/, /googletagmanager\.com/, /hm\.baidu\.com/]; const _origCreate = document.createElement.bind(document); document.createElement = function (tag, opts) { const el = _origCreate(tag, opts); if (tag.toLowerCase() === 'script') { const _origSetAttribute = el.setAttribute.bind(el); el.setAttribute = function (name, value) { if ((name === 'src' || name === 'href') && _adPatterns.some(p => p.test(value))) { console.log('[广告拦截] 已拦截:', value); return; } _origSetAttribute(name, value); }; } return el; }; })(); const util = (function () { let mediaCleanerStarted = false; let mediaPlayBlocked = false; function findTargetElement(targetContainer) { const body = window.document; let tryTime = 0; const maxTryTime = 120; return new Promise((resolve, reject) => { const interval = setInterval(() => { const tabContainer = body.querySelector(targetContainer); if (tabContainer) { clearInterval(interval); resolve(tabContainer); } if ((++tryTime) === maxTryTime) { clearInterval(interval); reject(); } }, 500); }); } function urlChangeReload() { const oldHref = window.location.href; const interval = setInterval(() => { const newHref = window.location.href; if (oldHref !== newHref) { clearInterval(interval); window.location.reload(); } }, 500); } function stopMedia(media) { if (!media) return; try { media.pause(); } catch (e) {} try { media.autoplay = false; media.loop = false; media.muted = true; media.defaultMuted = true; media.volume = 0; media.playbackRate = 1; media.removeAttribute("autoplay"); media.removeAttribute("src"); media.srcObject = null; media.querySelectorAll("source").forEach((node) => node.remove()); if (media.currentSrc || media.srcObject || media.querySelector("source")) { media.load(); } } catch (e) {} } function mutePageMedia(root = document) { if (!root || !root.querySelectorAll) return; root.querySelectorAll("video, audio").forEach((media) => stopMedia(media)); } function blockNativeMediaPlayback() { if (mediaPlayBlocked || !window.HTMLMediaElement) return; mediaPlayBlocked = true; const rawPlay = HTMLMediaElement.prototype.play; HTMLMediaElement.prototype.play = function () { stopMedia(this); return Promise.resolve(); }; document.addEventListener("play", (event) => { if (event.target instanceof HTMLMediaElement) stopMedia(event.target); }, true); document.addEventListener("playing", (event) => { if (event.target instanceof HTMLMediaElement) stopMedia(event.target); }, true); HTMLMediaElement.prototype.play.toString = () => rawPlay.toString(); } function reomveVideo() { if (mediaCleanerStarted) { mutePageMedia(); return; } mediaCleanerStarted = true; blockNativeMediaPlayback(); mutePageMedia(); setInterval(() => mutePageMedia(), 500); const target = document.documentElement || document.body; if (!target || !window.MutationObserver) return; const observer = new MutationObserver((mutations) => { mutations.forEach((mutation) => { if (mutation.type === "attributes" && mutation.target instanceof Element) { if (mutation.target.matches("video, audio")) stopMedia(mutation.target); return; } mutation.addedNodes.forEach((node) => { if (!(node instanceof Element)) return; if (node.matches && node.matches("video, audio")) { stopMedia(node); return; } mutePageMedia(node); }); }); }); observer.observe(target, {childList: true, subtree: true, attributes: true, attributeFilter: ["src", "autoplay"]}); } function syncRequest(option) { return new Promise((resolve, reject) => { option.onload = (res) => resolve(res); option.onerror = (err) => reject(err); GM_xmlhttpRequest(option); }); } return { req: (option) => syncRequest(option), findTargetEle: (targetEle) => findTargetElement(targetEle), urlChangeReload: () => urlChangeReload(), reomveVideo: () => reomveVideo() }; })(); const superVip = (function () { // ============================================================ // 全局配置 // ============================================================ const _CONFIG_ = { isMobile: !!navigator.userAgent.match(/(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i), currentPlayerNode: null, rootId: 'jy_root_' + Math.floor(Math.random() * 1e8), iframeWrapperClass: 'jy_iframe_wrapper', flag: "flag_vip", // 持久化键 autoPlayerKey: "auto_player_key" + window.location.host, autoPlayerVal: "auto_player_value_" + window.location.host, lastGoodKey: "last_good_source" + window.location.host, autoSwitchKey: "auto_switch_enabled" + window.location.host, playModeKey: "play_mode" + window.location.host, // embed | tab customLinesKey: "custom_lines", // 自定义线路(全局) panelPosKey: "panel_pos", // 面板位置 ballPosKey: "ball_pos", // 悬浮球位置 // 自动换源 switchTimeout: 8000, currentSourceIndex: -1, userInteracted: false, watchToken: null, switchTimer: null, cleanupTimer: null, fullscreenCleanupBound: false, triedIndexes: [], // 打赏信息(改这里就能换文案 / 换码) donate: { wxQr: "https://a1.boltp.com/2026/08/31/6a950ca33c5d1.png", aliQr: "https://a1.boltp.com/2026/08/31/6a950ca30913e.jpg", groupUrl: "https://qm.qq.com/q/Kacqy4da26", title: "❤ 支持作者 · 让解析一直免费", subtitle: "纯开源·无广告·零收费 | 你的每一次打赏都会变成下一条可用线路" }, // -------------------------------------------------------- // 线路列表(2026-11-27 复测结论写在每条的 note 里) // type: 1=内嵌播放 3=新窗口播放 可同时包含 // status: ok=实测出画面 / unknown=外壳正常未端到端验证 / bad=确认失效 // -------------------------------------------------------- videoParseList: [ { name: "789解析", url: "https://jiexi.789jiexi.icu:4433/?url=", type: "1,3", status: "ok", note: "腾讯实测返回 code:200 + 真实片名,爱奇艺/优酷返回 404" }, { name: "LX线路", url: "https://jx.lxyy.club/index.php?url=", type: "1,3", status: "ok", note: "LX解析播放器,含播放记忆/评分/弹幕,接受任意视频页地址" }, { name: "臻享视听", url: "https://aibox.eu.org/?url=", type: "1,3", status: "unknown", note: "前端 SPA 播放器(soplayer),解析在浏览器内完成,建议新窗口播放" }, { name: "789备用", url: "https://jiexi.789jiexi.com/?url=", type: "1,3", status: "unknown", note: "789 的精简外壳,内层仍走 api-api.789jiexi.net" }, { name: "云解析", url: "https://yparse.ik9.cc/index.php?url=", type: "1,3", status: "unknown", note: "原 jx.yparse.com 301 迁移到此,页面混淆但播放器脚本齐全" }, { name: "M1907", url: "https://im1907.top/?jx=", type: "1,3", status: "unknown", note: "页面标题标注「演示版」,仅保留兜底" }, { name: "TXNQ", url: "https://bfq.txnp.cn/player?url=", type: "3", status: "unknown", note: "会 302 到 art.txnp.cn,需浏览器会话签名" } ], // 各站点播放器容器选择器 playerContainers: [ { host: "v.qq.com", container: "#mod_player,#player-container,.container-player", name: "Default", displayNodes: ["#mask_layer", ".mod_vip_popup", "#mask_layer", ".panel-tip-pay"] }, { host: "m.v.qq.com", container: ".mod_player,#player", name: "Default", 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", name: "Default", displayNodes: []}, {host: "www.mgtv.com", container: "#mgtv-player-wrap", name: "Default", displayNodes: []}, { host: "m.mgtv.com", container: ".video-area", name: "Default", 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", name: "Default", displayNodes: []}, {host: "m.bilibili.com", container: ".player-wrapper,.player-container,.mplayer", name: "Default", displayNodes: []}, {host: "www.iqiyi.com", container: "#areaLeftContainer,#outlayer,.iqp-player-videolayer", name: "Default", 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", name: "Default", 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", name: "Default", displayNodes: []}, {host: "v.youku.com", container: ".player-container,#ykPlayer,#playerMouseWheel", name: "Default", 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-dashboard-bar-container", "#youku-dashboard > div.kui-dashboard-dashboard-timer-container", "#video_side_cashier", ".secondary-container.video_side_cashier_wrapper"]}, {host: "m.youku.com", container: "#playerMouseWheel,.h5-detail-player", name: "Default", displayNodes: []}, {host: "tv.sohu.com", container: "#player", name: "Default", displayNodes: []}, {host: "film.sohu.com", container: "#playerWrap", name: "Default", displayNodes: []}, {host: "www.le.com", container: "#le_playbox", name: "Default", displayNodes: []}, {host: "video.tudou.com", container: ".td-playbox", name: "Default", displayNodes: []}, {host: "v.pptv.com", container: "#pptv_playpage_box", name: "Default", displayNodes: []}, {host: "vip.pptv.com", container: ".w-video", name: "Default", displayNodes: []}, {host: "www.wasu.cn", container: "#flashContent", name: "Default", displayNodes: []}, {host: "www.acfun.cn", container: "#player", name: "Default", displayNodes: []}, {host: "vip.1905.com", container: "#player,#vodPlayer", name: "Default", displayNodes: []}, {host: "www.1905.com", container: "#player,#vodPlayer", name: "Default", displayNodes: []} ] }; // ============================================================ // 小工具 // ============================================================ function esc(str) { return String(str == null ? '' : str) .replace(/&/g, '&').replace(//g, '>') .replace(/"/g, '"').replace(/'/g, '''); } // 影瞳同款:线路地址统一编码,避免目标 URL 里的 & # ? 截断参数 function buildParseUrl(base, pageUrl) { return base + encodeURIComponent(pageUrl || window.location.href); } function clamp(v, min, max) { return Math.max(min, Math.min(max, v)); } // 轻提示(替代 alert,不打断播放) let toastTimer = null; function toast(msg, dur = 2200) { let el = document.getElementById('jy_toast'); if (!el) { el = document.createElement('div'); el.id = 'jy_toast'; el.style.cssText = [ 'position:fixed', 'left:50%', 'bottom:96px', 'transform:translateX(-50%) translateY(12px)', 'z-index:2147483647', 'padding:11px 22px', 'border-radius:999px', 'background:rgba(8,12,26,.94)', 'border:1px solid rgba(96,165,250,.55)', 'color:#e8eefc', 'font-size:13px', 'font-weight:600', 'letter-spacing:.4px', 'font-family:"PingFang SC","Microsoft YaHei",system-ui,sans-serif', 'box-shadow:0 8px 32px rgba(0,0,0,.5),0 0 24px rgba(59,130,246,.28)', 'opacity:0', 'transition:opacity .22s ease, transform .22s ease', 'pointer-events:none', 'max-width:76vw', 'text-align:center', 'line-height:1.5' ].join(';'); document.body.appendChild(el); } el.textContent = msg; requestAnimationFrame(() => { el.style.opacity = '1'; el.style.transform = 'translateX(-50%) translateY(0)'; }); clearTimeout(toastTimer); toastTimer = setTimeout(() => { el.style.opacity = '0'; el.style.transform = 'translateX(-50%) translateY(12px)'; }, dur); } function parseCustomLines(raw) { if (!raw) return []; return String(raw).split(/\r?\n/).map((line) => { const s = line.trim(); if (!s || s.startsWith('#')) return null; const m = s.match(/^(\S+)\s*[|,]?\s*(https?:\/\/.+)$/); if (!m) return null; return {name: m[1].slice(0, 10), url: m[2].trim(), type: '1,3', status: 'unknown', custom: true}; }).filter(Boolean); } // 当前生效的线路 = 内置 + 自定义 function allSources() { return _CONFIG_.videoParseList; } // ============================================================ // 样式(一次性注入) // ============================================================ function injectGlobalStyle() { if (document.getElementById('jy_base_style')) return; const style = document.createElement('style'); style.id = 'jy_base_style'; style.textContent = ` @property --jy-angle { syntax:''; initial-value:0deg; inherits:false; } #__ROOT__ { position: fixed; z-index: 2147483647; font-family: "PingFang SC","Microsoft YaHei","Segoe UI",system-ui,-apple-system,sans-serif; -webkit-font-smoothing: antialiased; text-align: left; line-height: 1.45; } #__ROOT__, #__ROOT__ * { box-sizing: border-box; } #__ROOT__ button { font-family: inherit; } /* ============ 悬浮球 ============ */ .jy-ball { position: relative; width: 62px; height: 62px; cursor: pointer; display: flex; align-items: center; justify-content: center; clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: linear-gradient(150deg,#1b2559 0%,#0d1230 58%,#161b46 100%); transition: transform .26s cubic-bezier(.34,1.56,.64,1), filter .26s ease; filter: drop-shadow(0 6px 16px rgba(0,0,0,.55)) drop-shadow(0 0 14px rgba(99,102,241,.5)); user-select: none; } .jy-ball::after { content: ''; position: absolute; inset: 0; clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%); background: conic-gradient(from var(--jy-angle), #22d3ee, #6366f1, #d946ef, #f59e0b, #22d3ee); animation: jySpin 5s linear infinite; -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%); pointer-events: none; } .jy-ball:hover { transform: scale(1.09) rotate(-4deg); filter: drop-shadow(0 8px 22px rgba(0,0,0,.6)) drop-shadow(0 0 26px rgba(129,140,248,.85)); } @keyframes jySpin { to { --jy-angle: 360deg; } } .jy-ball-core { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; } .jy-ball-core .glyph { font-size: 19px; font-weight: 900; letter-spacing: -.5px; background: linear-gradient(135deg,#fff 10%,#a5f3fc 50%,#c4b5fd 90%); -webkit-background-clip: text; background-clip: text; color: transparent; } .jy-ball-core .sub { font-size: 8px; font-weight: 700; color: #7dd3fc; letter-spacing: 2px; margin-top: 3px; opacity: .9; } /* 收起态只露半个球 */ .jy-ball.mini { clip-path: polygon(0 0, 46% 0, 46% 100%, 0 100%); border-radius: 0 30px 30px 0; width: 26px; height: 86px; } .jy-ball.mini::after { display: none; } .jy-ball.mini .jy-ball-core { transform: scale(.86); } .jy-ball.mini .jy-ball-core .sub { display: none; } .jy-ball.mini .jy-gift-badge { right: -6px; } /* 收起态常驻打赏角标 */ .jy-gift-badge { position: absolute; right: -9px; bottom: 2px; z-index: 3; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 11px; background: linear-gradient(140deg,#fbbf24,#f97316); box-shadow: 0 0 0 2px rgba(10,14,30,.9), 0 0 14px rgba(251,191,36,.9); animation: jyBeat 1.6s ease-in-out infinite; } @keyframes jyBeat { 0%,100%{transform:scale(1)} 50%{transform:scale(1.16)} } /* ============ 控制台面板 ============ */ .jy-panel { position: absolute; width: 396px; max-height: 82vh; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: linear-gradient(168deg, rgba(17,23,48,.97) 0%, rgba(9,12,28,.98) 100%); border: 1px solid rgba(129,140,248,.32); box-shadow: 0 28px 80px rgba(0,0,0,.72), 0 0 0 1px rgba(255,255,255,.04) inset, 0 0 60px rgba(99,102,241,.16); backdrop-filter: blur(26px) saturate(1.3); transform-origin: left center; animation: jyPanelIn .3s cubic-bezier(.2,1.2,.4,1); color: #dbe3f7; } @keyframes jyPanelIn { from { opacity: 0; transform: scale(.94) translateX(-14px); } } .jy-panel::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,#22d3ee,#818cf8,#d946ef,#fbbf24,#22d3ee); background-size: 300% 100%; animation: jySweep 4s linear infinite; } @keyframes jySweep { to { background-position: 300% 0; } } /* 打赏横幅(置顶、常驻、最显眼) */ .jy-donate-bar { position: relative; flex: 0 0 auto; cursor: pointer; padding: 13px 15px 13px 14px; display: flex; align-items: center; gap: 11px; background: linear-gradient(100deg, rgba(251,191,36,.22) 0%, rgba(249,115,22,.16) 46%, rgba(217,70,239,.18) 100%); border-bottom: 1px solid rgba(251,191,36,.42); overflow: hidden; transition: filter .2s ease; } .jy-donate-bar:hover { filter: brightness(1.16); } .jy-donate-bar::after { content: ''; position: absolute; top: 0; left: -120%; width: 55%; height: 100%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.24), transparent); animation: jyShine 3.4s ease-in-out infinite; } @keyframes jyShine { 0%{left:-120%} 55%{left:130%} 100%{left:130%} } .jy-donate-bar .db-icon { flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 21px; background: linear-gradient(140deg,#fbbf24,#f97316); box-shadow: 0 0 18px rgba(251,191,36,.7), 0 0 0 1px rgba(255,255,255,.3) inset; animation: jyBeat 1.8s ease-in-out infinite; } .jy-donate-bar .db-txt { flex: 1 1 auto; min-width: 0; } .jy-donate-bar .db-title { font-size: 13.5px; font-weight: 800; color: #ffe9a8; letter-spacing: .3px; text-shadow: 0 0 12px rgba(251,191,36,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .jy-donate-bar .db-sub { font-size: 10.5px; color: #fcd9a0; opacity: .88; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .jy-donate-bar .db-go { flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; font-size: 11.5px; font-weight: 800; color: #422006; white-space: nowrap; background: linear-gradient(135deg,#fde047,#fbbf24); box-shadow: 0 3px 12px rgba(251,191,36,.5); } /* 头部 */ .jy-head { flex: 0 0 auto; display: flex; align-items: center; gap: 9px; padding: 12px 14px 11px; cursor: move; border-bottom: 1px solid rgba(255,255,255,.06); background: rgba(255,255,255,.024); } .jy-head .h-logo { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px; display: flex; align-items: center; justify-content: center; background: linear-gradient(140deg,#6366f1,#22d3ee); font-size: 13px; font-weight: 900; color: #04101f; } .jy-head .h-name { font-size: 14px; font-weight: 800; color: #f1f5ff; letter-spacing: .6px; } .jy-head .h-ver { font-size: 9.5px; font-weight: 700; color: #67e8f9; padding: 2px 7px; border-radius: 999px; background: rgba(34,211,238,.14); border: 1px solid rgba(34,211,238,.34); } .jy-head .h-spacer { flex: 1 1 auto; } .jy-head .h-btn { width: 26px; height: 26px; border-radius: 8px; border: none; flex: 0 0 26px; background: rgba(255,255,255,.07); color: #93a4c8; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: all .18s ease; } .jy-head .h-btn:hover { background: rgba(248,113,113,.24); color: #fecaca; transform: scale(1.08); } /* 状态统计条 */ .jy-stats { flex: 0 0 auto; display: flex; gap: 7px; padding: 10px 14px 2px; } .jy-stats .st { flex: 1 1 0; padding: 7px 4px; border-radius: 11px; text-align: center; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); } .jy-stats .st b { display: block; font-size: 15px; font-weight: 800; line-height: 1.15; } .jy-stats .st span { font-size: 9.5px; color: #8fa0c4; letter-spacing: .5px; } .jy-stats .st.ok b { color: #34d399; } .jy-stats .st.unk b { color: #94a3b8; } .jy-stats .st.bad b { color: #f87171; } /* 滚动区 */ .jy-body { flex: 1 1 auto; overflow-y: auto; padding: 11px 14px 4px; } .jy-body::-webkit-scrollbar { width: 4px; } .jy-body::-webkit-scrollbar-thumb { background: rgba(99,102,241,.65); border-radius: 9px; } .jy-body::-webkit-scrollbar-track { background: transparent; } .jy-sec-label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: 1.4px; color: #7c8db3; margin: 4px 0 8px; text-transform: uppercase; } .jy-sec-label::after { content: ''; flex: 1 1 auto; height: 1px; background: rgba(255,255,255,.08); } /* 线路卡片 */ .jy-grid { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; } .jy-card { position: relative; display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 13px; cursor: pointer; background: rgba(255,255,255,.038); border: 1px solid rgba(255,255,255,.075); transition: all .19s ease; } .jy-card:hover { background: rgba(99,102,241,.16); border-color: rgba(129,140,248,.6); transform: translateX(3px); box-shadow: -3px 0 0 0 #818cf8, 0 6px 18px rgba(0,0,0,.32); } .jy-card.active { background: linear-gradient(100deg, rgba(34,211,238,.2), rgba(99,102,241,.13)); border-color: rgba(34,211,238,.72); box-shadow: 0 0 0 1px rgba(34,211,238,.5), 0 8px 22px rgba(34,211,238,.2); } .jy-card.is-bad { opacity: .46; } .jy-card.is-bad .c-name { text-decoration: line-through; text-decoration-color: rgba(248,113,113,.7); } .jy-card .c-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; } .c-dot.ok { background: #34d399; box-shadow: 0 0 8px #34d399; } .c-dot.unknown { background: #64748b; } .c-dot.bad { background: #f87171; box-shadow: 0 0 8px #f87171; } .jy-card .c-main { flex: 1 1 auto; min-width: 0; } .jy-card .c-name { font-size: 13px; font-weight: 700; color: #e6ecfb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .jy-card .c-note { font-size: 10px; color: #7e8fb4; margin-top: 2px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .jy-card .c-tag { flex: 0 0 auto; font-size: 9px; font-weight: 800; padding: 2px 6px; border-radius: 5px; letter-spacing: .4px; } .c-tag.t-ok { color: #6ee7b7; background: rgba(52,211,153,.16); border: 1px solid rgba(52,211,153,.4); } .c-tag.t-unknown { color: #a3b1cc; background: rgba(148,163,184,.13); border: 1px solid rgba(148,163,184,.3); } .c-tag.t-bad { color: #fca5a5; background: rgba(248,113,113,.14); border: 1px solid rgba(248,113,113,.36); } .c-tag.t-mine { color: #c4b5fd; background: rgba(167,139,250,.16); border: 1px solid rgba(167,139,250,.4); } .jy-card .c-tab { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; border: none; background: rgba(255,255,255,.07); color: #a5b4fc; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 12px; transition: all .16s ease; } .jy-card .c-tab:hover { background: rgba(251,191,36,.24); color: #fde047; transform: scale(1.1); } /* 底部工具条 */ .jy-foot { flex: 0 0 auto; display: flex; gap: 7px; padding: 10px 14px 12px; border-top: 1px solid rgba(255,255,255,.07); background: rgba(0,0,0,.28); } .jy-tool { flex: 1 1 0; padding: 9px 4px; border-radius: 11px; cursor: pointer; border: 1px solid rgba(255,255,255,.09); background: rgba(255,255,255,.045); color: #b9c6e2; font-size: 10.5px; font-weight: 700; text-align: center; transition: all .18s ease; user-select: none; } .jy-tool .ti { display: block; font-size: 15px; margin-bottom: 3px; line-height: 1; } .jy-tool:hover { background: rgba(99,102,241,.2); border-color: rgba(129,140,248,.55); color: #fff; } .jy-tool.on { background: rgba(52,211,153,.17); border-color: rgba(52,211,153,.6); color: #6ee7b7; box-shadow: 0 0 14px rgba(52,211,153,.24); } .jy-tool.warn { background: rgba(251,191,36,.16); border-color: rgba(251,191,36,.6); color: #fde047; } /* ============ 打赏弹层 ============ */ .jy-donate-mask { position: fixed; inset: 0; z-index: 2147483648; display: flex; align-items: center; justify-content: center; background: rgba(3,6,18,.78); backdrop-filter: blur(9px); animation: jyFade .24s ease; } @keyframes jyFade { from { opacity: 0; } } .jy-donate-card { position: relative; width: 470px; max-width: 94vw; max-height: 92vh; overflow-y: auto; padding: 26px 24px 22px; border-radius: 26px; text-align: center; background: linear-gradient(165deg, rgba(28,20,6,.97), rgba(10,12,26,.985)); border: 1.5px solid rgba(251,191,36,.5); box-shadow: 0 30px 90px rgba(0,0,0,.8), 0 0 70px rgba(251,191,36,.2); animation: jyPopIn .32s cubic-bezier(.2,1.3,.4,1); color: #e7edfb; } @keyframes jyPopIn { from { opacity: 0; transform: scale(.9) translateY(18px); } } .jy-donate-card .dc-close { position: absolute; top: 12px; right: 15px; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer; font-size: 13px; background: rgba(255,255,255,.08); color: #cbd5e1; display: flex; align-items: center; justify-content: center; transition: all .22s ease; } .jy-donate-card .dc-close:hover { background: rgba(248,113,113,.28); color: #fff; transform: rotate(90deg); } .jy-donate-card .dc-crown { font-size: 32px; line-height: 1; margin-bottom: 6px; animation: jyBeat 1.9s ease-in-out infinite; } .jy-donate-card h3 { margin: 0 0 5px; font-size: 20px; font-weight: 900; letter-spacing: .5px; background: linear-gradient(100deg,#fde047,#fbbf24,#fb923c,#fde047); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: jySweep 3.6s linear infinite; } .jy-donate-card .dc-sub { font-size: 12px; color: #d9b98a; margin: 0 0 16px; line-height: 1.6; } .jy-donate-card .dc-qrs { display: flex; gap: 16px; justify-content: center; margin-bottom: 14px; } .jy-donate-card .dc-qr { flex: 0 1 190px; max-width: 46%; } .jy-donate-card .dc-qr .box { padding: 7px; border-radius: 15px; background: #fff; border: 2px solid rgba(251,191,36,.55); box-shadow: 0 0 24px rgba(251,191,36,.24); transition: transform .22s ease; } .jy-donate-card .dc-qr:hover .box { transform: translateY(-3px) scale(1.03); } .jy-donate-card .dc-qr img { width: 100%; display: block; border-radius: 9px; } .jy-donate-card .dc-qr .lb { margin-top: 7px; font-size: 11.5px; font-weight: 800; letter-spacing: 1.6px; } .jy-donate-card .dc-qr.wx .lb { color: #4ade80; } .jy-donate-card .dc-qr.ali .lb { color: #60a5fa; } .jy-donate-card .dc-note { font-size: 11.5px; color: #9fb0cf; line-height: 1.75; padding: 10px 14px; border-radius: 13px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.07); margin-bottom: 13px; } .jy-donate-card .dc-note b { color: #fde047; } .jy-donate-card .dc-group { display: inline-flex; align-items: center; gap: 6px; padding: 9px 22px; border-radius: 999px; cursor: pointer; font-size: 12.5px; font-weight: 800; color: #7dd3fc; background: rgba(125,211,252,.12); border: 1px solid rgba(125,211,252,.5); transition: all .22s ease; text-decoration: none; } .jy-donate-card .dc-group:hover { background: rgba(125,211,252,.26); color: #fff; border-color: #38bdf8; transform: scale(1.04); box-shadow: 0 0 22px rgba(56,189,248,.42); } /* ============ 自定义线路弹层 ============ */ .jy-cfg-card { width: 460px; max-width: 94vw; padding: 22px 22px 18px; border-radius: 22px; background: linear-gradient(165deg, rgba(15,20,44,.98), rgba(8,11,24,.99)); border: 1.5px solid rgba(129,140,248,.45); box-shadow: 0 30px 90px rgba(0,0,0,.8), 0 0 60px rgba(99,102,241,.22); animation: jyPopIn .3s cubic-bezier(.2,1.3,.4,1); color: #dbe3f7; text-align: left; } .jy-cfg-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 800; color: #e9eeff; } .jy-cfg-card .hint { font-size: 11px; color: #8194b8; line-height: 1.7; margin-bottom: 11px; } .jy-cfg-card .hint code { color: #67e8f9; background: rgba(34,211,238,.12); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, Menlo, Consolas, monospace; } .jy-cfg-card textarea { width: 100%; height: 158px; resize: vertical; padding: 11px 12px; border-radius: 12px; font-size: 12px; line-height: 1.7; background: rgba(0,0,0,.42); border: 1px solid rgba(255,255,255,.13); color: #dbeafe; outline: none; font-family: ui-monospace, Menlo, Consolas, monospace; } .jy-cfg-card textarea:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.18); } .jy-cfg-card .row { display: flex; gap: 9px; margin-top: 12px; } .jy-cfg-card .btn { flex: 1 1 0; padding: 10px; border-radius: 11px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.055); color: #c7d2fe; font-size: 12.5px; font-weight: 800; cursor: pointer; transition: all .18s ease; } .jy-cfg-card .btn:hover { background: rgba(255,255,255,.11); } .jy-cfg-card .btn.primary { background: linear-gradient(135deg,#6366f1,#22d3ee); color: #04121f; border-color: transparent; box-shadow: 0 6px 20px rgba(99,102,241,.42); } .jy-cfg-card .btn.primary:hover { filter: brightness(1.12); transform: translateY(-1px); } /* ============ 兜底卡片 / 换源提示 ============ */ .jy-fallback { position: absolute; inset: 0; z-index: 2147483645; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; padding: 18px 22px; text-align: center; background: radial-gradient(circle at 50% 38%, rgba(34,25,68,.97), rgba(4,6,16,.99)); color: #e0e7ff; font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; } .jy-fallback .fb-title { font-size: 17px; font-weight: 800; color: #fca5a5; letter-spacing: .5px; } .jy-fallback .fb-reason { font-size: 12px; color: #94a3b8; line-height: 1.8; max-width: 540px; } .jy-fallback .fb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; } .jy-fallback .fb-btn { padding: 8px 20px; border-radius: 999px; font-size: 12.5px; font-weight: 700; cursor: pointer; text-decoration: none !important; transition: all .22s ease; border: 1px solid rgba(125,211,252,.5); background: rgba(125,211,252,.12); color: #7dd3fc; } .jy-fallback .fb-btn:hover { background: rgba(125,211,252,.28); color: #fff; transform: scale(1.04); } .jy-fallback .fb-btn.primary { border-color: rgba(52,211,153,.6); background: rgba(52,211,153,.16); color: #6ee7b7; } .jy-switch-tip { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 2147483646; padding: 6px 16px; border-radius: 999px; background: rgba(8,12,26,.9); border: 1px solid rgba(52,211,153,.45); color: #6ee7b7; font-size: 12px; letter-spacing: .4px; font-family: "PingFang SC","Microsoft YaHei",system-ui,sans-serif; white-space: nowrap; pointer-events: none; box-shadow: 0 0 20px rgba(52,211,153,.24); } /* 窄屏 */ @media (max-width: 560px) { .jy-panel { width: calc(100vw - 40px); max-width: 380px; } .jy-donate-card .dc-qrs { flex-direction: column; align-items: center; gap: 12px; } .jy-donate-card .dc-qr { max-width: 78%; flex-basis: auto; width: 200px; } } `.replace(/__ROOT__/g, _CONFIG_.rootId); document.head.appendChild(style); } // ============================================================ // 悬浮球 + 控制台 // ============================================================ function createConsole() { injectGlobalStyle(); const root = document.createElement('div'); root.id = _CONFIG_.rootId; // ---- 位置恢复 ---- const savedBall = GM_getValue(_CONFIG_.ballPosKey, null); root.style.left = (savedBall && savedBall.left != null ? savedBall.left : 10) + 'px'; root.style.top = (savedBall && savedBall.top != null ? savedBall.top : Math.max(80, Math.round(window.innerHeight * 0.4))) + 'px'; const ball = document.createElement('div'); ball.className = 'jy-ball'; ball.title = '聚影 · 点击展开控制台 | 拖动可移动 | 点 🎁 打赏'; ball.innerHTML = `
聚影 VIP
🎁 `; root.appendChild(ball); const panel = document.createElement('div'); panel.className = 'jy-panel'; panel.style.display = 'none'; root.appendChild(panel); if (document.body) document.body.appendChild(root); else document.documentElement.appendChild(root); let panelOpen = false; function openPanel() { panelOpen = true; ball.classList.remove('mini'); ball.style.display = 'none'; panel.style.display = 'flex'; renderPanel(); positionPanel(); } function closePanel(collapse) { panelOpen = false; panel.style.display = 'none'; ball.style.display = 'flex'; if (collapse) ball.classList.add('mini'); } // 面板相对悬浮球定位,并做边界钳制 function positionPanel() { const bw = 396, bh = Math.min(window.innerHeight * 0.82, panel.offsetHeight || 520); let left = 74; if (root.offsetLeft + left + bw > window.innerWidth - 8) { left = -(bw + 14); } let top = -20; const absTop = root.offsetTop + top; if (absTop < 8) top = 8 - root.offsetTop; if (root.offsetTop + top + bh > window.innerHeight - 8) { top = Math.max(8 - root.offsetTop, window.innerHeight - 8 - bh - root.offsetTop); } panel.style.left = left + 'px'; panel.style.top = top + 'px'; } window.addEventListener('resize', () => { if (panelOpen) positionPanel(); }); // ---- 拖动(球 / 面板头部都能拖,带边界钳制 + 位置记忆) ---- function makeDraggable(handle, opts) { let dragging = false, startX = 0, startY = 0, origL = 0, origT = 0, moved = false; handle.addEventListener('pointerdown', (e) => { if (opts && opts.ignore && e.target.closest(opts.ignore)) return; if (e.button !== 0) return; dragging = true; moved = false; startX = e.clientX; startY = e.clientY; origL = root.offsetLeft; origT = root.offsetTop; try { handle.setPointerCapture(e.pointerId); } catch (err) {} if (opts && opts.onDown) opts.onDown(e); }); handle.addEventListener('pointermove', (e) => { if (!dragging) return; const dx = e.clientX - startX, dy = e.clientY - startY; if (Math.abs(dx) > 3 || Math.abs(dy) > 3) moved = true; const w = root.offsetWidth || 62, h = root.offsetHeight || 62; root.style.left = clamp(origL + dx, 0, window.innerWidth - Math.max(w, 26) - 2) + 'px'; root.style.top = clamp(origT + dy, 0, window.innerHeight - h - 2) + 'px'; if (panelOpen) positionPanel(); }); const end = (e) => { if (!dragging) return; dragging = false; try { handle.releasePointerCapture(e.pointerId); } catch (err) {} GM_setValue(_CONFIG_.ballPosKey, {left: root.offsetLeft, top: root.offsetTop}); if (opts && opts.onUp) opts.onUp(moved); }; handle.addEventListener('pointerup', end); handle.addEventListener('pointercancel', end); } // ---- 悬浮球交互 ---- let ballMoved = false; makeDraggable(ball, { ignore: '.jy-gift-badge', onDown: () => { ballMoved = false; }, onUp: (moved) => { ballMoved = moved; } }); ball.addEventListener('click', (e) => { if (ballMoved) { ballMoved = false; return; } if (e.target.closest('.jy-gift-badge')) { e.stopPropagation(); showDonate(); return; } openPanel(); }); // 收起态双击直接打赏(不干扰单击展开) ball.addEventListener('dblclick', (e) => { e.stopPropagation(); showDonate(); }); return {root, ball, panel, openPanel, closePanel, renderPanel, positionPanel, makeDraggable, isOpen: () => panelOpen}; } // ============================================================ // 面板内容渲染 // ============================================================ let ui = null; function statusCount() { let ok = 0, unk = 0, bad = 0; allSources().forEach((s) => { if (s.status === 'ok') ok++; else if (s.status === 'bad') bad++; else unk++; }); return {ok, unk, bad, total: allSources().length}; } function renderPanel() { if (!ui) return; const st = statusCount(); const mode = GM_getValue(_CONFIG_.playModeKey, 'embed'); const autoSwitchOn = GM_getValue(_CONFIG_.autoSwitchKey, 'on') !== 'off'; const autoPlayOn = !!GM_getValue(_CONFIG_.autoPlayerKey, null); const cards = allSources().map((s, i) => { const tagCls = s.status === 'ok' ? 't-ok' : (s.status === 'bad' ? 't-bad' : (s.custom ? 't-mine' : 't-unknown')); const tagTxt = s.status === 'ok' ? '可用' : (s.status === 'bad' ? '失效' : (s.custom ? '自建' : '待测')); return `
${esc(s.name)} ${esc(s.note || (s.url || '').replace(/^https?:\/\//, ''))} ${tagTxt}
`; }).join(''); ui.panel.innerHTML = `
🎁
${esc(_CONFIG_.donate.title)}
${esc(_CONFIG_.donate.subtitle)}
扫码打赏 ›
聚影控制台 v1.0
${st.ok}可用
${st.unk}待测
${st.bad}失效
${st.total}总线路
线路列表
${cards}
使用说明
· 点线路卡片=按当前播放方式打开;点右侧 ⤴ =新窗口打开
· 圆点:● 已验证出画面 ● 待测 ● 本次失效
· 解析站变动极快,全部失败请先「换一条」或稍后再试
${mode === 'embed' ? '▣' : '⤴'}${mode === 'embed' ? '内嵌' : '新窗'}
⇄自动换源
⚡自动解析
⟳刷新
+自定义
`; bindPanelEvents(); if (ui.isOpen()) ui.positionPanel(); } function bindPanelEvents() { const panel = ui.panel; // 拖拽:头部 ui.makeDraggable(panel.querySelector('#jy_panel_head'), {}); // 按钮区不触发拖拽干扰点击:pointerdown 已被头部限制 panel.onclick = (e) => { const actEl = e.target.closest('[data-act]'); if (actEl) { const act = actEl.dataset.act; if (act === 'donate') return showDonate(); if (act === 'hide') return ui.closePanel(true); if (act === 'off') { ui.root.remove(); document.getElementById('jy_toast')?.remove(); return; } if (act === 'mode') { const cur = GM_getValue(_CONFIG_.playModeKey, 'embed'); const next = cur === 'embed' ? 'tab' : 'embed'; GM_setValue(_CONFIG_.playModeKey, next); toast(next === 'embed' ? '已切换到「内嵌播放」' : '已切换到「新窗口播放」'); renderPanel(); return; } if (act === 'switch') { const on = GM_getValue(_CONFIG_.autoSwitchKey, 'on') !== 'off'; GM_setValue(_CONFIG_.autoSwitchKey, on ? 'off' : 'on'); toast(on ? '自动换源已关闭' : '自动换源已开启(8 秒没画面自动换)'); renderPanel(); return; } if (act === 'auto') { if (!!GM_getValue(_CONFIG_.autoPlayerKey, null)) { GM_setValue(_CONFIG_.autoPlayerKey, null); toast('已关闭自动解析,刷新后生效'); } else { GM_setValue(_CONFIG_.autoPlayerKey, 'true'); toast('已开启自动解析,刷新后生效'); } renderPanel(); return; } if (act === 'reload') { doReload(); return; } if (act === 'custom') { showCustomEditor(); return; } } // 新窗口打开 const tabBtn = e.target.closest('[data-tab]'); if (tabBtn) { e.stopPropagation(); const idx = parseInt(tabBtn.dataset.tab, 10); openInTab(allSources()[idx]); return; } // 线路卡片(外层点击区域在 .jy-card 本身) const card = e.target.closest('.jy-card'); if (card) { const idx = parseInt(card.dataset.idx, 10); playSource(idx, false); } }; } // ============================================================ // 打开方式 // ============================================================ function openInTab(src) { if (!src) return; const target = buildParseUrl(src.url, window.location.href); // 影瞳同款通道:新标签页,天然绕开防盗链与禁止内嵌 const w = GM_openInTab(target, {active: true, insert: true, setParent: true}); toast('已在新标签页打开:' + src.name); return w; } function playSource(index, isAuto) { const src = allSources()[index]; if (!src) return; const mode = GM_getValue(_CONFIG_.playModeKey, 'embed'); if (src.status === 'bad' && !isAuto) { toast('该线路已被标记失效,仍要尝试…'); } if (mode === 'tab' || !src.type.includes('1')) { openInTab(src); _CONFIG_.currentSourceIndex = index; } else { showPlayerWindow(src, index, isAuto); } GM_setValue(_CONFIG_.autoPlayerVal, index); GM_setValue(_CONFIG_.flag, 'true'); renderPanel(); if (ui && ui.isOpen()) ui.closePanel(true); } // ============================================================ // 打赏弹层 / 自定义线路弹层 // ============================================================ function showDonate() { const old = document.getElementById('jy_donate_mask'); if (old) old.remove(); const mask = document.createElement('div'); mask.id = 'jy_donate_mask'; mask.className = 'jy-donate-mask'; mask.innerHTML = `
👑

${esc(_CONFIG_.donate.title)}

${esc(_CONFIG_.donate.subtitle)}

微信收款码
微 信
支付宝收款码
支 付 宝
❤ 感谢每一位支持者
本脚本完全免费、开源、无广告。服务器与线路维护全靠大家的心意支撑,
你的每一分打赏,都会变成下一条还能用的解析线路。
💬 加入反馈群 · 报失效线路
`; document.body.appendChild(mask); const close = () => mask.remove(); mask.addEventListener('click', (e) => { if (e.target === mask || e.target.dataset.x) return close(); if (e.target.closest('[data-group]')) { GM_openInTab(_CONFIG_.donate.groupUrl, {active: true, insert: true, setParent: true}); close(); } }); const onKey = (e) => { if (e.key === 'Escape') { close(); document.removeEventListener('keydown', onKey); } }; document.addEventListener('keydown', onKey); mask.querySelectorAll('img').forEach((img) => { img.onerror = () => { const d = document.createElement('div'); d.style.cssText = 'padding:44px 8px;color:#fbbf24;font-size:12px;text-align:center;line-height:1.7;'; d.textContent = '二维码加载失败,请检查网络'; img.replaceWith(d); }; }); } function showCustomEditor() { const old = document.getElementById('jy_cfg_mask'); if (old) old.remove(); const mask = document.createElement('div'); mask.id = 'jy_cfg_mask'; mask.className = 'jy-donate-mask'; mask.innerHTML = `

+ 自定义解析线路

每行一条,格式:名称 地址(中间空格或 | 均可)。留空表示恢复默认。
待替换的目标地址会自动接在「地址」后面,示例:
我的线路 https://jx.example.com/?url=
`; document.body.appendChild(mask); const ta = mask.querySelector('#jy_cfg_text'); ta.value = GM_getValue(_CONFIG_.customLinesKey, '') || ''; ta.focus(); const close = () => mask.remove(); mask.addEventListener('click', (e) => { if (e.target === mask) return close(); const btn = e.target.closest('[data-c]'); if (!btn) return; if (btn.dataset.c === 'cancel') return close(); const raw = ta.value; const parsed = parseCustomLines(raw); if (raw.trim() && !parsed.length) { toast('格式不对:请写成「名称 地址」'); return; } GM_setValue(_CONFIG_.customLinesKey, raw); rebuildSources(); toast(`已保存 ${parsed.length} 条自定义线路`); close(); renderPanel(); }); } // 内置 + 自定义合并 function rebuildSources() { const base = _CONFIG_.baseList || []; const custom = parseCustomLines(GM_getValue(_CONFIG_.customLinesKey, '')).map((it, i) => { const old = (_CONFIG_.customCache || []).find(o => o.url === it.url); if (old && old.status) it.status = old.status; return it; }); _CONFIG_.customCache = custom; _CONFIG_.videoParseList = base.concat(custom); } // ============================================================ // 播放器布局 // ============================================================ function buildPlayerFrameLayout({isMobile, containerRect = {}, containerStyle = {}, viewportHeight = 0}) { const num = (v) => { const n = Number.parseFloat(v); return Number.isFinite(n) ? n : 0; }; if (!isMobile) { return { containerStyles: {overflow: 'hidden'}, wrapperStyles: { position: 'absolute', top: '0', left: '0', width: '100%', height: '100%', background: '#000', overflow: 'hidden', zIndex: '2147483646' }, iframeStyles: {width: '100%', height: '100%', border: 'none', display: 'block', background: '#000'} }; } const width = num(containerRect.width); const height = num(containerRect.height); const paddingTop = num(containerStyle.paddingTop); const ratioHeight = width > 0 ? Math.round((width * 9) / 16) : 0; const fallbackHeight = viewportHeight > 0 ? Math.round(viewportHeight * 0.32) : 180; const rawHeight = height || paddingTop || ratioHeight || fallbackHeight; const maxHeight = viewportHeight > 0 ? Math.max(220, Math.round(viewportHeight * 0.7)) : rawHeight; const resolvedHeight = Math.max(180, Math.min(rawHeight, maxHeight)); const usesPaddingAspect = width > 0 && paddingTop > 0 && (paddingTop / width) > 0.25; return { containerStyles: { overflow: 'hidden', height: 'auto', minHeight: `${resolvedHeight}px`, ...(usesPaddingAspect ? {paddingTop: '0'} : {}) }, wrapperStyles: { position: 'relative', display: 'block', width: '100%', minHeight: `${resolvedHeight}px`, aspectRatio: '16 / 9', background: '#000', overflow: 'hidden', zIndex: '2147483646' }, iframeStyles: {position: 'absolute', inset: '0', width: '100%', height: '100%', border: 'none', display: 'block', background: '#000'} }; } function applyInlineStyles(el, styles) { Object.entries(styles || {}).forEach(([k, v]) => { if (v === undefined || v === null || v === '') return; el.style[k] = v; }); } // ============================================================ // 源状态 / 换源 / 兜底 // ============================================================ function setSourceStatus(index, status) { const item = allSources()[index]; if (!item) return; item.status = status; if (item.custom) { const c = (_CONFIG_.customCache || []).find(o => o.url === item.url); if (c) c.status = status; } // 面板关闭时只记状态,等下次打开 renderPanel() 会按新状态重建; // 面板开着才做增量更新,避免整块重绘打断用户操作。 if (ui && ui.isOpen()) { const card = ui.panel.querySelector(`.jy-card[data-idx="${index}"]`); if (card) { card.classList.toggle('is-bad', status === 'bad'); const dot = card.querySelector('[data-dot]'); if (dot) dot.className = 'c-dot ' + status; const tag = card.querySelector('[data-tag]'); if (tag) { tag.className = 'c-tag ' + (status === 'ok' ? 't-ok' : status === 'bad' ? 't-bad' : (item.custom ? 't-mine' : 't-unknown')); tag.textContent = status === 'ok' ? '可用' : status === 'bad' ? '失效' : (item.custom ? '自建' : '待测'); } updateStatsBar(); } } } // 只刷新顶部四个统计数字,不动卡片(避免重绘打断交互) function updateStatsBar() { if (!ui) return; const st = statusCount(); const cells = ui.panel.querySelectorAll('.jy-stats .st'); if (cells.length === 4) { cells[0].querySelector('b').textContent = st.ok; cells[1].querySelector('b').textContent = st.unk; cells[2].querySelector('b').textContent = st.bad; cells[3].querySelector('b').textContent = st.total; } } function showSwitchTip(text) { const container = document.querySelector(_CONFIG_.currentPlayerNode.container); if (!container) return; let tip = container.querySelector('#jy_switch_tip'); if (!tip) { tip = document.createElement('div'); tip.id = 'jy_switch_tip'; tip.className = 'jy-switch-tip'; container.appendChild(tip); } tip.textContent = text; } function hideSwitchTip() { document.querySelectorAll('#jy_switch_tip').forEach(n => n.remove()); } function showFallback(reasonText) { const container = document.querySelector(_CONFIG_.currentPlayerNode.container); if (!container) return; hideFallback(); const wrap = document.createElement('div'); wrap.id = 'jy_fallback'; wrap.className = 'jy-fallback'; wrap.innerHTML = `
⚠ 当前没有可用的解析源
${reasonText}
打开原始播放页
`; container.appendChild(wrap); wrap.querySelector('#jy_fb_again').addEventListener('click', (e) => { e.stopPropagation(); hideFallback(); _CONFIG_.triedIndexes = []; allSources().forEach((it, i) => { if (it.status === 'bad') setSourceStatus(i, 'unknown'); }); tryNextSource(true); }); wrap.querySelector('#jy_fb_gift').addEventListener('click', (e) => { e.stopPropagation(); showDonate(); }); } function hideFallback() { const old = document.getElementById('jy_fallback'); if (old) old.remove(); } function doReload() { const iframe = document.querySelector(`.${_CONFIG_.iframeWrapperClass} iframe`); if (iframe && iframe.src) { iframe.src = iframe.src; toast('已重新加载解析画面'); return; } const idx = _CONFIG_.currentSourceIndex; if (idx >= 0 && allSources()[idx]) playSource(idx, false); else toast('还没有选择线路'); } function tryNextSource(manual = false) { hideSwitchTip(); const list = allSources(); const candidates = list .map((item, index) => ({item, index})) .filter(({item, index}) => item.type.includes('1') && !_CONFIG_.triedIndexes.includes(index) && (manual || item.status !== 'bad')); if (!candidates.length) { const names = list.filter(i => i.type.includes('1')).map(i => i.name).join('、'); showFallback(`已尝试全部解析源(${names}),均未返回可播放画面。
常见原因:① 解析站关站/改域名 ② 该平台或该剧被解析商下架 ③ 运营商 DNS 拦截。
可点下方按钮回到原站、稍后重试,或到「自定义线路」里加你自己找到的接口。`); return; } let pick = candidates[0]; if (!manual) { const lastGood = GM_getValue(_CONFIG_.lastGoodKey, -1); const hit = candidates.find(c => c.index === lastGood); if (hit) pick = hit; } _CONFIG_.triedIndexes.push(pick.index); hideFallback(); showSwitchTip(`正在尝试:${pick.item.name}(第 ${_CONFIG_.triedIndexes.length} 个)`); showPlayerWindow(pick.item, pick.index, true); } /** * 跨域 iframe 读不到播放状态,只能做「保守看门狗」: * 用户在播放器里交互过 = 画面是活的,立刻取消换源,避免误杀。 */ function watchCurrentSource(index) { if (_CONFIG_.switchTimer) { clearTimeout(_CONFIG_.switchTimer); _CONFIG_.switchTimer = null; } _CONFIG_.userInteracted = false; _CONFIG_.watchToken = index + '-' + Date.now(); if (GM_getValue(_CONFIG_.autoSwitchKey, 'on') === 'off') return; const token = _CONFIG_.watchToken; _CONFIG_.switchTimer = setTimeout(() => { if (token !== _CONFIG_.watchToken) return; if (_CONFIG_.userInteracted) { markSourceSuccess(index); return; } setSourceStatus(index, 'bad'); tryNextSource(); }, _CONFIG_.switchTimeout); } function markSourceSuccess(index) { if (index < 0) return; setSourceStatus(index, 'ok'); GM_setValue(_CONFIG_.lastGoodKey, index); hideSwitchTip(); if (_CONFIG_.switchTimer) { clearTimeout(_CONFIG_.switchTimer); _CONFIG_.switchTimer = null; } _CONFIG_.watchToken = null; } // ============================================================ // 渲染 iframe // ============================================================ function showPlayerWindow(videoObj, sourceIndex = -1, isAuto = false) { util.findTargetEle(_CONFIG_.currentPlayerNode.container).then((container) => { const cleanupSelectors = [...new Set( ((_CONFIG_.currentPlayerNode.displayNodes || []) .concat(_CONFIG_.currentPlayerNode.cleanupNodes || [])).filter(Boolean))]; const cleanup = () => { cleanupSelectors.forEach((sel) => { document.querySelectorAll(sel).forEach((node) => { node.style.setProperty('display', 'none', 'important'); node.style.setProperty('opacity', '0', 'important'); node.style.setProperty('pointer-events', 'none', 'important'); }); }); }; cleanup(); if (_CONFIG_.cleanupTimer) clearInterval(_CONFIG_.cleanupTimer); _CONFIG_.cleanupTimer = setInterval(cleanup, 500); if (!_CONFIG_.fullscreenCleanupBound) { document.addEventListener('fullscreenchange', cleanup); _CONFIG_.fullscreenCleanupBound = true; } const initialRect = container.getBoundingClientRect(); const initialStyle = window.getComputedStyle(container); const layout = buildPlayerFrameLayout({ isMobile: !!_CONFIG_.isMobile, containerRect: initialRect, containerStyle: {paddingTop: initialStyle.paddingTop}, viewportHeight: window.innerHeight || document.documentElement.clientHeight || 0 }); const fallback = document.getElementById('jy_fallback'); $(container).empty(); if (fallback) container.appendChild(fallback); util.reomveVideo(); if (initialStyle.position === 'static') container.style.position = 'relative'; applyInlineStyles(container, layout.containerStyles); const wrap = document.createElement('div'); wrap.className = _CONFIG_.iframeWrapperClass; applyInlineStyles(wrap, layout.wrapperStyles); const iframe = document.createElement('iframe'); // ★ 统一 encodeURIComponent(影瞳同款),避免 & # 截断 iframe.src = buildParseUrl(videoObj.url, window.location.href); iframe.frameBorder = '0'; iframe.allow = 'autoplay; encrypted-media; fullscreen'; iframe.allowFullscreen = true; iframe.referrerPolicy = 'no-referrer'; applyInlineStyles(iframe, layout.iframeStyles); const markInteraction = (e) => { if (e.target && e.target.closest && e.target.closest('#' + _CONFIG_.rootId)) return; _CONFIG_.userInteracted = true; }; wrap.addEventListener('pointerdown', markInteraction, true); wrap.addEventListener('wheel', markInteraction, true); wrap.addEventListener('keydown', markInteraction, true); wrap.appendChild(iframe); container.appendChild(wrap); _CONFIG_.currentSourceIndex = sourceIndex; if (sourceIndex >= 0) watchCurrentSource(sourceIndex); else showSwitchTip('当前:' + videoObj.name); }); } // ============================================================ // 启动 // ============================================================ function start() { GM_setValue(_CONFIG_.flag, null); const playerNode = _CONFIG_.playerContainers.filter(v => v.host === window.location.host); if (!playerNode || playerNode.length <= 0) { console.warn(window.location.host + ' 该网站暂不支持,请提供有问题的网址以便适配'); return; } _CONFIG_.currentPlayerNode = playerNode[0]; // 内置线路快照 + 合并自定义 _CONFIG_.baseList = _CONFIG_.videoParseList.map(o => Object.assign({}, o)); _CONFIG_.customCache = []; rebuildSources(); // 等 body 就绪再挂 UI const mount = () => { ui = createConsole(); renderPanel(); // 油猴菜单入口 try { GM_registerMenuCommand('聚影 · 自定义线路', showCustomEditor); GM_registerMenuCommand('聚影 · 打赏支持作者 🎁', showDonate); GM_registerMenuCommand('聚影 · 重置线路状态', () => { allSources().forEach((it, i) => setSourceStatus(i, it.status === 'bad' ? 'unknown' : it.status)); toast('线路状态已重置'); renderPanel(); }); } catch (e) {} // 首屏轻提示:告诉用户球在哪 setTimeout(() => toast('聚影已就绪 · 点左侧球展开控制台', 2600), 800); // 自动解析 if (!!GM_getValue(_CONFIG_.autoPlayerKey, null)) { const idx0 = GM_getValue(_CONFIG_.lastGoodKey, -1); const idx1 = GM_getValue(_CONFIG_.autoPlayerVal, 0); let index = (idx0 >= 0 && allSources()[idx0]) ? idx0 : idx1; if (!allSources()[index] || !allSources()[index].type.includes('1')) { index = allSources().findIndex(i => i.type.includes('1')); } if (index >= 0) { _CONFIG_.triedIndexes = []; setTimeout(() => tryNextSource(), 1500); } } // 站内路由变化后重载(保持原有行为) if (!!GM_getValue(_CONFIG_.autoPlayerKey, null)) { util.urlChangeReload(); } else { let oldHref = window.location.href; setInterval(() => { const newHref = window.location.href; if (oldHref !== newHref) { oldHref = newHref; if (!!GM_getValue(_CONFIG_.flag, null)) window.location.reload(); } }, 1000); } }; if (document.body) mount(); else document.addEventListener('DOMContentLoaded', mount, {once: true}); } return {start}; })(); (function () { superVip.start(); })();