// ==UserScript== // @name 🌀VIP视频解析——fatcat // @namespace https://greasyfork.org/users/1313123-fei-miao // @version 2.8.6 // @description 适配手机端与电脑端,可自主管理解析点 // @author 暴走的肥猫 // @license GNU AGPLv3 // @match *://*.youku.com/* // @match *://*.iqiyi.com/* // @match *://v.qq.com/* // @match *://*.v.qq.com/* // @match *://*.mgtv.com/* // @match *://tv.sohu.com/* // @match *://film.sohu.com/* // @match *://*.bilibili.com/* // @match *://*.tudou.com/* // @match *://*.pptv.com/* // @compatible safari // @compatible chrome // @compatible edge // @grant GM_getValue // @grant GM_setValue // @grant GM.getValue // @grant GM.setValue // @run-at document-idle // @noframes // @downloadURL none // ==/UserScript== /*jshint esversion: 11 */ (async function () { const ACCESS_POINT = [ { "name": "虾米-1", "url": "https://jx.xmflv.com/?url=" }, { "name": "虾米-2", "url": "https://jx.xmflv.cc/?url=" }, { "name": "M1907-1", "url": "https://im1907.top/?jx=" }, { "name": "M1907-2", "url": "https://z1.m1907.top/?eps=0&jx=" }, { "name": "M3U8TV", "url": "https://jx.m3u8.tv/jiexi/?url=" }, { "name": "夜幕", "url": "https://www.yemu.xyz/?url=" }, { "name": "777", "url": "https://jx.jsonplayer.com/player/?url=" }, { "name": "CK", "url": "https://www.ckplayer.vip/jiexi/?url=" }, { "name": "YT", "url": "https://jx.yangtu.top/?url=" }, { "name": "Player-JY", "url": "https://jx.playerjy.com/?url=" }, { "name": "Yparse", "url": "https://jx.yparse.com/index.php?url=" }, { "name": "8090", "url": "https://www.8090g.cn/?url=" }, { "name": "剖元", "url": "https://www.pouyun.com/?url=" }, { "name": "全民", "url": "https://43.240.74.102:4433?url=" }, { "name": "爱豆", "url": "https://jx.aidouer.net/?url=" }, { "name": "冰豆", "url": "https://bd.jx.cn/?url=" }, { "name": "Playm3u8", "url": "https://www.playm3u8.cn/jiexi.php?url=" }, ]; var searchSelector = ['video']; async function getUserConfig(key, defaultVal) { return typeof GM_getValue === 'function' ? GM_getValue(key, defaultVal) : GM.getValue(key, defaultVal); } async function setUserConfig(key, val) { return typeof GM_setValue === 'function' ? GM_setValue(key, val) : GM.setValue(key, val); } function seekSameSizeParentNode(node) { let nodeSize = node.getBoundingClientRect(); let parents = [node]; while (node.parentNode != document.body) { parents.push(node.parentNode); node = node.parentNode; }; let parentSize; let sameSizeParent = parents.findLast(parent => { parentSize = parent.getBoundingClientRect(); return Math.abs(parentSize.width - nodeSize.width) < 1 && Math.abs(parentSize.height - nodeSize.height) < 1 }); return sameSizeParent; } function useInterval(fn, intervalTime, maxTime) { return new Promise((resolve) => { let totalTime = 0; let interval = setInterval(() => { totalTime += intervalTime; if (totalTime >= maxTime || fn()) { clearInterval(interval); resolve(); } }, intervalTime) }) } async function findVideoWrapper() { await useInterval(() => Array.from(document.querySelectorAll(searchSelector.join(','))).find(videoNode => { videoNode.style.display = 'revert'; return videoNode.getBoundingClientRect().width > 90 && videoNode.getBoundingClientRect().height > 40 }), 200, Infinity); let videoNodes = Array.from(document.querySelectorAll(searchSelector.join(','))); return videoNodes.map(videoNode => seekSameSizeParentNode(videoNode)).reduce((pre, cur) => { let preW = pre?.getBoundingClientRect().width || 0; let curW = cur.getBoundingClientRect().width; if (curW > preW) return cur; return pre; }) } async function createVideoFrame(videoWrapper, curAccessPoint) { videoWrapper.style.overflow = 'hidden'; if (window.getComputedStyle(videoWrapper).position == 'static') videoWrapper.style.position = 'relative'; let iframeWrapper = document.createElement('div'); iframeWrapper.innerHTML = `