// ==UserScript==
// @name TU-破解视频VIP集合
// @description VIP视频破解集合;支持爱奇艺,优酷视频,乐视TV,腾讯视频,土豆视频,搜狐视频,哔哩哔哩,音悦台,PPTV,华数TV;移除部分干扰广告。8月22日新增五大接口,解析速度更快,可供选择的更多
// @icon http://ww1.sinaimg.cn/large/6a155794ly1fubb8dy4pzj205k05kdg3.jpg
// @author AC
// @create 2018-08-16
// @run-at document-start
// @version 2.1
// @include *//www.iqiyi.com/v_*
// @include *//v.youku.com/v_show/*
// @include *//*.le.com/ptv/vplay/*
// @include *//v.qq.com/x/page/*
// @include *//v.qq.com/x/cover/*
// @include *//video.tudou.com/v/*
// @include *//*.mgtv.com/b/*
// @include *//tv.sohu.com/v/*
// @include *//film.sohu.com/album/*
// @include *//*.bilibili.com/bangumi/play/*
// @include *//*.pptv.com/show/*
// @include *//v.yinyuetai.com/video/*
// @include *://*.wasu.cn/Play/show/*
// @namespace TUJIDU
// @supportURL https://shang.qq.com/wpa/qunwpa?idkey=a2c2082506abd0b6f32816f05057ccec7febb02e228de769f527bd8c8eb82046
// @feedback-url https://shang.qq.com/wpa/qunwpa?idkey=a2c2082506abd0b6f32816f05057ccec7febb02e228de769f527bd8c8eb82046
// @copyright 2018, AC
// @lastmodified 2018-08-22
// @note 2018.08.22-2.1 新增好几个节点,并且暴露出url地址,方便在手机上观看视频
// @note 2018.08.16-1.1 第一版新增支持爱奇艺,优酷视频,乐视TV,腾讯视频,土豆视频,搜狐视频,哔哩哔哩,音悦台,PPTV,华数TV
// ==/UserScript==
(function(){
var mCurSite = null;
var Config = {
iqiyi:{
// 爱奇艺视频 https://www.iqiyi.com/v_19rrfq5ajk.html
insertTo:".mod-play-tit, .title-score, .side-content>.qy-play-list .main-title, .public-vip .public-vip-text",
adStyle:".pw-video>div[data-cupid]>div[style*='position']{display:none !important}",
sStyle:"width: 4rem;",
title:".detail-left #widget-videotitle",
},
youku:{
// 优酷视频 https://v.youku.com/v_show/id_XMzc2ODA1OTQwNA==.html?spm=a2hww.11359951.m_26665_c_32069.5~5!3~5!2~5~5~A
// 可用 https://v.youku.com/v_show/id_XMzc4MjEzMjg0NA==.html
insertTo:".title-wrap>h1, .tvinfo>h2, .vip_info .vip_limit_title",
adStyle:"",
sStyle:"",
title:".player-title .title-wrap>h1>span:nth-child(1)",
},
le:{
// 乐视TV http://www.le.com/ptv/vplay/28636951.html
insertTo:".briefIntro_tit, .column_body>.vip_tit, #le_playbox .playbox_vip_tip>h3",
adStyle:".layout_play iframe{display:none;}",
sStyle:"vertical-align: bottom;",
title:".briefIntro_box .briefIntro_tit>a",
},
qq:{
// 腾讯视频 https://v.qq.com/x/cover/au757x4acdk6jea.html
// https://v.qq.com/x/page/q0390tz0d2o.html
insertTo:".mod_intro>.video_base, .scroll_top .player_title, .tvip_open_wrap .tvip_open_lf>.tvip_open_btn",
adStyle:"",
sStyle:"height: 36px;line-height: 36px;margin: 0px 5px;font-size: 24px;width: 6rem;",
title:".player_headline ._video_title",
},
tudou:{ //---地址match也有待检查
// 土豆视频 http://video.tudou.com/v/XMzYxMzMyMDIzMg==.html
// TODO 限制参数请求必须是:http://yun.baiyug.cn/vip/index.php?url=http://video.tudou.com/v/XMzYxMzMyMDIzMg== 不能带别的参数
insertTo:".left-side .td-playbase .td-playbase__title, .td-listbox__b .td-listbox__list:nth-child(1) .td-video__meta__title",
adStyle:"",
sStyle:"width:unset;color: red !important;font-size:unset;",
title:".td-playbase #subtitle",
},
mgtv:{
// 芒果TV https://www.mgtv.com/b/318945/4470636.html
insertTo:".v-panel-title, .c-player-aside-filmdl .txt .tilname",
adStyle:"",
sStyle:"width: unset;font-size:unset;height:unset;line-height:unset;",
title:".v-panel-info .route-til",
},
sohu:{
// 搜狐视频 https://tv.sohu.com/v/MjAxODA4MDIvbjYwMDU3NzU0NS5zaHRtbA==.html
// https://film.sohu.com/album/9337002.html?channeled=1200030002 ---- 新增支持
insertTo:".videoBox .vBox-desktop, .playerBox .juji_tips>h4, #player_vipTips .vipTipsIn>.p1, .player_wrap .player-top-info .player-top-info-name, .detailInfo_box>p:nth-child(1)",
adStyle:"#crumbsBar .ad{display:none}.area>.left>.adv{display:none}",
sStyle:"",
title:"#crumbsBar .crumbs a:last",
},
bilibili:{
// 哔哩哔哩 可能还有其他的视频地址
// https://www.bilibili.com/bangumi/play/ep232412
insertTo:".header-info .count-wrapper, #bangumi_player .limit-vip-wrap .pwe-popup-pay",
adStyle:"",
sStyle:"width: 6rem;margin-top: -0.5rem;margin-left: 2rem;",
title:"#bangumi_detail .info-title h2",
},
pptv:{
// PPTV http://v.pptv.com/show/d2A9uiaKIibDaZF38.html?spm=vip_index_web.vip_d58855eb506e6c89f7eeb434e0955c41.0.0.0
insertTo:".player-sidebar .tithide li:nth-child(1)>a, #mainContent .cf ul.fl",
adStyle:"",
sStyle:"margin-top: 0.5rem;",
title:".mobilelook-pop-wrap .tv-name",
},
yinyuetai:{
// 音悦台 http://v.yinyuetai.com/video/3271056
// http://v.yinyuetai.com/playlist/265520 ---- 不支持这个地址
insertTo:".videoBox .video_info .videoName",
adStyle:"",
sStyle:"",
title:".videoName:first", // split(" ")
},
wasu:{
// 华数TV https://www.wasu.cn/Play/show/id/9567710
insertTo:".container .play_site h3, .play_video_b #play_vod_hits",
adStyle:".container div[class*='play_ads']{display:none}#MZAD_POP_PLACEHOLDER,.ad_list{display:none !important}",
sStyle:"",
title:".play_movie .play_video_t .player_info_m:first p a",
}
};
function initSite(){
for(var key in Config){
if(location.host.indexOf(key) > 0){
console.log("当前站点是:"+key);
mCurSite = Config[key];
break;
}
}
}
function safeRemove(node){
try{
faNodes[i].querySelector(".acInG").remove();
}catch (e) {
}
}
function TU_addStyle(css, className, addToTarget, isReload){ // 添加CSS代码,不考虑文本载入时间,带有className
var tout = setInterval(function(){
addToTarget = addToTarget || "body";
isReload = isReload || false;
if(document.querySelector(addToTarget) != null){
clearInterval(tout);
if(isReload == true){
safeRemove(document.querySelector("."+className));
}else if(isReload == false && document.querySelector("."+className) != null){
// 节点存在 && 不准备覆盖
return;
}
var cssNode = document.createElement("style");
if(className != null) cssNode.className = className;
cssNode.setAttribute("type", "text/css")
cssNode.innerHTML = css;
try{
document.querySelector(addToTarget).appendChild(cssNode);
}catch (e){console.log(e.message);}
}
}, 50);
}
function doInsert(){
if(mCurSite == null) return;
TU_addStyle(mCurSite.adStyle, "tu-ad-style-remove"); // 添加部分拦截广告的规则
let insertNode = document.createElement("span");
insertNode.style = ";width: 4.5rem;cursor: pointer; text-decoration: none; color: red; padding: 0px 5px; border: 1px solid red; font-size: 17px; display: inline-flex; height: 24px; line-height: 24px; margin: 0px 5px;" + mCurSite.sStyle;
insertNode.innerHTML = "VIP解析";
insertNode.target = "_balnk";
insertNode.className = "acInG";
let title = "";
try{
title = document.querySelector(mCurSite.title).innerText.split(" ")[0].trim();
title = encodeURIComponent(title);
}catch (e) {
// console.log(e);
}
insertNode.dataset.url = "http://vip.tujidu.com/vip/?url=" + encodeURIComponent(location.href.replace(/\?[\S]*|#[\S]*/, "")) + "&title="+title;
insertNode.setAttribute("onclick", "window.open(this.dataset.url);");
let faNodes = document.querySelectorAll(mCurSite.insertTo);
for(var i = 0; i < faNodes.length; i++){
if(faNodes[i].querySelector(".acInG:not([title])") == null){
console.log("新增节点");
safeRemove(faNodes[i].querySelector(".acInG"));
faNodes[i].appendChild(insertNode.cloneNode(true));
faNodes[i].setAttribute("acIns", "");
if(title != "") {
faNodes[i].setAttribute("title", title);
}
}
}
}
initSite();
(function(){
var tt = setInterval(function(){
doInsert();
}, 300);
setTimeout(function(){
clearInterval(tt);
}, 35000);
})();
})();