href.split('?');
return /(\.iqiyi\.com|\.youku\.com|\.le\.com|m\.bilibili.com|m\.miguvideo\.com|\.1905\.com|\.baofeng\.com|\.pptv\.com|\.letv\.com|v\.qq\.com|\.tudou\.com|\.mgtv\.com|\.sohu\.com)/.test(domain[0]);
}

function parseOUrl(link, title) {
var oLink = link.trim().split(/[\s@]+/);
var mUrl, pcUrl;
var urls = oLink.filter(v => /https?:\/\//.test(v));
oLink = oLink.filter(v => !/https?:\/\//.test(v));
urls.forEach(url => {
if (/\/\/m\.|\/m\//.test(url)) {
mUrl = url;
} else {
pcUrl = url;
}
});
var url = urls[0];
if (title) {
url = url.replace('**', title);
}
var name =
oLink.length > 0
? oLink.join(' ')
: url
.match(/\/\/(.+\.)?([^\/]+)\.\w+\//)[2]
.replace(/^(\w)/, function(v) {
return v.toUpperCase();
});
return { url, name };
}

function ensureArray(arr) {
return Array.isArray(arr) ? arr : arr.trim().split(/[\n\s]*\n+[\n\s]*/);
}

//parse interface
var s = window.vip;
s = ensureArray(s).map(function(v) {
return v.replace(/=http.+/g, '=');
});
console.log(s);
var vip = s.map(n=>parseOUrl(n,null));



addStyle(`
._V_vip_btn {
font-size: 18px;
width: 42px;
height: 42px;
bottom: 180px;
right: 20px;
color: #f8f9fa;
background: #40c057;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
text-shadow: 0 0 1px #2f9e44, 0 0 3px #2f9e44, 0 0 4px #2f9e44, 0 0 8px #2f9e44, 0 0 12px #51cf66, 0 0 2px #2f9e44, 0 0 20px #51cf66;
position: fixed;
z-index: 99999;
border-radius: 100%;
text-align: center;
display: flex;
justify-content: center;
align-items: center;
}

._V_vip_btn, ._V_vip_panel li {
transition: all .5s;
}

._V_vip_panel {
background: #fff;
box-shadow: 0px 1px 10px rgba(0,0,0,0.3);
margin: 0;
padding: 0 15px;
position: fixed;
bottom: 120px;
right: 72px;
z-index: 99999;
overflow: scroll;
border-radius: 5px;
max-height: 80vh;
}

._V_vip_panel li {
margin: 0;
font-size: 18px;
min-width: 128px;
text-align: left;
border-bottom: 1px solid #ffe8cc;
overflow: hidden;
white-space: nowrap;
padding: 8px 0;
letter-spacing: 1px;
}

._V_vip_title {
font-weight: bold;
color: #495057;
}

._V_vip_title:hover{
color: red;
}

._V_vip_url {
font-size: 0.85em;
color: #868e96;
}

._V_vip_url:hover {
color: red;
}
`);

loadVipFunc();

function loadVipFunc() {
if (isVip()) {
if (document.getElementById('VipButton') != null) {
return;
}
var myBtn = document.createElement('div');
var myul = document.createElement('ul');
myBtn.id = 'VipButton';
myBtn.innerHTML = 'VIP';
myBtn.classList.add('_V_vip_btn');
document.body.appendChild(myBtn);
myul.id = 'VipList';
myul.classList.add('_V_vip_panel');
myul.style.display = 'none';
for (var i = 0; i < vip.length; i++) {
var myli = document.createElement('li'); (function(num) {
myli.onclick = function() {
window.open(vip[num].url + tryGetRealUrl(location.href), '_blank');
};
})(i);
myli.innerHTML = '<p><span class="_V_vip_title">' + vip[i].name + '</span><br><span class="_V_vip_url">' + vip[i].url.match(/\/\/([^\/]+)\//)[1] + '</span></p>';
myul.appendChild(myli);
}
document.body.appendChild(myul);
myBtn.onclick = function() {
if (myul.style.display == 'none') {
myul.style.display = 'block';
myBtn.innerHTML = '➕';
myBtn.style.transform = 'rotateZ(45deg)';
} else {
myul.style.display = 'none';
myBtn.innerHTML = 'VIP';
myBtn.style.transform = 'rotateZ(0deg)';
}
};
}
}
function tryGetRealUrl(url) {
var realUrl = url;
try {
realUrl = getRealUrl(url);
} catch(err) {
console.log(err);
}
return realUrl;
}
function getYoukuRealUrl(url) {
var li = document.getElementsByClassName('hot-row-bottom')[0].children[0];
var data = li.getAttribute('data-param');
var s = data.split('svid=');
if (s.length > 1) {
var svid = s[1].split('&')[0];
return 'https://v.youku.com/v_show/id_' + svid + '.html';
}
return url;
}
function getRealUrl(url) {
var dataurl2 = url;
var txurlc = dataurl2.split(':');
var txurl = txurlc[1].slice(0, 12);
var ykurl = txurlc[1].slice(0, 13);
var ykdata = txurlc[1].slice(13);
if (ykurl == '//m.youku.com') {
return getYoukuRealUrl(url);
}
if (ykurl == '//m.youku.com') {
var txurlc = dataurl2.split(':');
var ykurl = txurlc[1].slice(0, 13);
var ykdata = txurlc[1].slice(13);
dataurl2 = 'http://www.youku.com' + ykdata;
} else if (ykurl == '//m.iqiyi.com') {
var txurlc = dataurl2.split(':');
var ykurl = txurlc[1].slice(0, 13);
var ykdata = txurlc[1].slice(13);
dataurl2 = 'https://www.iqiyi.com' + ykdata;
} else if (txurl == '//m.v.qq.com') {
var vid = getParam(dataurl2, 'vid');
var cid = getParam(dataurl2, 'cid');
var txdata2 = dataurl2.split('?');
var str = 'play.html';
if (txdata2[0].slice(txdata2[0].length - str.length) == str) {
if (cid.length > 1) {
dataurl2 = 'https://v.qq.com/x/cover/' + cid + '.html';
return dataurl2;
} else if (vid.length == 11) {
return 'https://v.qq.com/x/page/' + vid + '.html';
}
}
cid = txdata2[0].slice( - 20, -5);
if (vid.length == 11) {
dataurl2 = 'https://v.qq.com/x/cover/' + cid + '/' + vid + '.html';
} else {
dataurl2 = 'https://v.qq.com/x/cover/' + cid + '.html';
}
} else if (ykurl == '//m.le.com/vp') {
var leurlc = dataurl2.split('_');
var leurl = leurlc[1];
dataurl2 = 'http://www.le.com/ptv/vplay/' + leurl;
}
return dataurl2;
}
function getParam(dataurl2, name) {
return dataurl2.match(new RegExp('[?&]' + name + '=([^?

Prev | Next
Pg.: 1 2 3 4


Back to home | File page

Subscribe | Register | Login | N