// ==UserScript== // @name VIP会员视频在线解析大集合 // @namespace https://greasyfork.org/zh-CN/users/505018 // @iconURL https://v.qq.com/favicon.ico // @version 1.0.4 // @description [腾讯|爱奇艺|优酷|乐视|芒果|AB站|音悦台]等VIP或会员视频,在线解析接口插件 // @author DreamFly // @noframes // @match http*://v.qq.com/x/cover/* // @match http*://*.iqiyi.com/v* // @match http*://v.youku.com/v_show/* // @match http*://*.le.com/* // @match http*://*.letv.com/* // @match http*://*.tudou.com/* // @match http*://*.mgtv.com/* // @match http*://film.sohu.com/* // @match http*://tv.sohu.com/* // @match http*://*.acfun.cn/v/* // @match http*://*.bilibili.com/* // @match http*://vip.1905.com/play/* // @match http*://*.pptv.com/* // @match http*://v.yinyuetai.com/video/* // @match http*://v.yinyuetai.com/playlist/* // @match http*://*.fun.tv/vplay/* // @match http*://*.wasu.cn/Play/show/* // @match http*://*.56.com/* // @exclude http*://*.bilibili.com/blackboard/* // @grant GM.getValue // @grant GM.setValue // @grant GM_getValue // @grant GM_setValue // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM.xmlHttpRequest // @grant GM_openInTab // @grant GM.openInTab // @downloadURL none // ==/UserScript== (function() { 'use strict'; const VQQIcon = ''; const IQiyiIcon = ''; const YoukuIcon = ''; var websites = [/qq.com/i, /iqiyi.com/i, /youku.com/i] var webIcons = [VQQIcon, IQiyiIcon, YoukuIcon] var icon = ''; for (let i in websites) { if (websites[i].test(location.href)) { icon = webIcons[i]; } } var defaultApi = { title: "618G,失效请更换接口", url: "http://jx.618g.com/?url=" }; //fixedApis name:显示的文字 url:接口 title:提示文字 intab:是否适合内嵌(嵌入判断:GMgetValue("replaceRaw",false)值||intab值) var fixedApis = [ { name: "618G" + icon, url: "http://jx.618g.com/?url=", title: "618G", intab: 0 }, { name: "玩的嗨" + icon, url: "http://tv.wandhi.com/go.html?url=", title: "综合接口,一键VIP*** 更新可用【作者mark zhang】脚本的接口", intab: 0 }, { name: "搜你妹" + icon, url: "http://www.sonimei.cn/?url=", title: "综合接口,VIP视频*** 更新可用【作者sonimei134】脚本的接口", intab: 0 }, { name: "TIMERD" + icon, url: "https://timerd.me/static/cv.html?zwx=", title: "不稳定,广告过滤软件可能有影响", intab: 1 }, { name: "石头解析" + icon, url: "https://jiexi.071811.cc/jx.php?url=", title: "手动点播放", intab: 1 }, { name: "乐乐云" + icon, url: "https://660e.com/?url=", title: "乐乐云,未知效果", intab: 1 }, { name: "无名小站" + icon, url: "http://www.sfsft.com/admin.php?url=", title: "无名小站同源", intab: 1 }, { name: "无名小站2" + icon, url: "http://www.wmxz.wang/video.php?url=", title: "转圈圈就换线路", intab: 1 }, { name: "人人发布" + icon, url: "http://v.renrenfabu.com/jiexi.php?url=", title: "综合,多线路", intab: 0 }, { name: "金桥解析" + icon, url: "http://jqaaa.com/jx.php?url=", title: "金桥解析接口", intab: 0 }, { name: "927解析" + icon, url: "http://api.927jx.com/vip/?url=", title: "927解析接口", intab: 0 }, { name: "yangju视频" + icon, url: "http://cdn.yangju.vip/k/?url=", title: "yangju,未知效果", intab: 0 }, { name: "17Kyun解析" + icon, url: "http://17kyun.com/api.php?url=", title: "17Kyun解析", intab: 0 }, { name: "人人解析" + icon, url: "https://vip.mpos.ren/v/?url=", title: "人人视频解析", intab: 0 }, { name: "云网解析" + icon, url: "https://www.41478.net/?url=", title: "云网解析", intab: 0 } ]; var cssStyle = ` #TMDFVideoContainer { z-index: 999998; background: rgba(0, 0, 0, .7); position: fixed; top: 7em; left: 5em; height: 75%; width: 75%; box-shadow: 2px 2px 5px 5px rgba(125, 125, 250, .8); } #TMDFVideoContainer button { top: .1em; cursor: pointer; visibility: hidden; font-size: 3em; color: #ffffffff; background: transparent; border: 0; } #TMDFVideoContainer:hover button { visibility: visible; } #TMDFVideoContainer:hover button:hover { color: #ff0; } #TMDFiframe1 { height: 100%; width: 100%; overflow: auto; position: absolute; top: 0; left: 0; margin: auto; border: 0; box-shadow: 0 0 3em rgba(0, 0, 0, .4); z-index: -1; } #TMDFVideoSetting { text-align: center; } #TMDFCustomApi li { margin: 5px; width: 100%; list-style-type: none; } #TMDFul { position: fixed; top: 5em; left: 0; padding: 0; z-index: 999999; } #TMDFul li { list-style: none; } #TMDFul svg { float: right; } .TMDFul2 { position: absolute; top: 0; left: 1.5em; display: none; border-radius: .3em; margin: 0; padding: 0; } .TMDFul2 li { float: none; width: 7em; margin: 0; font-size: 1em; padding: .15em 1em; cursor: pointer; color: #3a3a3a!important; background: rgba(125, 125, 250, 0.8); } .TMDFul2 li:hover { color: white!important; background: rgba(0, 0, 0, .8); } .TMDFul2 li:first-child { border-radius: .35em .35em 0 0; } .TMDFul2 li:last-child { border-radius: 0 0 .35em .35em; } .TMDFli1 { opacity: 0.3; position: relative; padding-right: .5em; width: 1.5em; cursor: pointer; } .TMDFli1:hover { opacity: 1; } .TMDFli1 span { display: block; border-radius: 0 .3em .3em 0; background-color: rgba(125, 125, 250, 1.0); border: 0; font: bold 1em "微软雅黑"!important; color: rgb(0, 255, 255); margin: 0; padding: 1em .3em; } .TMDFli1:hover .TMDFul2 { display: block; } .TMDFli2 { text-align: center; } .TMDFp { position: fixed; top: 20%; left: 20%; z-index: 999999; background: rgba(125, 125, 250, 0.9); padding: 30px 20px 10px 20px; border-radius: 10px; text-align: left; } .TMDFp * { font-size: 16px; font-family: '微软雅黑'; color: #3a3a3a; //box-shadow: 0 0 3em rgba(0, 0, 0, .4); } .TMDFp fieldset { margin: 0; padding: 10px; } .TMDFp legend { padding: 0 10px; text-align: center; } .TMDFp label { display: inline-block; } .TMDFp input[type=text] { border-radius: 5px !important; border: 1px solid #3a3a3a; margin: 2px 10px 2px 5px; padding: 2px 5px; } .TMDFp button { border: 1px solid #3a3a3a; border-radius: 5px; cursor: pointer; padding: 2px 10px; margin: 10px 20px 0 20px; } .TMDFp button:hover { background: #3a3a3a; color: yellow; } .TMDFtext1 { width: 350px; } .TMDFtext2 { width: 160px; } .TMDFClose { position: absolute; top: 3px; left: 3px; margin: 0!important; } .TMDFspan80 { display: inline-block; text-align: right; width: 80px; } .TMDFspan120 { display: inline-block; text-align: right; width: 120px; } .TMDFDelete { float: left; display: inline-block; color: red; padding: 0 10px !important; cursor: pointer; } .TMDFCheckbox { margin-left: 4px; margin-right: 4px; } .TMDFName { } .TMDFLink { } input[type=checkbox] { -webkit-appearance: checkbox; } li:hover .TMDFDelete, li:hover .TMDFCheckbox, li:hover .TMDFName, li:hover .TMDFLink { background: rgba(73,163,230,0.62); } `; /* 兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+ * 为了兼容GreasyMonkey 4.0 获取结构化数据,比如 json Array 等, * 应当先将字符串还原为对象,再执行后续操作 * GMgetValue(name,defaultValue) */ function GMgetValue(name, defaultValue) { if (typeof GM_getValue === 'function') { return GM_getValue(name, defaultValue); } else { return GM.getValue(name, defaultValue); } } /* 兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+ * 为了兼容GreasyMonkey 4.0 储存结构化数据,比如 json Array 等, * 应当先将对象字符串化, * GMsetValue(name, JSON.stringify(defaultValue)) */ function GMsetValue(name, defaultValue) { if (typeof GM_setValue === 'function') { GM_setValue(name, defaultValue); } else { GM.setValue(name, defaultValue); } } /* 兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+ */ function GMxmlhttpRequest(obj) { if (GM_xmlhttpRequest === "function") { GM_xmlhttpRequest(obj); } else { GM.xmlhttpRequest(obj); } } /* 兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+ */ function GMaddStyle(cssText) { let doc = document.head || document.documentElement; let tag = document.createElement('style'); tag.textContent = cssText; doc.appendChild(tag); } //开启全屏的element调用,找到支持的方法 function launchFullScreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullscreen(); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } } //打开视频解析 function openVideoResolve(evt) { if (evt.target.dataset.intab === '1') { //如果页面有播放窗口,只需更新播放窗口的 src, 如果没有播放窗口,读取播放窗口位置信息,新建一个播放窗 let iframeTag = document.querySelector('#TMDFiframe'); if (iframeTag === null) { let videoRect = JSON.parse(GMgetValue('videoRect', '{"left":"10","top":"10","width":"800","height":"600"}')); let divTag = document.createElement('div'); divTag.id = 'TMDFVideoContainer'; divTag.setAttribute('style', 'left:' + videoRect.left + ';top:' + videoRect.top + ';width:' + videoRect.width + ';height:' + videoRect.height + ';'); divTag.innerHTML = ''; let iframeTag = document.createElement('iframe'); iframeTag.id = 'TMDFiframe'; iframeTag.frameborder = '0'; iframeTag.allowfullscreen = 'true'; iframeTag.width = '100%'; iframeTag.height = '100%'; iframeTag.src = evt.target.dataset.url + location.href; divTag.appendChild(iframeTag); document.body.appendChild(divTag); document.querySelector('#TMDFIframeClose').addEventListener('click', () => { document.body.removeChild(document.querySelector('#TMDFVideoContainer')); }, false); document.querySelector('#TMDFFullScreen').addEventListener('click', () => { launchFullScreen(document.querySelector('#TMDFiframe')); }, false); } else { iframeTag.src = evt.target.dataset.url + location.href; } } else { //不适合页内播放的,打开新标签 window.open(evt.target.dataset.url + location.href); } } //保存视频设置 function saveVideoSetting() { var videoRect = { left: document.querySelector('#TMDFpL').value, top: document.querySelector('#TMDFpT').value, width: document.querySelector('#TMDFpW').value, height: document.querySelector('#TMDFpH').value }; GMsetValue('videoRect', JSON.stringify(videoRect)); } //检查是否勾选页内解析 function checkThisPageResolve() { let enablePageResolve = document.querySelector("#TMDFPageResolve").checked; GMsetValue("enablePageResolve", enablePageResolve); var x, arr = document.querySelectorAll('.TMDFul3 li'); for (x = 0; x < arr.length; x++) { if (enablePageResolve) { arr[x].addEventListener('click', openVideoResolve, false); arr[x].setAttribute('onclick',''); } else { arr[x].removeEventListener('click', openVideoResolve, false); arr[x].setAttribute('onclick', 'window.open(this.dataset.url + location.href)'); } } } /* 正确选集 */ function rightVideoEpisodes() { let enableVideoEpisodes = document.querySelector("#TMDFVideoEpisodes").checked; GMsetValue("enableVideoEpisodes", enableVideoEpisodes); function getLink(e) { var target = e.target.parentNode.tagName == "li" ? e.target.parentNode : (e.target.parentNode.parentNode.tagName == "li" ? e.target.parentNode.parentNode : e.target.parentNode.parentNode.parentNode); if (target.tagName != "li") return; GMxmlhttpRequest({ method: 'GET', url: "http://cache.video.qiyi.com/jp/vi/" + target.dataset.videolistTvid + "/" + target.dataset.videolistVid + "/?callback=crackIqiyi", onload: function(result) { var crackIqiyi = function(d) { location.href = d.vu; }; eval(result.responseText); } }); } try { if (enableVideoEpisodes) { document.querySelector('#widget-dramaseries').addEventListener('click', getLink); } else { document.querySelector('#widget-dramaseries').removeEventListener('click', getLink); } } catch (e) {} } /* 显示增加接口的面板 */ function showAddCustomApiPanel() { let apiPanel = document.querySelector('#TMDFCustomApi'); if (apiPanel) { apiPanel.style.display = "block"; } else { alert(`(● ̄(エ) ̄●)づ\n\n未启用[增加接口]功能\n请把 '▣增加接口'→'☑增加接口'!`); } } /* 勾选自定义接口 */ function checkAddCustomApi() { let enableCustomApi = document.querySelector('#TMDFAddApi').checked; GMsetValue('enableCustomApi', enableCustomApi); if (enableCustomApi) { showCustomApiPanel(); setTimeout(showAddCustomApiPanel, 200); } } /* 保存按钮执行函数:获取值并 await GM.setValue() */ function getCustomUserApis() { let userApis = document.querySelectorAll('.TMDFLink'); let apiName = document.querySelector('#TMDFname').value; let apiUrl = document.querySelector('#TMDFurl').value; let apiIntab = document.querySelector('#TMDFintab').checked ? 1 : 0; let customUserApis = []; if (apiName || apiUrl) { customUserApis.push({ name: apiName, url: apiUrl, intab: apiIntab }); } let n, u, l; for (let i = 0; i < userApis.length; i++) { u = userApis[i].innerText; n = userApis[i].previousSibling.innerText.split(':')[0]; l = userApis[i].previousSibling.previousSibling.checked ? '1' : '0'; customUserApis.push({ name: n, url: u, intab: l }); } return customUserApis; } //生成"嵌入页面大小位置设置"面板 function showVideoSettingPanel() { let videoRect = JSON.parse(GMgetValue('videoRect', '{"left":"5em","top":"7em","width":"75%","height":"75%"}')); let innerHtml = `
页内播放窗口位置大小
  • `; let divTag = document.createElement('div'); divTag.id = 'TMDFVideoSetting'; divTag.setAttribute('class', 'TMDFp'); divTag.innerHTML = innerHtml; document.body.appendChild(divTag); //添加事件 document.querySelector('#TMDFSettingCurrentView').addEventListener('click', function() { let videoTag = document.querySelector('#TMDFVideoContainer'); if (videoTag) { let videoStyle = getComputedStyle(videoTag) document.querySelector('#TMDFpL').value = videoStyle.left; document.querySelector('#TMDFpT').value = videoStyle.top; document.querySelector('#TMDFpW').value = videoStyle.width; document.querySelector('#TMDFpH').value = videoStyle.height; } }, false); document.querySelector('#TMDFSettingPreview').addEventListener('click', function() { let videoTag = document.querySelector('#TMDFVideoContainer'); if (videoTag) { videoTag.style.cssText = '' videoTag.style.cssText += 'left:' + document.querySelector('#TMDFpL').value + ';'; videoTag.style.cssText += 'top:' + document.querySelector('#TMDFpT').value + ';'; videoTag.style.cssText += 'width:' + document.querySelector('#TMDFpW').value + ';'; videoTag.style.cssText += 'height:' + document.querySelector('#TMDFpH').value + ';'; } }, false); document.querySelector('#TMDFSettingSave').addEventListener('click', function() { saveVideoSetting(); setTimeout(function() { document.body.removeChild(document.querySelector("#TMDFVideoSetting")); }, 30); }, false); } /* 生成增加接口面板 */ function showCustomApiPanel() { let innerHtml = ` 添加解析接口
  • 解析接口名称:
  • 解析接口地址:
  • 解析内嵌本页:
  • `; try { let customUserApis = JSON.parse(GMgetValue('customUserApis', "[{}]")); let checkStatus = ''; if (customUserApis[0].name !== undefined) { for (let i = 0; i < customUserApis.length; i++) { checkStatus = (customUserApis[i].intab === "1") ? 'checked' : ''; innerHtml += `
  • ${customUserApis[i].name}:${customUserApis[i].url}
  • `; } } } catch (e) {} let divTag = document.createElement('div'); divTag.id = 'TMDFCustomApi'; divTag.setAttribute('class', 'TMDFp'); divTag.setAttribute('style', 'display:none'); divTag.innerHTML = innerHtml; document.body.appendChild(divTag); /*事件绑定*/ document.querySelector('#TMDFTest').addEventListener('click', function() { let apiUrl = document.querySelector('#TMDFurl').value; if (apiUrl && apiUrl.match('^http')){ window.open(apiUrl + location.href); } else{ alert('测试无效,请先添加解析接口地址'); } }, false); document.querySelector('#TMDFAdd').addEventListener('click', function() { if (document.querySelector('#TMDFname').value && document.querySelector('#TMDFurl').value) { let checkStatus = document.querySelector("#TMDFintab").checked ? "checked" : ""; let liTag = document.createElement('li'); liTag.innerHTML = `${document.querySelector('#TMDFname').value}:${document.querySelector('#TMDFurl').value}`; if (document.querySelector('span[class=TMDFName]') === null) { document.querySelector('#TMDFCustomApi').appendChild(liTag); document.querySelector('#TMDFname').value = ''; document.querySelector('#TMDFurl').value = ''; } else { document.querySelector('#TMDFCustomApi').insertBefore(liTag, document.querySelector('span[class=TMDFName]').parentNode); document.querySelector('#TMDFname').value = ''; document.querySelector('#TMDFurl').value = ''; } } else { alert('添加解析接口名称与地址不能为空,且符合规范'); } }, false); document.querySelector('#TMDFSave').addEventListener('click', function() { var customUserApis = getCustomUserApis(); GMsetValue('customUserApis', JSON.stringify(customUserApis)); console.log(customUserApis); alert('解析接口列表已保存'); }, false); } /* 显示解析界面 */ function showResolveApiPanel() { /*提供的接口列表*/ let apisText = '' for (let i in fixedApis) { apisText += `
  • ${fixedApis[i].name}
  • `; } let innerHtml = ` `; let divTag = document.createElement("div"); divTag.id = "TMDFResolveApi"; divTag.innerHTML = innerHtml; document.body.appendChild(divTag); //事件绑定 document.querySelector("#TMDFAddApi").addEventListener('change', checkAddCustomApi, false); let enableCustomApi = GMgetValue('enableCustomApi', false) document.querySelector("#TMDFAddApi").checked = enableCustomApi; /*看看是否需要加载自定义的接口列表*/ if (enableCustomApi) { let customUserApis = JSON.parse(GMgetValue('customUserApis', "[{}]")); let innerHtml = ''; for (let i in customUserApis) { try { if (customUserApis[i].url !== null) { innerHtml += `
  • ${customUserApis[i].name}
  • `; } } catch (e) { /*console.log(e);*/ } } document.querySelector('ul.TMDFul2.TMDFul3').innerHTML = innerHtml + document.querySelector('ul.TMDFul2.TMDFul3').innerHTML; showCustomApiPanel(); } //本页解析 document.querySelector("#TMDFPageResolve").addEventListener("click", checkThisPageResolve, false); let enablePageResolve = GMgetValue('enablePageResolve', false); document.querySelector("#TMDFPageResolve").checked = enablePageResolve; if (enablePageResolve) { checkThisPageResolve(); } //正确选集 document.querySelector("#TMDFVideoEpisodes").addEventListener("click", rightVideoEpisodes, false); let enableVideoEpisodes = GMgetValue('enableVideoEpisodes', false); document.querySelector("#TMDFVideoEpisodes").checked = enableVideoEpisodes; if (enableVideoEpisodes && location.href.indexOf("iqiyi") != -1) { rightVideoEpisodes(); } //添加接口 document.querySelector("#TMDFAddApiSettingBtn").addEventListener('click', showAddCustomApiPanel, false); //播放设置 document.querySelector("#TMDFVideoSettingBtn").addEventListener('click', showVideoSettingPanel, false); } /* 执行 */ function execute() { //添加css GMaddStyle(cssStyle); //显示界面 showResolveApiPanel(); } //调用执行 execute(); })();