// ==UserScript== // @name VIP会员视频在线解析大集合 // @namespace https://greasyfork.org/zh-CN/users/505018 // @version 1.0.1 // @description [腾讯|爱奇艺|优酷|乐视|芒果|AB站|音悦台]等VIP或会员视频,在线解析接口插件 // @author DreamFly // @noframes // @require https://greasemonkey.github.io/gm4-polyfill/gm4-polyfill.js // @match http*://v.qq.com/x/cover/* // @match http*://*.iqiyi.com/* // @match http*://*.youku.com/* // @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 icon = ''; var websites = [/qq.com/i , /iqiyi.com/i, /youku.com/i] var webIcons = [VQQIcon, IQiyiIcon, YoukuIcon] for (let i in websites) { if (websites[i].test(location.href)){ icon = webIcons[i]; } } var defaultapi = { title: "618G,失效请更换接口", url: "http://jx.618g.com/?url=" }; //apis name:显示的文字 url:接口 title:提示文字 intab:是否适合内嵌(嵌入判断:GMgetValue("replaceRaw",false)值||intab值) var apis =[ { 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:"https://www.3aym.cn/?url=", title:"小鑫视频,未知效果", intab:0 }, { name:"VIP看看"+icon, url:"http://q.z.vip.totv.72du.com/?url=", title:"更换线路成功率会提高", intab:1 }, { name:"163人"+icon, url:"http://jx.api.163ren.com/vod.php?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 } ]; var cssStyle = ` /*TMHY:TamperMonkeyHuanYan*/ #TMHYvideoContainer {z-index:999998;background:rgba(0,0,0,.7);position:fixed;top:7em;left:5em;height:65%;width:65%;resize:both;overflow:auto;box-shadow:2px 2px 5px 5px rgba(255,255,0,.8);} /*TMHYVideoContainer*/ #TMHYvideoContainer button {top:.1em;cursor:pointer;visibility:hidden;font-size:3em;color:#fff;background:transparent;border:0;} #TMHYvideoContainer:hover button {visibility:visible;} #TMHYvideoContainer:hover button:hover {color:#ff0;} #TMHYiframe {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;} /*TMHYIframe*/ #TMHYul {position:fixed;top:5em;left:0;padding:0;z-index:999999;} #TMHYul li {list-style:none;} #TMHYul svg {float:right;} #tMuserDefine li {margin:5px;width:100%;list-style-type:none;} #inTabSettingSave {position:relative;margin-top:10px;padding:3px 20px;} .TM1 {opacity:0.3;position:relative;padding-right:.5em;width:1.5em;cursor:pointer;} .TM1:hover {opacity:1;} .TM1 span {display:block;border-radius:0 .3em .3em 0;background-color:#ffff00;border:0;font:bold 1em "微软雅黑"!important;color:#ff0000;margin:0;padding:1em .3em;} .TM3 {position:absolute;top:0;left:1.5em;display:none;border-radius:.3em;margin:0;padding:0;} .TM3 li {float:none;width:7em;margin:0;font-size:1em;padding:.15em 1em;cursor:pointer;color:#3a3a3a!important;background:rgba(255,255,0,0.8);} .TM3 li:hover {color:white!important;background:rgba(0,0,0,.8);} .TM3 li:last-child {border-radius:0 0 .35em .35em;} .TM3 li:first-child {border-radius:.35em .35em 0 0;} .TM1:hover .TM3 {display:block;} /*自定义解析接口,本页播放窗口设置*/ .TMHYp {position:fixed;top:20%;left:20%;z-index:999999;background:yellow;padding:30px 20px 10px 20px;border-radius:10px;text-align:center;} .TMHYp * {font-size:16px;background:rgba(255,255,0,1);font-family:'微软雅黑';color:#3a3a3a;border-radius:10px;} .TMHYp fieldset {margin:0;padding:10px;} .TMHYp legend {padding:0 10px;} .TMHYp label {display:inline-block;} .TMHYp input[type=text] {border-radius:5px !important;border:1px solid #3a3a3a;margin:2px 10px 2px 5px;padding:2px 5px;} .TMHYp button {border:1px solid #3a3a3a;border-radius:5px;cursor:pointer;padding: 2px 10px;margin:10px 20px 0 20px;} .TMHYp button:hover {background:#3a3a3a;color:yellow;} /*TMHYlti*/ .TMHYlti {width:350px;} /*TMHYmti*/ .TMHYmti {width:160px;} .TMHYClose {position:absolute;top:0;left:0;margin:0!important;} .TMHYspan80 {display:inline-block;text-align:right;width:80px;} .TMHYspan120 {display:inline-block;text-align:right;width:120px;} .idelete {float: left; display: inline-block; color: red; padding: 0 20px !important; cursor: pointer;} .iname {padding-right:10px;} li:hover .idelete,li:hover .ilink,li:hover .iname {background:rgba(224,175,17,0.62);} ` /* 兼容 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); } /* 兼容 Tampermonkey | Violentmonkey | Greasymonkey 4.0+ * 为了兼容GreasyMonkey 4.0 获取结构化数据,比如 json Array 等, * 应当先将字符串还原为对象,再执行后续操作 * GMgetValue(name,defaultValue).then((result)=>{ * let result = JSON.parse(result); * // other code... * }; */ function GMgetValue(name, defaultValue) { if (typeof GM_getValue === 'function') { return new Promise((resolve, reject) => { resolve(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); } } function GMxmlhttpRequest(obj){ if (GM_xmlhttpRequest === "function") { GM_xmlhttpRequest(obj); } else{ GM.xmlhttpRequest(obj); } } //添加css GMaddStyle(cssStyle); //嵌入页面播放 function openInTab(evt) { // 找到支持的方法, 使用需要全屏的 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(); } } if(evt.target.dataset.intab === '1'){ //如果页面有播放窗口,只需更新播放窗口的 src, 如果没有播放窗口,读取播放窗口位置信息,新建一个播放窗 if(document.querySelector('#TMHYiframe') === null){ GMgetValue('intabSize','{"height":"","width":"","left":"","top":""}').then((position)=>{ var sty = JSON.parse(position); var divTag = document.createElement('div'); divTag.id = 'TMHYvideoContainer'; divTag.setAttribute('style', 'height:'+sty.height+';width:'+sty.width+';left:'+sty.left+';top:'+sty.top+';'); divTag.innerHTML = ''; document.body.appendChild(divTag); var iframeTag = document.createElement('iframe'); iframeTag.id = 'TMHYiframe'; iframeTag.src = evt.target.dataset.url + location.href; document.querySelector('#TMHYvideoContainer').appendChild(iframeTag); document.querySelector('#TMHYIframeClose').addEventListener('click', ()=>{document.body.removeChild(document.querySelector('#TMHYvideoContainer'));}, false); document.querySelector('#TMHYfullScreen').addEventListener('click', ()=>{launchFullScreen(document.querySelector('#TMHYiframe'));}, false); }); } else{ document.querySelector('#TMHYiframe').src = evt.target.dataset.url + location.href; } } else{ //不适合页内播放的,打开新标签 window.open(evt.target.dataset.url + location.href); } } //保存嵌入页面大小位置设置 function saveInTabSetting(){ var intabSize = { height:document.querySelector('#TMpH').value, width:document.querySelector('#TMpW').value, left:document.querySelector('#TMpL').value, top:document.querySelector('#TMpT').value }; GMsetValue('intabSize', JSON.stringify(intabSize)); setTimeout(function(){ document.body.removeChild(document.querySelector("#TMHYSetting")); }, 30); } //生成"嵌入页面大小位置设置"面板 function intabSetting(){ var intabSize = GMgetValue('intabSize','{"height":"","width":"","left":"","top":""}') .then((ag)=>{ let divTag = document.createElement('div'); divTag.id = 'TMHYSetting'; divTag.setAttribute('class', 'TMHYp'); divTag.innerHTML = `
`; document.body.appendChild(divTag); document.querySelector('#intabSettingSave').addEventListener('click', saveInTabSetting, false); }); } var replaceRaw; //是否嵌入当前页面 var episodes; //是否启用爱奇艺正确选集 var userApisOn; //是否加载自定义解析接口 //检查是否勾选页内解析 function noNewTabCheck() { var x, arr = document.querySelectorAll(".TM4 li"); replaceRaw = document.querySelector("#intabChekbx").checked; GMsetValue("replaceRaw", replaceRaw); for (x = 0; x < arr.length; x++) { if (replaceRaw) { arr[x].addEventListener("click", openInTab, false); arr[x].setAttribute('onclick', ''); } else { arr[x].removeEventListener("click", openInTab, false); arr[x].setAttribute('onclick', 'window.open(this.dataset.url + location.href)'); } } } /* 爱奇艺正确选集 */ function rightEpsLinkCheck() { episodes = document.querySelector("#realLinkChekbx").checked; GMsetValue("episodes", episodes); function getLink(e) { //-------------iqiyi剧集真实播放页面方法 Begin------------------ //Code piece infomation: //License:MIT Author:hoothin Homepage: http://hoothin.com Email: rixixi@gmail.com 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 (episodes) { document.querySelector('#widget-dramaseries').addEventListener('click', getLink); //-------------iqiyi剧集真实播放页面方法 End------------------ } else { document.querySelector('#widget-dramaseries').removeEventListener('click', getLink); } } catch(e) {} } /* 显示增加接口的面板 */ function showAddApiPanel() { if (document.querySelector('#tMuserDefine')) { document.querySelector('#tMuserDefine').style.display = "block"; } else { alert(`(● ̄(エ) ̄●)づ\n\n未启用[增加接口]功能\n请把 '▣增加接口'→'☑增加接口'!`); } } /* 勾选自定义接口 */ function addApiCheck() { userApisOn = document.querySelector('#addApiChekBx').checked; GMsetValue('userApisOn', userApisOn); if(userApisOn) { selfDefine(); setTimeout(showAddApiPanel, 200); } } /* 保存按钮执行函数:获取值并 await GM.setValue() */ function getUrls() { let userUrl = document.querySelectorAll('.ilink'); let urlName = document.querySelector('#tMname').value; let urlLink = document.querySelector('#tMparseLink').value; let urlIntab = document.querySelector('#tMintabckbx').checked ? 1 : 0; let urls = []; if (urlName || urlLink) { urls.push({ name: urlName, link: urlLink, intab: urlIntab }); } for (var i = 0; i < userUrl.length; i++) { var n, t, l; t = userUrl[i].innerText; n = userUrl[i].previousSibling.innerText; l = userUrl[i].previousSibling.previousSibling.checked?'1':'0'; urls.push({ name: n, link: t,intab:l }); } return urls; } /* 执行 */ var divTag = document.createElement("div"); divTag.id = "TMHYd"; var txt = '', i = 0; /*提供的接口列表*/ for (i in apis) { txt += `