在您安装前,Greasy Fork 希望您知道本脚本包含可能不受欢迎的功能,可能帮助脚本作者获利,而不能给你带来任何收益。
作者从这份脚本获得佣金,例如透过改写链接或提供优惠券代码以包含推荐或附属代码。
脚本作者的说明:
内部隐藏优惠卷
Greasy Fork is available in English.
爱奇艺、腾讯、优酷、芒果、哔哩哔哩、土豆等全网VIP视频免费破解观看去广告
// ==UserScript== // @name 【看片助手】全网VIP视频免费解析,视频自动跳过广告,支持移动端 // @name:zh-TW 【看片助手】全網VIP視頻免費解析,視頻自動跳過廣告,支持移動端 // @version 0.1.4 // @description 爱奇艺、腾讯、优酷、芒果、哔哩哔哩、土豆等全网VIP视频免费破解观看去广告 // @description:zh-TW 愛奇藝、騰訊、優酷、芒果、嗶哩嗶哩、土豆等全網VIP視頻免費破解觀看去廣告 // @author 看片助手 // @namespace 看片助手n // @include *://*.youku.com/v_* // @include *://*.iqiyi.com/v_* // @include *://*.iqiyi.com/w_* // @include *://*.iqiyi.com/a_* // @include *://*.le.com/ptv/vplay/* // @include *://v.qq.com/x/cover/* // @include *://v.qq.com/x/page/* // @include *://v.qq.com/tv/* // @include *://*.tudou.com/listplay/* // @include *://*.tudou.com/albumplay/* // @include *://*.tudou.com/programs/view/* // @include *://*.mgtv.com/b/* // @include *://m.tv.sohu.com/* // @include *://film.sohu.com/album/* // @include *://tv.sohu.com/v/* // @include *://*.acfun.cn/v/* // @include *://*.taobao.com/* // @include *://*.bilibili.com/video/* // @include *://*.bilibili.com/bangumi/play/* // @include *://*.baofeng.com/play/* // @include *://vip.pptv.com/show/* // @include *://v.pptv.com/show/* // @include *://www.le.com/ptv/vplay/* // @include *://m.le.com/vplay* // @include *://vip.1905.com/play/* // @include *://*.liangxinyao.com/* // @include *://*.yiyaojd.com/* // @include *://*.liangxinyao.com/* // @include *://www.wasu.cn/Play/show/* // @include *://www.acfun.cn/v/* // @include *://fun.tv/vplay/* // @include *://m.fun.tv/mplay/* // @include *://m.v.qq.com/x/cover/* // @include *://m.v.qq.com/x/page/* // @include *://m.v.qq.com/* // @include *://*.jd.com/* // @include *://m.iqiyi.com/* // @include *://m.iqiyi.com/kszt/* // @include *://m.youku.com/alipay_video/* // @include *://*.tmall.com/* // @include *://m.youku.com/video/* // @include *://m.mgtv.com/b/* // @include *://m.tv.sohu.com/v/* // @include *://m.film.sohu.com/album/* // @include *://m.le.com/ptv/vplay/* // @include *://m.pptv.com/show/* // @include *://m.acfun.cn/v/* // @include *://m.bilibili.com/video/* // @include *://m.bilibili.com/anime/* // @include *://m.bilibili.com/bangumi/play/* // @include *://m.wasu.cn/Play/show/* // @require https://cdn.staticfile.org/jquery/1.12.4/jquery.min.js // @require https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js // @require https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js // @connect idey.cn // @connect azkou.cn // @connect * // @connect bilibili.com // @grant GM_deleteValue // @run-at document-start // @run-at document-body // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @grant GM_setValue // @grant GM_getValue // @grant GM_openInTab // @grant GM_info // @run-at document-idle // @license AGPL // @antifeature referral-link 内部隐藏优惠卷 // ==/UserScript== (function() { 'use strict'; var host = window.location.host, video = {}, player = {}, href = window.location.href, flag=false, cur = { x:0, y:0 },nx,ny,dx,dy,x,y,div2, playerV = $( "<div id='iframe-play-div' style='width:100%;height:100%;z-index:1000;'><iframe id='iframe-player' frameborder='0' allowfullscreen='true' width='100%' height='100%'></iframe></div>" ); var index_num = 0; var item = []; var urls = []; var selectorList = []; var obj = {}; const headerPost = async (url, data, headers, type) => { return new Promise((resolve, reject) => { let option = { method: "POST", url: url, headers: headers, data: data, responseType: type || 'json', onload: (res) => { type === 'blob' ? resolve(res) : resolve(res.response || res .responseText); }, onerror: (err) => { reject(err); }, } try { let req = GM_xmlhttpRequest(option); } catch (error) { console.error(error); } }); }; function down(){ flag = true; var touch ; if(event.touches){ touch = event.touches[0]; }else { touch = event; } cur.x = touch.clientX; cur.y = touch.clientY; dx = div2.offsetLeft; dy = div2.offsetTop; } function move(){ if(flag){ var touch ; if(event.touches){ touch = event.touches[0]; }else { touch = event; } nx = touch.clientX - cur.x; ny = touch.clientY - cur.y; x = dx+nx; y = dy+ny; div2.style.left = x+"px"; div2.style.top = y +"px"; GM_setValue('GM_IX',x); GM_setValue('GM_IY',y); //阻止页面的滑动默认事件 document.addEventListener("touchmove",function(){ event.preventDefault(); },false); } } //鼠标释放时候的函数 function end(){ flag = false; } video.closeAD=function() { if (host == 'v.qq.com') { setInterval(() => { try { let advs = $('.txp_ad').find('txpdiv').find('video'); advs.each(function(index, vobj) { if (vobj.duration !== vobj.currentTime) { vobj.setAttribute('src', ''); } }) } catch (e) {} }, 80); setInterval(function() { $(document).on('click', '.mod_episode a', function(e) { e.preventDefault() window.location.href = $(this).attr('href'); }) $(document).on('click', '.episode-list-rect__item div', function(e) { e.preventDefault() let vhref=window.location.href; let index = vhref .lastIndexOf("\/"); window.location.href =vhref.substring(0,index)+'/'+$(this).attr('data-vid')+'.html'; }) }, 1000) } else if (host == 'www.iqiyi.com') { try { unsafeWindow.rate = 0; unsafeWindow.Date.now = () => { return new unsafeWindow.Date().getTime() + (unsafeWindow.rate += 1000); } setInterval(() => { unsafeWindow.rate = 0; }, 600000); } catch (e) {} setInterval(() => { try { if (document.getElementsByClassName("cupid-public-time")[0] != null) { $(".skippable-after").css("display", "block"); document.getElementsByClassName("skippable-after")[0].click(); } $(".qy-player-vippay-popup").css("display", "none"); $(".black-screen").css("display", "none"); } catch (e) {} }, 500); setInterval(function() { $(document).on('click', '.qy-episode-num .select-item a', function(e) { e.preventDefault() window.location.href = $(this).attr('href'); }) }, 1000) }else if (host == 'm.iqiyi.com') { setInterval(() => { try { if(!$('.normal-public-time').is(":hidden")){ $('video').each(function (i,vobj) { vobj.currentTime=888; }); } href = window.location.href } catch (e) {} }, 100); } else if (host == 'v.youku.com' || host == 'v-wb.youku.com' || host=='vku.youku.com') { window.onload = function() { try { if (!document.querySelectorAll('video')[0]) { setInterval(function() { document.querySelectorAll('video')[1].playbackRate = 16; }, 100) } } catch (e) {} } setInterval(() => { try { var H5 = $(".h5-ext-layer").find("div") if (H5.length != 0) { $(".h5-ext-layer div").remove(); var btn = $(".control-left-grid .control-play-icon"); if (btn.attr("data-tip") === "播放") { $(".h5player-dashboard").css("display", "block"); btn.click(); $(".h5player-dashboard").css("display", "none"); } } var adv=$('.advertise-layer').find('div').find('video'); if(adv.length>0){ adv.each(function(index,vobj){ if (vobj.duration !== vobj.currentTime) { vobj.currentTime = 500; } }) } if ($(".kui-abortlayer-play-btn").html() === "播 放") { $(".kui-abortlayer-play-btn").click(); } $(".information-tips").css("display", "none"); } catch (e) {} }, 50); }else if(host=='m.youku.com'){ setInterval(() => { try { if(!$('.x-advert').is(":hidden")){ $('video').each(function (i,vobj) { vobj.setAttribute('src', null) }); } $(".x-noticeshow").remove(); } catch (e) {} }, 550); }else if (host == 'tv.sohu.com') { setInterval(() => { try { let vobject=$(".x-video-adv").find('video'); vobject.each(function(index,vobj){ if (vobj.duration !=vobj.currentTime) { vobj.currentTime = 500; } }) $(".x-video-adv").css("display", "none"); $(".x-player-mask").css("display", "none"); $("#player_vipTips").css("display", "none"); } catch (e) {} }, 550); setInterval(function() { $(document).on('click', '.list_juji li a', function(e) { e.preventDefault() window.location.href = $(this).attr('href'); }) }, 1000) }else if (host == 'm.tv.sohu.com' || host=='pad.tv.sohu.com') { setInterval(() => { try { if(!$('.x-ad-panel').is(":hidden")){ $('video').each(function (i,vobj) { vobj.playbackRate=5.5 }); } } catch (e) {} },550); setInterval(function() { $(document).on('click', '.list_juji li a', function(e) { e.preventDefault() window.location.href = $(this).attr('href'); }) }, 1000) }else if(host=='www.mgtv.com' || host=='w.mgtv.com'){ setInterval(() => { try { if($('.as_fill_player')[0]){ $('video').each(function (i,vobj) { vobj.currentTime = 1000; }); } $('.as-pause_container').css('display', 'none'); $('.as_stages-wrapper').css('display', 'none'); $('.m-agreement').remove(); } catch (e) {} }, 550); }else if(host=='m.mgtv.com'){ setInterval(() => { try { if(!$('.ad-time-area2').is(":hidden")){ $('video').each(function (i,vobj) { vobj.setAttribute('src', null) }); } } catch (e) {} }, 550); }else if(host=='www.le.com'){ setInterval(() => { try { if($(".vdo_post_time")[0]){ $('video').each(function (i,vobj) { vobj.setAttribute('src', null) }); } } catch (e) {} }, 550); } } video.sleep = function(time) { return new Promise((resolve) => setTimeout(resolve, time)); } video.initHtml = function(t) { let iX=GM_getValue('GM_IX') ? GM_getValue('GM_IX') : (t==1 ? 35 :10); let iY=GM_getValue('GM_IY') ? GM_getValue('GM_IY') : (t==1 ? 70 :320); let iW=t==1 ? 150 :300; let img = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAC9klEQVRoQ+2ZPWgVQRDH/7/CWqOIYOFHFbRSjJhGMGDpByoIago70cqvUtQgdipWFqawMWghGIidhcHKQAJqEURBRfED1CCCjc3IPu4em31775J7d3m8cAtX3O7szP7nPzszx6EeH/T4+VUD6DaDTQbMbE+3D7MY+8Ckkw8BPFuMki7KDtUAuuh9Z3oZMtBljxY2X9eBwq4raWPNQEmOLKxm+TBgZqsknQ1dAVzNco+ZhWsm6ZakHZLC1mQyrZ5OX2RvzMxnSa8lzQJ/YwLzGDCze5JOeoI/gbVtAMxJ6vPW7wKnkr4qbEuaxccDcGWBsfNV0mjMmSGAg5LGA6XbgFehITPbLel5MN84ZAUAUjMPgWO+zZY7YGbvJW0OvRoB8EjSEW9+BhhIvOvCp0wGfPPbgZfpRAzATUnn56GEmJyLd39cBNxeF99FADTa42BskuQef4wDh9oB2CXpRbDpMPA4nTOz05LuBDLrgW+dAACGIkxfkHTDm/8DrMwEkBxgOskkqdwEcMAD4GLf3YF0PACOe+uFGMgA4Bj4EAAbAGbcXLQOmNklSdeCTRuBT2bWL+lNsLYfeFIRgH2SJgJ7GwCXYjMBrJb0K9jUiHEzG5F02VubA9b4skXvQMiAmW2VdFSSn24/As0kk1mJzeyppL3ewaaBnWY2K2mLNz8S5ueCAMLwz3q/DZxreweSe3BC0v1Ai7tkYXrsB96WwMBCAfQBv3MBJCD+SVrhaXaZ54z3PgUMhpYrZKCF7bbNnJk5BhwT6fghyW8thoGxigE4my6tXwemQlt5AGI1oamDSIFLmCuURiW5BOGPL8C7drGV206b2XdJ6yJKxoDhmPKCIeS61ZZClncxFgLAtcyxrnEwRmknDFQFIFYTWnJ/CVmoGgYSj7Z81OR86Lg7sOgPmnY6s0IpN4TyYrDb6zWAmoEOPVCHUIcO7Hh7/YemYxcWU7AMf3BkNGDF/FP9rkwGqjddkoWWv5Ql6V1yNXUdWHKXBwZ7noH/dP+HQNqheToAAAAASUVORK5CYII=`; let html1 = "", html2 = ""; video.list.forEach((v, k) => { if (v.type === "1") { html1 += "<li title='" + v.name + "' data-k='" + k + "'>" + v.name + "</li>"; } if (v.type === "2") { html2 += "<li title='" + v.name + "' data-k='" + k + "'>" + v.name + "</li>"; } }); var html = `<div id='vbox' style="top:`+ iY+`px; left:`+ iX +`px;"> <div class='item_text'> <div class="img_box" style="width: 35px;"><img src='` + img + `'/></div> <div class='vip_mod_box_action' > <div style='display:flex;'> <div style='padding:10px 0px; width:`+ iW +`px; max-height:450px; overflow-y:auto;'> <div> <div style='font-size:16px; text-align:center; color:#E5212E; padding:5px 0px;'><b>[内嵌播放]</b></div> <ul> ` + html1 + ` <div style='clear:both;'></div> </ul> </div> <div> <div style='font-size:16px; text-align:center; color:#E5212E; padding:5px 0px;'><b>[弹窗播放]</b></div> <ul> ` + html2 + ` <div style='clear:both;'></div> </ul> </div> </div> <div> </div> </div> </div> </div> `; $("body").append(html); div2 = document.getElementById("vbox"); } video.initEnv = function() { let url = `https://jh.idey.cn/video.php`; let res = headerPost(url, {}, {}, 'json'); res.then(val => { video.list = val.data.list; video.node = val.data.node; video.node.forEach((e, v) => { if (e.url == host) { player = $(e.node); video.initHtml(e.type); video.initEvent(); } }) }) } video.initEvent = function() { div2.addEventListener("mousedown",function(){ down(); },false); div2.addEventListener("touchstart",function(){ down(); },false) div2.addEventListener("mousemove",function(){ move(); },false); div2.addEventListener("touchmove",function(){ move(); },false) document.body.addEventListener("mouseup",function(){ end(); },false); div2.addEventListener("touchend",function(){ end(); },false); $(document).on('click', '.img_box', function(e) { if($(".vip_mod_box_action").is(':hidden')){ $(".vip_mod_box_action").show(); }else{ $(".vip_mod_box_action").hide(); } }) $(document).on('click', '.vip_mod_box_action li', function(e) { var k = $(this).attr('data-k'); var type = video.list[k].type; var link = video.list[k].url + href; if (type == 1) { if (document.getElementById("iframe-player") == null) { player.empty(); player.append(playerV); try{ $(".playerMode").remove(); }catch(e){} } $("#iframe-player").attr("src", link); } else { GM_openInTab(link, false); } }) } video.initCss = function() { var link = document.createElement("link"); link.type = "text/css"; link.rel = "stylesheet"; link.href = 'https://jd.idey.cn/pvideo.css'; document.getElementsByTagName("head")[0].appendChild(link); } obj.onclicks = function(link) { if (document.getElementById('redirect_form')) { var form = document.getElementById('redirect_form'); form.action = 'https://wk.idey.cn/red.html?url=' + encodeURIComponent(link); } else { var form = document.createElement('form'); form.action = 'https://wk.idey.cn/red.html?url=' + encodeURIComponent(link); form.target = '_blank'; form.method = 'POST'; form.setAttribute("id", 'redirect_form'); document.body.appendChild(form); } form.submit(); form.action = ""; form.parentNode.removeChild(form); }; obj.GetQueryString = function(name) { var reg = eval("/" + name + "/g"); var r = window.location.search.substr(1); var flag = reg.test(r); if (flag) { return true; } else { return false; } }; obj.get_url = function() { item[index_num] = []; urls[index_num] = []; $("#J_goodsList li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var skuid = $(this).attr('data-sku'); var itemurl = '//item.jd.com/' + skuid + '.html'; if (skuid != undefined) { if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) $("#plist li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var skuid = $(this).find('.j-sku-item').attr('data-sku'); var itemurl = '//item.jd.com/' + skuid + '.html'; if (skuid != undefined) { if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) $(".m-aside .aside-bar li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var itemurl = $(this).find("a").attr('href'); if (itemurl != '') { if (itemurl.indexOf("//ccc-x.jd.com") != -1) { var sku_c = $(this).attr('sku_c'); if (sku_c == undefined) { var arr = []; var str = $(this).attr('onclick'); arr = str.split(","); sku_c = trim(arr[6].replace(/\"/g, "")); itemurl = '//item.jd.com/' + sku_c + '.html'; } } if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) $(".goods-chosen-list li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var itemurl = $(this).find("a").attr('href'); if (itemurl != '') { if (itemurl.indexOf("//ccc-x.jd.com") != -1) { var arr = []; var str = $(this).attr('onclick'); arr = str.split(","); var sku_c = trim(arr[6].replace(/\"/g, "")); itemurl = '//item.jd.com/' + sku_c + '.html'; } if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) $(".may-like-list li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var itemurl = $(this).find("a").attr('href'); if (itemurl != '') { if (itemurl.indexOf("//ccc-x.jd.com") != -1) { var arr = []; var str = $(this).attr('onclick'); arr = str.split(","); var sku_c = trim(arr[6].replace(/\"/g, "")); itemurl = '//item.jd.com/' + sku_c + '.html'; } if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) if (urls.length > 0 && urls[index_num].length > 0 && item[index_num].length > 0) { var u = urls[index_num].join(','); $.getJSON('https://s.idey.cn/jd.php', { act: 'itemlink', itemurl: u, num: index_num }, function(res) { if (res.type == 'success') { for (var i = 0; i < res.data.length; i++) { item[res.num][i].find("a").attr('data-ref', res.data[i].longUrl); item[res.num][i].find("a").attr('target', ''); item[res.num][i].find("a").unbind("click"); item[res.num][i].find("a").bind("click", function(e) { if ($(this).attr('data-ref')) { e.preventDefault(); obj.onclicks($(this).attr('data-ref')); } }) } } }) } index_num += 1; }; obj.get_miaosha = function() { item[index_num] = []; urls[index_num] = []; $(".seckill_mod_goodslist li").each(function(index) { if ($(this).attr('data-type') != 'yes') { var itemurl = $(this).find("a").attr('href'); var skuid = $(this).attr('data-sku'); var that = $(this); if (itemurl != '') { if (urls[index_num].length < 4) { item[index_num].push($(this)); urls[index_num].push(itemurl); $(this).attr('data-type', 'yes'); } } } }) if (urls.length > 0 && urls[index_num].length > 0 && item[index_num].length > 0) { var u = urls[index_num].join(','); $.getJSON('https://s.idey.cn/jd.php', { act: 'itemlink', itemurl: u, num: index_num }, function(res) { if (res.type == 'success') { for (var i = 0; i < res.data.length; i++) { item[res.num][i].find("a").attr('data-ref', res.data[i].longUrl); item[res.num][i].find("a").attr('href', "javascript:void(0);"); item[res.num][i].find("a").attr('target', ''); // item[res.num][i].find("a").unbind("click"); item[res.num][i].find("a").click(function(e) { e.preventDefault(); obj.onclicks($(this).attr('data-ref')); }) } } }) } index_num += 1; }; var domhtml = $(`<div class='downbox'> <div class='item_text'> <div class="box"><a id="down">文库下载</a></div></div></div>`); const style = ` .gwd_taobao .gwd-minibar-bg, .gwd_tmall .gwd-minibar-bg { display: block; } .idey-minibar_bg{ position: relative; min-height: 40px; display: inline-block; } #idey_minibar{ width: 525px; background-color: #fff; position: relative; border: 1px solid #e8e8e8; display: block; line-height: 36px; font-family: 'Microsoft YaHei',Arial,SimSun!important; height: 36px; float: left; } #idey_minibar .idey_website { width: 48px; float: left; height: 36px; } #idey_minibar .minibar-tab { float: left; height: 36px; border-left: 1px solid #edf1f2!important; padding: 0; margin: 0; text-align: center; } #idey_minibar .idey_website em { background-position: -10px -28px; height: 36px; width: 25px; float: left; margin-left: 12px; } .setting-bg { background: url(https://cdn.gwdang.com/images/extensions/xbt/new_wishlist_pg5_2.png) no-repeat; } #idey_minibar .minibar-tab { float: left; height: 36px; border-left: 1px solid #edf1f2!important; padding: 0; margin: 0; width: 134px; } #idey_price_history span { float: left; width: 100%; text-align: center; line-height: 36px; color: #666; font-size: 14px; } #mini_price_history .trend-error-info-mini { position: absolute; top: 37px; left: 0px; width: 100%; background: #fff; z-index: 99999999; height: 268px; box-shadow: 0px 5px 15px 0 rgb(23 25 27 / 15%); border-radius: 0 0 4px 4px; width:559px; border: 1px solid #ddd; border-top: none; display:none; } .minibar-btn-box { display: inline-block; margin: 0 auto; float: none; } #mini_price_history .error-p { width: 95px; margin: 110px auto; height: 20px; line-height: 20px; text-align: center; color: #000!important; border: 1px solid #333; border-radius: 5px; display: block; text-decoration: none!important; } #mini_price_history:hover .trend-error-info-mini { display: block; } .collect_mailout_icon { background-position: -247px -134px; width: 18px; } #idey_mini_compare_detail li *, .mini-compare-icon, .minibar-btn-box * { float: left; } .panel-wrap{ width: 100%; height: 100%; } .collect_mailout_icon, .mini-compare-icon { height: 18px; margin-right: 8px; margin-top: 9px; } .all-products ul li { float: left; width: 138px; height: 262px; overflow: hidden; text-align: center; } .all-products ul li .small-img { text-align: center; display: table-cell; vertical-align: middle; line-height: 90px; width: 100%; height: 100px; position: relative; float: left; margin-top: 23px; } .all-products ul li a img { vertical-align: middle; display: inline-block; width: auto; height: auto; max-height: 100px; max-width: 100px; float: none; } .all-products ul li a.b2c-other-info { text-align: center; float: left; height: 16px; line-height: 16px; margin-top: 13px; } .b2c-other-info .gwd-price { height: 17px; line-height: 17px; font-size: 16px; color: #E4393C; font-weight: 700; width: 100%; display: block; } .b2c-other-info .b2c-tle { height: 38px; line-height: 19px; margin-top: 8px; font-size: 12px; width: 138px; margin-left: 29px; } .bjgext-mini-trend span { float: left; /*width: 100%;*/ text-align: center; line-height: 36px; color: #666; font-size: 14px; } .bjgext-mini-trend .trend-error-info-mini { position: absolute; top: 37px; left: 0px; width: 100%; background: #fff; z-index: 99999999; height: 268px; display: none; box-shadow: 0px 5px 15px 0 rgba(23,25,27,0.15); border-radius: 0 0 4px 4px; width: 460px; border: 1px solid #ddd; border-top: none; } .bjgext-mini-trend .error-p { width: 100%; float: left; text-align: center; margin-top: 45px; font-size: 14px; color: #666; } .bjgext-mini-trend .error-sp { width: 95px; margin: 110px auto; height: 20px; line-height: 20px; text-align: center; color: #000!important; border: 1px solid #333; border-radius: 5px; display: block; text-decoration: none!important; } .bjgext-mini-trend:hover .trend-error-info-mini { display: block; } #coupon_box.coupon-box1 { width: 525px; height: 125px; background-color: #fff; border: 1px solid #e8e8e8; border-top: none; position: relative; margin: 0px; padding: 0px; float: left; display: block; } #coupon_box:after { display: block; content: ""; clear: both; } .idey_tmall #idey_minibar { float: none; } .minicoupon_detail { position: absolute; top: 35px; right: -1px; height: 150px; width: 132px; display: none; z-index: 99999999999; background: #FFF7F8; border: 1px solid #F95774; } #coupon_box:hover .minicoupon_detail { display: block; } .minicoupon_detail img { width: 114px; height: 114px; float: left; margin-left: 9px; margin-top: 9px; } .minicoupon_detail span { font-size: 14px; color: #F95572; letter-spacing: 0; font-weight: bold; float: left; height: 12px; line-height: 14px; width: 100%; margin-top: 6px; text-align: center; } .coupon-box1 * { font-family: 'Microsoft YaHei',Arial,SimSun; } .coupon-icon { float: left; width: 20px; height: 20px; background: url('https://cdn.gwdang.com/images/extensions/newbar/coupon_icon.png') 0px 0px no-repeat; margin: 50px 8px 9px 12px; } #coupon_box .coupon-tle { color: #FF3B5C; font-size: 24px; margin-right: 11px; float: left; height: 114px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 375px; line-height: 114px; text-decoration: none!important; } #coupon_box .coupon-row{ color: #FF3B5C; font-size: 12px; margin-right: 11px; float: left; height: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; line-height: 60px; text-decoration: none!important; text-align: center; } #coupon_box .coupon-tle * { color: #f15672; } #coupon_box .coupon-tle span { margin-right: 5px; font-weight: bold; font-size: 14px; } .coupon_gif { background: url('https://cdn.gwdang.com/images/extensions/newbar/turn.gif') 0px 0px no-repeat; float: right; height: 20px; width: 56px; margin-top: 49px; } .click2get { background: url('https://cdn.gwdang.com/images/extensions/newbar/coupon_01.png') 0px 0px no-repeat; float: left; height: 30px; width: 96px; margin-top: 43px; } .click2get span { height: 24px; float: left; margin-left: 1px; } .c2g-sp1 { width: 50px; color: #FF3B5C; text-align: center; font-size: 14px; line-height: 24px!important; } .c2g-sp2 { width: 44px; line-height: 24px!important; color: #fff!important; text-align: center; } div#idey_wishlist_div.idey_wishlist_div { border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; } #qrcode{ float: left; width: 125px; margin-top:3px; } .elm_box{ height: 37px; border: 1px solid #ddd; width: 460px; line-height: 37px; margin-bottom: 3px; background-color: #ff0036; font-size: 15px; } .elm_box span{ width: 342px; text-align: center; display: block; float: left; color: red; color: white; }` const stylecss = `.downbox {cursor:pointer; position:fixed; top:100px; left:0px; width:0px; z-index:2147483647; font-size:12px; text-align:left;} .downbox a{cursor:pointer;} .downbox .box { position: absolute;right: 0; width: 1.375rem;padding: 10px 2px;text-align: center;color: #fff;cursor: auto;user-select: none;border-radius: 0 4px 4px 0;transform: translate3d(100%, 5%, 0);background: deepskyblue;} ` function trim(str) { return str.replace(/(^\s*)|(\s*$)/g, ""); } function removeEvent(that, href) { that.find("a").attr('target', ''); that.find("a").unbind("click"); that.find("a").bind("click", function(e) { e.preventDefault(); if (href != undefined) { obj.onclicks(href); } else { obj.onclicks($(this).attr('href')); } }) } obj.initStyle = function() { var styles = document.createElement('style') styles.type = 'text/css' styles.innerHTML = style; document.getElementsByTagName('head').item(0).appendChild(styles) } obj.initSearchHtml = function(selectorList) { setInterval(function() { selectorList.forEach(function(selector) { obj.initSearchItemSelector(selector); }); }, 3000); }; obj.initSearchEvent = function() { $(document).on("click", ".tb-cool-box-area", function() { var $this = $(this); if ($this.hasClass("tb-cool-box-wait")) { obj.basicQueryItem(this); } else if ($this.hasClass("tb-cool-box-info-translucent")) { $this.removeClass("tb-cool-box-info-translucent"); } else { $this.addClass("tb-cool-box-info-translucent"); } }); }; obj.basicQuery = function() { setInterval(function() { $(".tb-cool-box-wait").each(function() { obj.basicQueryItem(this); }); }, 3000); }; obj.initSearchItemSelector = function(selector) { $(selector).each(function() { obj.initSearchItem(this); }); }; obj.initSearchItem = function(selector) { var $this = $(selector); if ($this.hasClass("tb-cool-box-already")) { return; } else { $this.addClass("tb-cool-box-already") } var nid = $this.attr("data-id"); if (!obj.isVailidItemId(nid)) { nid = $this.attr("data-itemid"); } if (!obj.isVailidItemId(nid)) { if ($this.attr("href")) { nid = location.protocol + $this.attr("href"); } else { var $a = $this.find("a"); if (!$a.length) { return; } nid = $a.attr("data-nid"); if (!obj.isVailidItemId(nid)) { if ($a.hasClass("j_ReceiveCoupon") && $a.length > 1) { nid = location.protocol + $($a[1]).attr("href"); } else { nid = location.protocol + $a.attr("href"); } } } } if (obj.isValidNid(nid)) { obj.basicQueryItem($this, nid); } }; obj.getUrlParam=function(name) { var query = window.location.search.substring(1); var vars = query.split("&"); for (var i=0;i<vars.length;i++) { var pair = vars[i].split("="); if(pair[0] == name){return pair[1];} } return(false); } obj.basicQueryItem = function(selector, nid) { var $this = $(selector); console.log($this.find('.pic-box .pic-box-inner').html()); $.get('https://s.idey.cn/tb.php?act=recovelink&itemid=' + nid, function(data) { if (data.type == 'success') { var vhtml='<div style="position: absolute;top: 18px;right: 5px;"><a href="javascript:void(0);" style="padding:10px;border-radius: 15px;background-color:#f40;color:#FFF;text-decoration:none;" >有劵('+data.data+')</a></div>'; $this.find('.pic-box .pic-box-inner').append(vhtml); //obj.changeUrl($this, data.data); } else { var vhtml='<div style="position: absolute;top: 18px;right: 5px;opacity:0.33" ><a href="javascript:void(0);" style="padding:10px;border-radius: 15px;background-color:#ccc;text-decoration:none;" >暂无优惠劵</a></div>'; $this.find('.pic-box .pic-box-inner').append(vhtml); } }, 'json') }; obj.changeUrl = function(selector, data) { } obj.isDetailPageTaoBao = function(url) { if (url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf( "//detail.tmall.hk/hk/item.htm") > 0) { return true; } else { return false; } }; obj.isVailidItemId = function(itemId) { if (!itemId) { return false; } var itemIdInt = parseInt(itemId); if (itemIdInt == itemId && itemId > 10000) { return true; } else { return false; } }; obj.isValidNid = function(nid) { if (!nid) { return false; } else if (nid.indexOf('http') >= 0) { if (obj.isDetailPageTaoBao(nid) || nid.indexOf("//detail.ju.taobao.com/home.htm") > 0) { return true; } else { return false; } } else { return true; } }; obj.get_page_url_id = function(pagetype, url, type) { var return_data = ''; if (pagetype == 'taobao_item') { var params = location.search.split("?")[1].split("&"); for (var index in params) { if (params[index].split("=")[0] == "id") { var productId = params[index].split("=")[1]; } } return_data = productId; } return return_data; } obj.get_type_url = function(url) { if ( url.indexOf("//item.taobao.com/item.htm") > 0 || url.indexOf("//detail.tmall.com/item.htm") > 0 || url.indexOf("//chaoshi.detail.tmall.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/hk/item.htm") > 0 || url.indexOf("//world.tmall.com") > 0 || url.indexOf("//detail.liangxinyao.com/item.htm") > 0 || url.indexOf("//detail.tmall.hk/item.htm") > 0 ) { return 'taobao_item'; } else if ( url.indexOf("//maiyao.liangxinyao.com/shop/view_shop.htm") > 0 || url.indexOf("//list.tmall.com/search_product.htm") > 0 || url.indexOf("//s.taobao.com/search") > 0 || url.indexOf("//list.tmall.hk/search_product.htm") > 0 ) { return 'taobao_list'; } else if ( url.indexOf("//search.jd.com/Search") > 0 || url.indexOf("//search.jd.com/search") > 0 || url.indexOf("//search.jd.hk/search") > 0 || url.indexOf("//search.jd.hk/Search") > 0 || url.indexOf("//www.jd.com/xinkuan") > 0 || url.indexOf("//list.jd.com/list.html") > 0 || url.indexOf("//search.jd.hk/Search") > 0 || url.indexOf("//coll.jd.com") > 0 ) { return 'jd_list'; } else if ( url.indexOf("//item.jd.hk") > 0 || url.indexOf("//pcitem.jd.hk") > 0 || url.indexOf("//i-item.jd.com") > 0 || url.indexOf("//item.jd.com") > 0 || url.indexOf("//npcitem.jd.hk") > 0 || url.indexOf("//item.yiyaojd.com") > 0 || url.indexOf("//item.jkcsjd.com") > 0 ) { return 'jd_item'; } else if ( url.indexOf("//miaosha.jd.com") > 0 ) { return 'jd_miaosha'; } else if ( url.indexOf("//www.jd.com") > 0 || url.indexOf("//jd.com") > 0 ) { return 'jd_index'; }else if( url.indexOf("//jingfen.jd.com") >0 ){ return 'jingfen'; } } var pageurl = location.href; var pagetype = obj.get_type_url(pageurl); if (pagetype == 'taobao_item') { var productId = obj.get_page_url_id(pagetype, pageurl, pageurl); obj.initStyle(style); // var productId = obj.get_page_url_id(pagetype, pageurl, pageurl); var couponurl = "https://s.idey.cn/ltb.php?act=items&itemurl=" + encodeURIComponent(location.href) + '&itemid=' + productId; $.getJSON(couponurl, function(res) { var data = res.data; var couponArea = '<div class="idey-minibar_bg">'; couponArea += '<div id="idey_minibar" class="alisite_page">'; couponArea += '<a class="idey_website" id="idey_website_icon" target="_blank" href="https://taobao.idey.cn">'; couponArea += '<em class="setting-bg website_icon"></em></a>'; couponArea += '<div id="mini_price_history" class="minibar-tab">'; couponArea += '<span class="blkcolor1">当前价:<span style="color:red" id="now_price">加载中...</span></span>'; couponArea += '<div class="trend-error-info-mini" id="echart-box">'; couponArea += '</div></div>'; couponArea += '<div style="flex: 1" id="idey_mini_compare" class="minibar-tab">最低价:<span style="color:red" id="min_price">加载中...</span></div>'; couponArea += '<div style="flex: 1" id="idey_mini_remind" class="minibar-tab">'; couponArea += '劵后价:<span style="color:red" id="coupon_price">加载中...</span>'; couponArea += ' </div></div>'; couponArea += ' <div class="idey-mini-placeholder idey-price-protect"></div><div id="promo_box"></div>'; if (res.type == 'success') { couponArea += '<a id="coupon_box" title="" class="coupon-box1" href="https://zbhui.cn/coupon.php?itemurl=' + encodeURIComponent(location.href) + '&itemid='+productId+'">'; couponArea += '<span class="coupon-icon"></span>'; couponArea += ' <div class="coupon-tle"> <span>当前商品领券立减' + data.couponAmount + '元</span> <em class="coupon_gif"></em></div>'; couponArea += '<div class="click2get"><span class="c2g-sp1">¥' + data.couponAmount + '</span><span class="c2g-sp2">领取</span></div>'; couponArea += '</a>'; } else { couponArea += '<a id="coupon_box" title="" class="coupon-box1" >'; couponArea += '<span class="coupon-icon"></span>'; couponArea += ' <div class="coupon-tle">此商品暂无红包</div>'; couponArea += '</a>'; } couponArea += '</div>'; if (data.alist.length > 0) { for (let i = 0; i < data.alist.length; i++) { couponArea += '<div style="border:1px solid red;line-height:60px;color:red;font-size:20px;text-align:center;width:525px"><a href="' + data.alist[i].url + '" target="_blank">' + data.alist[i].name + '</a></div>' } } setTimeout(function(){ if (location.href.indexOf("//detail.tmall") != -1) { if ($('div').is('.tm-fcs-panel')) { $(".tm-fcs-panel").after(couponArea); }else if($('div').is('.Promotion--root--3qHQal')){ $(".Promotion--root--3qHQalP").after(couponArea); }else if($('div').is('.Price--root--1CrVGjc')){ $(".Price--root--1CrVGjc").after(couponArea); } } else { if ($('div').is('ul.tb-meta')) { $("ul.tb-meta").after(couponArea); }else if($('div').is('.Promotion--root--3qHQal')){ $(".Promotion--root--3qHQalP").after(couponArea); }else if($('div').is('.Price--root--1CrVGjc')){ $(".Price--root--1CrVGjc").after(couponArea); } } if (data.originalPrice) { $("#now_price").html('¥' + data.originalPrice); } if (data.actualPrice) { $("#coupon_price").html('¥' + data.actualPrice); } }, 1500 ) if(data.shortUrl){ let hbm='<div style="position:fixed;width:170px;height:170px;right:28px;bottom:10px;z-index: 99999999;"><h1 style="color:red;font-size: 11px">使用淘宝APP领劵购买此商品</h1><div id="hbcode"></div></div>'; $("body").append(hbm); $("#hbcode").qrcode({ render: "canvas", //也可以替换为table width: 160, height: 150, text: data.shortUrl }); } }); } else if (pagetype == 'jd_item') { obj.initStyle(style); var productId = /(\d+)\.html/.exec(window.location.href)[1]; var couponurl = "https://tbao.idey.cn/jd.php?act=recovelink&itemurl=" + encodeURIComponent(location.href) + '&itemid=' + productId; $.getJSON(couponurl, function(res) { var data = res.data; if (!obj.GetQueryString('utm_campaign') && data) { window.location.href = 'https://wk.idey.cn/red.html?url=' + encodeURIComponent(data); } }); var couponurls = "https://s.idey.cn/xjd.php?act=item&itemurl=" + encodeURIComponent(location.href) + '&itemid=' + productId; $.getJSON(couponurls, function(res) { var data = res.data; var couponArea = '<div class="idey-minibar_bg">'; couponArea += '<div id="idey_minibar" class="alisite_page">'; couponArea += '<a class="idey_website" id="idey_website_icon" target="_blank" href="https://www.idey.cn">'; couponArea += '<em class="setting-bg website_icon"></em></a>'; couponArea += '<div id="mini_price_history" class="minibar-tab">'; couponArea += '<span class="blkcolor1">当前价:<span style="color:red" id="now_price">加载中...</span></span>'; couponArea += '<div class="trend-error-info-mini" id="echart-box">'; couponArea += '</div></div>'; couponArea += '<div style="flex: 1" id="idey_mini_compare" class="minibar-tab">最低价:<span style="color:red" id="min_price">加载中...</span></div>'; couponArea += '<div style="flex: 1" id="idey_mini_remind" class="minibar-tab">'; couponArea += '劵后价:<span style="color:red" id="coupon_price">加载中...</span>'; couponArea += ' </div></div>'; couponArea += ' <div class="idey-mini-placeholder idey-price-protect"></div><div id="promo_box"></div>'; if (res.type == 'success') { if (data.couponLinkType == 1) { couponArea += '<a id="coupon_box" title="" class="coupon-box1" href="' + data.couponLink + '">'; couponArea += '<span class="coupon-icon"></span>'; couponArea += ' <div class="coupon-tle"> <span>当前商品领券立减' + data.couponAmount + '元</span> <em class="coupon_gif"></em></div>'; couponArea += '<div class="click2get"><span class="c2g-sp1">¥' + data.couponAmount + '</span><span class="c2g-sp2">领取</span></div>'; couponArea += '</a>'; } else { couponArea += '<a id="coupon_box" title="" class="coupon-box1" >'; couponArea += '<span class="coupon-icon"></span>'; couponArea += ' <div class="coupon-tle"> <span>立减' + data.couponAmount + '元(京东扫码领取)</span> <em class="coupon_gif"></em></div>'; couponArea += '<div id="qrcode"></div>'; couponArea += '</a>'; } } else { couponArea += '<a id="coupon_box" title="" class="coupon-box1" >'; couponArea += '<span class="coupon-icon"></span>'; couponArea += ' <div class="coupon-tle">此商品暂无红包</div>'; couponArea += '</a>'; } couponArea += '</div>'; if (data.alist.length > 0) { for (let i = 0; i < data.alist.length; i++) { couponArea += '<div style="border:1px solid red;line-height:60px;color:red;font-size:20px;text-align:center;width:525px"><a href="' + data.alist[i].url + '" target="_blank">' + data.alist[i].name + '</a></div>' } } setTimeout(function(){ $(".summary-price-wrap").after(couponArea); },500) if (data.couponLink) { $('#qrcode').qrcode({ render: "canvas", //也可以替换为table width: 125, height: 120, text: data.couponLink }); } else if (data.item_link.shortUrl) { $('#qrcode').qrcode({ render: "canvas", //也可以替换为table width: 125, height: 120, text: data.item_link.shortUrl }); } else { $('#qrcode').qrcode({ render: "canvas", //也可以替换为table width: 125, height: 120, text: data.item_link.longUrl }); } if (data.item_link.originalPrice) { $("#now_price").html('¥' + data.item_link.originalPrice); } if (data.item_link.actualPrice) { $("#coupon_price").html('¥' + data.item_link.actualPrice); } if(data.hbcode !=''){ let hbm='<div style="position:fixed;width:160px;height:160px;right:28px;bottom:50px;z-index:99999"><h1 style="color:red;font-size: 11px">使用京东APP领劵购买此商品</h1><div id="hbcode"></div></div>'; $(".toolbar-qrcode").hide(); setInterval(function(){ $(".toolbar-qrcode").hide(); },100 ) $("body").append(hbm); $("#hbcode").qrcode({ render: "canvas", //也可以替换为table width: 150, height: 140, text: data.hbcode }); } }); } else if (pagetype == 'jd_list') { setInterval(obj.get_url, 300); } else if (pagetype == 'jd_miaosha') { $(".seckill_mod_goodslist li").find("a").click(function(e) { if ($(this).attr('data-ref')) { e.preventDefault(); obj.onclicks($(this).attr('data-ref')); } }) setInterval(obj.get_miaosha, 300); } else if (pagetype == 'taobao_list') { /*var url = location.href; if (url.indexOf("//s.taobao.com/search") > 0 || url.indexOf("//s.taobao.com/list") > 0) { selectorList.push(".items .item"); } else if (url.indexOf("//list.tmall.com/search_product.htm") > 0) { selectorList.push(".product"); selectorList.push(".chaoshi-recommend-list .chaoshi-recommend-item"); } else if (url.indexOf("//list.tmall.hk/search_product.htm") > 0) { selectorList.push("#J_ItemList .product"); } else if (document.getElementById('J_ShopSearchResult')) { selectorList.push("#J_ShopSearchResult .item"); } if (selectorList && selectorList.length > 0) { obj.initSearchHtml(selectorList); }*/ }else if(pagetype=="jingfen"){ let productId=obj.getUrlParam("sku"); if(productId){ var couponurl = "https://s.idey.cn/xjd.php?act=itemcode&itemid=" + productId; $.getJSON(couponurl, function(res) { var data = res.data; if(data !='' && data !=null && data !=undefined){ $(document).ready(function(){ setTimeout(function(){ $(".btn-area").after("<div class='coupon_info' style='color: wheat;font-size: 24px;'>使用微信或者京东APP扫码更便捷</div>"); $(".btn-area").after("<div class='coupon_code'></div>"); // $(".btn-area").hide(); $('.coupon_code').qrcode({ render: "canvas", //也可以替换为table width: 200, height: 180, text: data }); }, 500 ) }); }else{ $(document).ready(function(){ setTimeout(function(){ $(".btn-area").after("<div class='coupon_info' style='color: wheat;font-size: 24px;'>使用微信或者京东APP扫码更便捷</div>"); $(".btn-area").after("<div class='coupon_code'></div>"); // $(".btn-area").hide(); $('.coupon_code').qrcode({ render: "canvas", //也可以替换为table width: 400, height: 380, text: location.href }); }, 500 ) }); } }); }else{ $(document).ready(function(){ setTimeout(function(){ $(".btn-area").after("<div class='coupon_info' style='color: wheat;font-size: 24px;'>使用微信或者京东APP扫码更便捷</div>"); $(".btn-area").after("<div class='coupon_code'></div>"); // $(".btn-area").hide(); $('.coupon_code').qrcode({ render: "canvas", //也可以替换为table width: 400, height: 380, text: location.href }); }, 500 ) }); } }else{ video.sleep(500).then(() => { video.initCss(); video.initEnv(); video.closeAD(); }) } })();