// ==UserScript== // @name VIP影视解析播放(弹幕追剧) // @namespace http://yuleshequ.66rt.com/ // @version 1.1 // @description 【无需跳转播放】支持爱奇艺、优酷、腾讯视频、芒果TV等全网VIP视频解析播放。无需跳转播放视频。支持抖音、快手等视频下载,音乐下载,知乎增强等 // @icon http://www.ico8.net/temp/20230205101949145.ico // @match *://*.youku.com/* // @match *://*.iqiyi.com/* // @match *://*.iq.com/* // @match *://*.le.com/* // @match *://v.qq.com/* // @match *://m.v.qq.com/* // @match *://*.tudou.com/* // @match *://*.mgtv.com/* // @match *://tv.sohu.com/* // @match *://*.1905.com/* // @match *://film.sohu.com/* // @match *://*.bilibili.com/* // @match *://*.pptv.com/* // @match *://item.taobao.com/* // @match *://s.taobao.com/* // @match *://chaoshi.detail.tmall.com/* // @match *://detail.tmall.com/* // @match *://detail.tmall.hk/* // @match *://item.jd.com/* // @match *://*.yiyaojd.com/* // @match *://*.liangxinyao.com/* // @match *://music.163.com/* // @match *://y.qq.com/* // @match *://*.kugou.com/* // @match *://*.kuwo.cn/* // @match *://*.ximalaya.com/* // @match *://*.zhihu.com/* // @match *://*.douyin.com/* // @match *://*.kuaishou.com/* // @match *://*.ixigua.com/* // @match *://*.youtube.com/* // @match *://*.yuleshequ.66rt.com/* // @match *://*.vvv.66rt.com/* // @match *://*.shequ.cn3v.work/* // @exclude *://*.yuleshequ.66rt.com/* // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/crypto-js/4.1.1/crypto-js.min.js // @grant GM_registerMenuCommand // @grant GM_unregisterMenuCommand // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_download // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @connect yuleshequ.66rt.com // @downloadURL none // ==/UserScript== /* 【使用方法】 优酷、爱奇艺、腾讯、芒果等全网VIP视频解析播放 打开播放页面后点击屏幕左面的播放标志选择播放即可*/ /* 【更新日志】 版本号V1.1 影视脚本首个大更新来啦~ 1.支持播放页播放啦,无需跳转播放视频! 2.支持手动添加播放线路 3.支持调整图标位置 4.新增音乐下载 5.新增抖音、快手视频下载 6.新增知乎增强 版本号V1.0.3 修复脚本已知问题,新年快乐! 版本号V1.0.2 更新解析网址 版本号V1.0.1 修复脚本已知问题 版本号V1.0 StarV影视脚本正式版发布*/ (function() { 'use strict'; var domHead = document.getElementsByTagName('head')[0]; var domStyle = document.createElement('style'); domStyle.type = 'text/css'; domStyle.rel = 'stylesheet'; //平台判断 var isMobile = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent); if(isMobile){ let playLine = [ {"name":"纯净1","url":"https://im1907.top/?jx="}, {"name":"B站1","url":"https://jx.jsonplayer.com/player/?url="}, {"name":"爱豆","url":"https://jx.aidouer.net/?url="}, {"name":"CHok","url":"https://www.gai4.com/?url="}, {"name":"OK","url":"https://okjx.cc/?url="}, {"name":"RDHK","url":"https://jx.rdhk.net/?v="}, {"name":"人人迷","url":"https://jx.blbo.cc:4433/?url="}, {"name":"思古3","url":"https://jsap.attakids.com/?url="}, {"name":"听乐","url":"https://jx.dj6u.com/?url="}, ]; let useWeb = ['m.bilibili.com','youku.com','www.youku.com','m.youku.com','m.v.qq.com','m.iqiyi.com','m.mgtv.com','m.tv.sohu.com','m.1905.com','m.pptv.com','m.le.com']; if(useWeb.indexOf(location.host) == -1){ console.log('不是应用网站');return; } function setCookie(cname,cvalue,exdays){ var d = new Date(); d.setTime(d.getTime()+(exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname+"="+cvalue+"; "+expires; } function getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i${item.name}`; }) playWrapHtml +=""; //template:node;播放区域 let playJxHtml = "
"; playJxHtml += "
"; //循环判断是否在播放页,是则执行下面 let jxVideoData = [ {funcName:"playVideo", node:".player__container" ,match:/https:\/\/v.qq.com\/x\/cover\/[a-zA-Z0-9]+.html/,areaClassName:'mod_episode',name:'qqPC'}, {funcName:"playVideo", node:"#player-container" ,match:/https:\/\/v.qq.com\/x\/cover\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+.html/,areaClassName:'mod_episode',name:'qqPC'}, {funcName:"playVideo", node:".container-player" ,match:/v\.qq\.com\/x\/page/,areaClassName:'mod_episode'}, {funcName:"playVideo", node:"#player",match:/m\.v\.qq\.com\/x\/play\.html\?cid=/}, {funcName:"playVideo", node:"#player",match:/m\.v\.qq\.com\/play\.html\?cid\=/}, {funcName:"playVideo", node:"#player",match:/m\.v\.qq\.com\/cover\/.*html/}, {funcName:"playVideo", node:"#player",match:/https?:\/\/m\.v\.qq\.com\/x\/m\/play\?.*cid.*/}, {funcName:"playVideo", node:"#flashbox",match:/^https:\/\/www\.iqiyi\.com\/[vwa]\_/,areaClassName:'qy-episode-num',name:'iqiyiPc'}, {funcName:"playVideo", node:".m-video-player-wrap",match:/^https:\/\/m.iqiyi\.com\/[vwa]\_/,areaClassName:'m-sliding-list'}, {funcName:"playVideo", node:".intl-video-wrap",match:/^https:\/\/www\.iq\.com\/play\//,areaClassName:'m-sliding-list'}, {funcName:"playVideo", node:"#player",match:/m\.youku\.com\/alipay_video\/id_/}, {funcName:"playVideo", node:"#player",match:/m\.youku\.com\/video\/id_/}, {funcName:"playVideo", node:"#player",match:/v\.youku\.com\/v_show\/id_/}, {funcName:"playVideo", node:"#bilibili-player",nodeType:'id',match:/www\.bilibili\.com\/video/,name:'biliPc',areaClassName:'video-episode-card'}, {funcName:"playVideo", node:"#player_module",nodeType:'id',match:/www\.bilibili\.com\/bangumi/,areaClassName:'ep-list-wrapper report-wrap-module'}, {funcName:"playVideo", node:".player-container",nodeType:'class',match:/m\.bilibili\.com\/bangumi/,areaClassName:'ep-list-pre-container no-wrap'}, {funcName:"playVideo", node:".mplayer",nodeType:'class',match:/m\.bilibili\.com\/video\//}, {funcName:"playVideo", node:".video-area",nodeType:'class',match:/m\.mgtv\.com\/b/}, {funcName:"playVideo", node:"#mgtv-player-wrap",nodeType:'id',match:/mgtv\.com\/b/,areaClassName:'episode-items clearfix'}, {funcName:"playVideo", node:".x-player",nodeType:'class',match:/tv\.sohu\.com\/v/}, {funcName:"playVideo", node:".x-cover-playbtn-wrap",nodeType:'class',match:/m\.tv\.sohu\.com/}, {funcName:"playVideo", node:"#playerWrap",nodeType:'id',match:/film\.sohu\.com\/album\//}, {funcName:"playVideo", node:"#le_playbox",nodeType:'id',match:/le\.com\/ptv\/vplay\//,areaClassName:'juji_grid'}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/play\.tudou\.com\/v_show\/id_/}, {funcName:"playVideo", node:"#pptv_playpage_box",nodeType:'id',match:/v\.pptv\.com\/show\//}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/vip\.1905.com\/play\//}, {funcName:"playVideo", node:"#vodPlayer",nodeType:'id',match:/www\.1905.com\/vod\/play\//}, ]; //创建logo_icon createElement('div','zhmIcon'); let zhmPlay = document.getElementById('zhmIcon'); zhmPlay.innerHTML = playWrapHtml; let jxVideoWeb = jxVideoData.filter(function(item){ return location.href.match(item.match); }) document.querySelector('#zhmlogo').addEventListener('click',function(){ let jxVideoWeb = jxVideoData.filter(function(item){ return location.href.match(item.match); }) if(jxVideoWeb.length == 0){ toast('请在视频播放页点击图标'); }else{ var {funcName,match:nowMatch,node:nowNode,name:nowName} = jxVideoWeb[0]; let playLineDiv = document.querySelector('.zhm_play_video_wrap'); let playShow = playLineDiv.style.display; playShow == 'none'? playLineDiv.style.display = 'block':playLineDiv.style.display = 'none'; var playLineTd = document.querySelectorAll('.playLineTd'); playLineTd.forEach(function(item){ item.addEventListener('click',function(){ playLineTd.forEach(function(e){ e.setAttribute('class','playLineTd zhm_play_video_line_ul_li'); }) this.setAttribute('class','playLineTd zhm_play_video_line_ul_li zhm_line_selected'); setCookie('playLineAction',this.getAttribute('url'),30); let nowWebNode = document.querySelector(nowNode); if(nowWebNode){ nowWebNode.innerHTML = playJxHtml; let playIframe = document.querySelector('#playIframe'); playIframe.src= item.getAttribute('url')+location.href; }else{ console.log('视频网站结点不存在'); } }) }) return false; } }) document.addEventListener('click',function(e){ let i=0; e.path.forEach(function(item){ if(item.className=='iconLogo'){ i=1; console.log(i); } }) if(i==0){ let isShow = document.querySelector('.zhm_play_video_wrap').style.display; if(isShow == 'block'){ document.querySelector('.zhm_play_video_wrap').style.display='none'; } } }) } playVideoFunc(); }else{ /*--config--*/ var Config ={ couponUrl:window.location.href, couponHost:window.location.host, zhmApiUrl:'http://yuleshequ.66rt.com/', webUrl:'http://music.eggvod.cn/', iconVipTop:360, iconVipPosition : 'left', iconVipWidth : 256, jxCodeInfo : {'in':81516699,'code':4}, couponTimerNum : 100,//100次等于10秒 couponWaitTime : 100, iconWaitTime : 100, selectedLeft:'selected', selectedRight:'', videoPlayLineAdd:GM_getValue('videoPlayLineAdd',0), dyVideoDownload:GM_getValue('dyVideoDownload',22), ksVideoDownload:GM_getValue('ksVideoDownload',22), xiguaVideoDownload:GM_getValue('xiguaVideoDownload',22), biliVideoDownload:GM_getValue('biliVideoDownload',22), youtubeVideoDownload:GM_getValue('youtubeVideoDownload',22), } var {couponUrl, couponHost, zhmApiUrl, webUrl, iconVipTop, iconVipPosition, iconVipWidth, jxCodeInfo, couponTimerNum, couponWaitTime, iconWaitTime, selectedLeft, selectedRight, videoPlayLineAdd, dyVideoDownload, ksVideoDownload, xiguaVideoDownload, biliVideoDownload, youtubeVideoDownload } = Config; /*--lang--*/ var lang = { set:'设置', iconPosition:'图标位置', playVideo:'视频解析', playMusic:'音乐下载', zhNice:'知乎增强', videoDownload:'视频下载', iconHeight:'图标高度', iconWidth:'图标大小', iconLine:'水平位置', iconWaitTime:'等待时间', iconLeft:'靠左', iconRight:'靠右', tipIconHeight:'默认360,建议1~500', tipIconWidth:'默认40,建议20~50', tipErrorIconHeight:'<图标位置>中的<图标高度>应为1000以内正整数,建议1~500', tipErrorIconWidth:'<图标位置>中的<图标大小>应为100以内正整数,建议20~50', setPlayVideo:'解析设置', playVideoLineAdd:'添加线路', tipPlayVideoLineAdd:'请输入线路名称和解析地址,例:"线路六https://jx.zdy.com/?url=",每线路一行。', zhSet:'知乎设置', zhVideoClose:'屏蔽视频', zhVideoDownload:'视频下载', zhADClose:'屏蔽广告', zhCloseLeft:'关闭侧边栏', zhChangeLink:'链接直接跳转', specialColumn:'标记文章', videoTitle:'标记视频', zhKeywordClose:'屏蔽关键词', tipKeyword:'请输入关键词,用","号隔开', authorNameClose:'屏蔽用户', tipAuthorName:'请输入用户名,用","号隔开', yanxuanClose:'屏蔽盐选', dyVideoDownload:'抖音下载', ksVideoDownload:'快手下载', xiguaVideoDownload:'西瓜下载', biliVideoDownload:'B站 (bilibili) 下载', youtubeVideoDownload:'youtube下载', question:'反馈', qqGroup:'服务网站', reward:'脚本更新', }; /*--datas--*/ var datas = { getCoupon:[{isOpen:22,web:[ {funcName:"coupon",name:"taobao",node:".J_LinkAdd",match:/item\.taobao\.com/}, {funcName:"coupon",name:"tmallCaoshi",node:"#J_LinkBuy",match:/^https?:\/\/chaoshi.detail.tmall.com\//}, {funcName:"coupon",name:"tmall",node:".BasicContent--actions--1co8sx8",match:/^https?:\/\/detail\.tmall\.com/}, {funcName:"coupon",name:"tmall",node:"#J_LinkBuy",match:/^https?:\/\/detail\.tmall\.com/}, {funcName:"coupon",name:"tmallOther",node:".tm-msg-box",match:/^https?:\/\/detail\.tmall\.com/}, {funcName:"coupon",name:"tmall",node:"#J_LinkBuy",match:/^https?:\/\/detail\.tmall\.hk/}, {funcName:"coupon",name:"jd",node:"#choose-btns",match:/item\.jd\.com/}, {funcName:"coupon",name:"jd",node:"#choose-btns",match:/\.yiyaojd\.com/}, ]}], jxVideo:[{isOpen:GM_getValue('movieList','22'),web:[ {funcName:"playVideo",match:/https?:\/\/v\.qq\.com/,name:'qqPC'}, {funcName:"playVideo", match:/https?:\/\/m\.v\.qq\.com/,name:'qqMobile'}, {funcName:"playVideo", match:/^https?:\/\/www\.iqiyi\.com/,name:'iqiyiPc'}, {funcName:"playVideo", match:/^https?:\/\/www\.iq\.com/}, {funcName:"playVideo", node:".m-video-player-wrap",match:/^https?:\/\/m.iqiyi\.com/,areaClassName:'m-sliding-list'}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.youku\.com\/alipay_video\/id_/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.youku\.com\/video\/id_/}, {funcName:"playVideo", match:/^https?:\/\/.*youku\.com/}, {funcName:"playVideo", match:/^https?:\/\/www\.bilibili\.com/}, {funcName:"playVideo", match:/^https?:\/\/m\.bilibili\.com/}, {funcName:"playVideo", node:".video-area",nodeType:'class',match:/m\.mgtv\.com\/b/}, {funcName:"playVideo", match:/mgtv\.com/,areaClassName:'episode-items clearfix'}, {funcName:"playVideo", node:".x-cover-playbtn-wrap",nodeType:'class',match:/.tv\.sohu\.com/}, {funcName:"playVideo", node:".x-cover-playbtn-wrap",nodeType:'class',match:/m\.tv\.sohu\.com/}, {funcName:"playVideo", node:"#playerWrap",nodeType:'id',match:/film\.sohu\.com/}, {funcName:"playVideo", match:/tudou\.com/}, {funcName:"playVideo",match:/le\.com/}, {funcName:"playVideo",match:/pptv\.com/}, {funcName:"playVideo",match:/1905\.com/}, ]}], /* bakjxVideo:[{isOpen:GM_getValue('movieList','22'),web:[ //{funcName:"playVideo", node:"#mod_player" ,nodeType:'id' ,match:/v\.qq\.com\/x\/cover/,areaClassName:'mod_episode'}, {funcName:"playVideo", node:"#mod_player" ,nodeType:'id' ,match:/https:\/\/v.qq.com\/x\/cover\/[a-zA-Z0-9]+.html/,areaClassName:'mod_episode',name:'qqPC'}, {funcName:"playVideo", node:"#mod_player" ,nodeType:'id' ,match:/https:\/\/v.qq.com\/x\/cover\/[a-zA-Z0-9]+\/[a-zA-Z0-9]+.html/,areaClassName:'mod_episode',name:'qqPC'}, {funcName:"playVideo", node:".container-player" ,nodeType:'class', match:/v\.qq\.com\/x\/page/,areaClassName:'mod_episode'}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.v\.qq\.com\/x\/m\/play\?cid/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.v\.qq\.com\/x\/play\.html\?cid=/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.v\.qq\.com\/play\.html\?cid\=/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.v\.qq\.com\/cover\/.*html/}, {funcName:"playVideo", node:"#flashbox",nodeType:'id',match:/^https:\/\/www\.iqiyi\.com\/[vwa]\_/,areaClassName:'qy-episode-num',name:'iqiyiPc'}, {funcName:"playVideo", node:".m-video-player-wrap",nodeType:'class',match:/^https:\/\/m.iqiyi\.com\/[vwa]\_/,areaClassName:'m-sliding-list'}, {funcName:"playVideo", node:".intl-video-wrap",nodeType:'class',match:/^https:\/\/www\.iq\.com\/play\//,areaClassName:'m-sliding-list'}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.youku\.com\/alipay_video\/id_/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/m\.youku\.com\/video\/id_/}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/v\.youku\.com\/v_show\/id_/}, {funcName:"playVideo", node:"#bilibiliPlayer",nodeType:'id',match:/www\.bilibili\.com\/video/}, {funcName:"playVideo", node:"#player_module",nodeType:'id',match:/www\.bilibili\.com\/bangumi/,areaClassName:'ep-list-wrapper report-wrap-module'}, {funcName:"playVideo", node:".player-container",nodeType:'class',match:/m\.bilibili\.com\/bangumi/,areaClassName:'ep-list-pre-container no-wrap'}, {funcName:"playVideo", node:".mplayer",nodeType:'class',match:/m\.bilibili\.com\/video\//}, {funcName:"playVideo", node:".video-area",nodeType:'class',match:/m\.mgtv\.com\/b/}, {funcName:"playVideo", node:"#mgtv-player-wrap",nodeType:'id',match:/mgtv\.com\/b/,areaClassName:'episode-items clearfix'}, {funcName:"playVideo", node:".x-cover-playbtn-wrap",nodeType:'class',match:/m\.tv\.sohu\.com/}, {funcName:"playVideo", node:"#playerWrap",nodeType:'id',match:/film\.sohu\.com\/album\//}, {funcName:"playVideo", node:"#le_playbox",nodeType:'id',match:/le\.com\/ptv\/vplay\//,areaClassName:'juji_grid'}, //无单独播放页{funcName:"playVideo", node:"j-player",nodeType:'id',match:/m\.le\.com\/vplay_\//}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/play\.tudou\.com\/v_show\/id_/}, {funcName:"playVideo", node:"#pptv_playpage_box",nodeType:'id',match:/v\.pptv\.com\/show\//}, //{funcName:"playVideo", node:"pptv_playpage_box",nodeType:'id',match:/vip\.pptv\.com\/show\//}, //图标未显示{funcName:"playVideo", node:"pplive-player",nodeType:'id',match:/m\.pptv\.com\/show\//}, {funcName:"playVideo", node:"#player",nodeType:'id',match:/vip\.1905.com\/play\//}, ]}], */ jxMusic:[{isOpen:GM_getValue('musicList','22'),web:[ {funcName:"playMusic",name:'netease',match:/^https?:\/\/music\.163\.com/,tip:'请在音乐单曲页点击图标下载'}, {funcName:"playMusic",name:'qq',match:/^https?:\/\/y\.qq\.com/,tip:'请点击播放需要下载的歌曲,在播放页点击图标下载'}, {funcName:"playMusic",name:'kugou',match:/kugou\.com/,tip:'请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"'}, {funcName:"playMusic",name:'kuwo',match:/kuwo\.cn/,tip:'请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"'}, {funcName:"playMusic",name:'ximalaya',match:/^https?:\/\/www\.ximalaya\.com/,tip:'请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"'} ]}], playLine:[ {"name":"综合推荐线路","url":"https://video.isyour.love/player/getplayer?url=","mobile":1}, {"name":"弹幕追剧","url":"https://jx.jsonplayer.com/player/?url=","mobile":1}, {"name":"爱豆","url":"https://jx.aidouer.net/?url=","mobile":1}, {"name":"纯净1","url":"https://im1907.top/?jx=","mobile":1}, {"name":"BL","url":"https://vip.bljiex.com/?v=","mobile":0}, {"name":"冰豆","url":"https://api.qianqi.net/vip/?url=","mobile":0}, {"name":"百域","url":"https://jx.618g.com/?url=","mobile":0}, {"name":"CK","url":"https://www.ckplayer.vip/jiexi/?url=","mobile":0}, {"name":"CHok","url":"https://www.gai4.com/?url=","mobile":1}, {"name":"ckmov","url":"https://www.ckmov.vip/api.php?url=","mobile":0}, {"name":"H8","url":"https://www.h8jx.com/jiexi.php?url=","mobile":0}, {"name":"JY","url":"https://jx.playerjy.com/?url=","mobile":0}, {"name":"解析","url":"https://ckmov.ccyjjd.com/ckmov/?url=","mobile":0}, {"name":"解析la","url":"https://api.jiexi.la/?url=","mobile":0}, {"name":"老板","url":"https://vip.laobandq.com/jiexi.php?url=","mobile":0}, {"name":"MAO","url":"https://www.mtosz.com/m3u8.php?url=","mobile":0}, {"name":"M3U8","url":"https://jx.m3u8.tv/jiexi/?url=","mobile":0}, {"name":"诺讯","url":"https://www.nxflv.com/?url=","mobile":0}, {"name":"OK","url":"https://okjx.cc/?url=","mobile":1}, {"name":"PM","url":"https://www.playm3u8.cn/jiexi.php?url=","mobile":0}, {"name":"盘古","url":"https://www.pangujiexi.cc/jiexi.php?url=","mobile":0}, {"name":"七哥","url":"https://jx.nnxv.cn/tv.php?url=","mobile":0}, {"name":"RDHK","url":"https://jx.rdhk.net/?v=","mobile":1}, {"name":"人人迷","url":"https://jx.blbo.cc:4433/?url=","mobile":1}, {"name":"思云","url":"https://jx.ap2p.cn/?url=","mobile":0}, {"name":"思古3","url":"https://jsap.attakids.com/?url=","mobile":1}, {"name":"听乐","url":"https://jx.dj6u.com/?url=","mobile":1}, {"name":"维多","url":"https://jx.ivito.cn/?url=","mobile":0}, {"name":"虾米","url":"https://jx.xmflv.com/?url=","mobile":0}, {"name":"云端","url":"https://sb.5gseo.net/?url=","mobile":0}, {"name":"云析","url":"https://jx.yparse.com/index.php?url=","mobile":0}, {"name":"0523","url":"https://go.yh0523.cn/y.cy?url=","mobile":0}, {"name":"17云","url":"https://www.1717yun.com/jx/ty.php?url=","mobile":0}, {"name":"180","url":"https://jx.000180.top/jx/?url=","mobile":0}, {"name":"4K","url":"https://jx.4kdv.com/?url=","mobile":1}, {"name":"8090","url":"https://www.8090g.cn/?url=","mobile":0} ], zhNice:[{isOpen:GM_getValue('zhihuList','22'),web:[ {funcName:'zhNice',match:/^https?:\/\/[a-z]+\.zhihu\.com/} ]}], taobao:[{isOpen:GM_getValue('taobao','22'),web:[ {funcName:'taobaoSearch',match:/^https?:\/\/s\.taobao\.com\/search\?.+/} ]}], /* douYin:[{isOpen:GM_getValue('douyinList','22'),web:[ {funcName:'douyinDownload',match:/^https?:\/\/www\.douyin\.com\/?[^.+]$/}, {funcName:'douyinDownload',match:/^https?:\/\/www\.douyin\.com\/\?enter\=guide$/}, ]}], */ videoDownload:[{isOpen:GM_getValue('videoDownloadList','22'),web:[ /* {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/?[^.+]$/}, {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/\?enter\=guide$/}, {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/follow$/}, {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/vs$/}, {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/discover\?modal_id=.+$/} */ {funcName:'videoDownload',name:'dyVideoDownload',match:/^https?:\/\/www\.douyin\.com\/?.+$/,isWebOpen:dyVideoDownload}, {funcName:'videoDownload',name:'ksVideoDownload',match:/^https?:\/\/www\.kuaishou\.com\/?.+$/,isWebOpen:ksVideoDownload}, //{funcName:'videoDownload',name:'xiguaVideoDownload',match:/^https?:\/\/www\.ixigua\.com\/[0-9]+\?.+$/,isWebOpen:xiguaVideoDownload}, {funcName:'videoDownload',name:'xiguaVideoDownload',match:/^https?:\/\/www\.ixigua\.com\//,isWebOpen:xiguaVideoDownload}, {funcName:'videoDownload',name:'biliVideoDownload',match:/^https?:\/\/www\.bilibili\.com\//,isWebOpen:biliVideoDownload}, {funcName:'videoDownload',name:'youtubeVideoDownload',match:/^https?:\/\/www\.youtube\.com/,isWebOpen:youtubeVideoDownload}, ]}], keyCode:[ {code:48,isShift:false,value:'0'}, {code:48,isShift:true,value:')'}, {code:49,isShift:false,value:'1'}, {code:49,isShift:true,value:'!'}, {code:50,isShift:false,value:'2'}, {code:50,isShift:true,value:'@'}, {code:51,isShift:false,value:'3'}, {code:51,isShift:true,value:'#'}, {code:52,isShift:false,value:'4'}, {code:52,isShift:true,value:'$'}, {code:53,isShift:false,value:'5'}, {code:53,isShift:true,value:'%'}, {code:54,isShift:false,value:'6'}, {code:54,isShift:true,value:'^'}, {code:55,isShift:false,value:'7'}, {code:55,isShift:true,value:'&'}, {code:56,isShift:false,value:'8'}, {code:56,isShift:true,value:'*'}, {code:57,isShift:false,value:'9'}, {code:57,isShift:true,value:'('}, {code:70,isShift:false,value:'f'}, {code:70,isShift:true,value:'F'}, {code:74,isShift:false,value:'j'}, {code:74,isShift:true,value:'J'}, {code:75,isShift:false,value:'k'}, {code:75,isShift:true,value:'K'}, {code:76,isShift:false,value:'l'}, {code:76,isShift:true,value:'L'}, ], downloadOption:[{name:'直接下载',id:'toDownload'},{name:'复制链接',id:'toCopy'},{name:'打开文件',id:'toLink'}] } var {getCoupon,jxVideo,jxMusic,playLine,zhNice,taobao,videoDownload,keyCode,downloadOption} = datas; /*--Class--*/ class BaseClass{ constructor(){ if(GM_getValue('iconPositionSetPage') != 0){ /*cookie存储 iconVipTop = this.getCookie('iconTop')?this.getCookie('iconTop'):iconVipTop; iconVipPosition = this.getCookie('iconPosition')?this.getCookie('iconPosition'):iconVipPosition; selectedLeft = iconVipPosition=='left'?'selected':''; selectedRight = iconVipPosition=='right'?'selected':''; iconVipWidth = this.getCookie('iconWidth')?this.getCookie('iconWidth'):iconVipWidth; */ iconVipTop = GM_getValue('iconTop') || GM_getValue('iconTop') == 0?GM_getValue('iconTop'):iconVipTop; iconVipPosition = GM_getValue('iconPosition')?GM_getValue('iconPosition'):iconVipPosition; selectedLeft = iconVipPosition=='left'?'selected':''; selectedRight = iconVipPosition=='right'?'selected':''; iconVipWidth = GM_getValue('iconWidth')?GM_getValue('iconWidth'):iconVipWidth; iconWaitTime = GM_getValue('iconWaitTime')?GM_getValue('iconWaitTime')*1000:iconWaitTime; } GM_registerMenuCommand("设置", () => this.menuSet()); } menuSet(){ var _this = this; let menuSetStyle = ` .zhmMask{ z-index:999999999; background-color:#000; position: fixed;top: 0;right: 0;bottom: 0;left: 0; opacity:0.8; } .wrap-box{ z-index:1000000000; position:fixed;;top: 50%;left: 50%;transform: translate(-50%, -200px); width: 300px; color: #555; background-color: #fff; border-radius: 5px; overflow:hidden; font:16px numFont,PingFangSC-Regular,Tahoma,Microsoft Yahei,sans-serif !important; font-weight:400 !important; } .setWrapHead{ background-color:#f24443;height:40px;color:#fff;text-align:center;line-height:40px; } .setWrapLi{ margin:0px;padding:0px; } .setWrapLi li{ background-color: #fff; border-bottom:1px solid #eee; margin:0px !important; padding:12px 20px; display: flex; justify-content: space-between;align-items: center; list-style: none; } .setWrapLiContent{ display: flex;justify-content: space-between;align-items: center; } .setWrapSave{ position:absolute;top:-2px;right:10px;font-size:24px;cursor:pointer } .iconSetFoot{ position:absolute;bottom:0px;padding:10px 20px;width:100%; z-index:1000000009;background:#fef9ef; } .iconSetFootLi{ margin:0px;padding:0px; } .iconSetFootLi li{ display: inline-flex; padding:0px 2px; justify-content: space-between;align-items: center; font-size: 12px; } .iconSetFootLi li a{ color:#555; } .iconSetFootLi a:hover { color:#fe6d73; } .iconSetPage{ z-index:1000000001; position:absolute;top:0px;left:300px; background:#fff; width:300px; height:100%; } .iconSetUlHead{ padding:0px; margin:0px; } .iconSetPageHead{ border-bottom:1px solid #ccc; height:40px; line-height:40px; display: flex; justify-content: space-between; align-items: center; background-color:#fe6d73; color:#fff; font-size: 15px; } .iconSetPageLi{ margin:0px;padding:0px; } .iconSetPageLi li{ list-style: none; padding:8px 20px; } .zhihuSetPage{ z-index:1000000002;position:absolute;top:0px;left:300px;background:#fff;width:300px;height:100%; } .iconSetPageInput{ display: flex !important;justify-content: space-between;align-items: center; } .zhihuSetPageLi{ margin:0px;padding:0px; height:258px; overflow-y: scroll; } .zhihuSetPageLi::-webkit-scrollbar { /*滚动条整体样式*/ width : 2px; /*高宽分别对应横竖滚动条的尺寸*/ height: 1px; } .zhihuSetPageLi::-webkit-scrollbar-thumb { /*滚动条里面小方块*/ border-radius : 2px; background-color: #fe6d73; } .zhihuSetPageLi::-webkit-scrollbar-track { /*滚动条里面轨道*/ box-shadow : inset 0 0 5px rgba(0, 0, 0, 0.2); background : #ededed; border-radius: 10px; } .zhihuSetPageLi li{ border-bottom:1px solid #eee;padding:12px 20px;display:block; } .zhihuSetPageContent{ display: flex !important;justify-content: space-between;align-items: center; } .circular{ width: 40px;height: 20px;border-radius: 16px;transition: .3s;cursor: pointer;box-shadow: 0 0 3px #999 inset; } .round-button{ width: 20px;height: 20px;;border-radius: 50%;box-shadow: 0 1px 5px rgba(0,0,0,.5);transition: .3s;position: relative; } .back{ border: solid #FFF; border-width: 0 3px 3px 0; display: inline-block; padding: 3px;transform: rotate(135deg); -webkit-transform: rotate(135deg);margin-left:10px;cursor:pointer; } .to-right{ margin-left:20px; display: inline-block; padding: 3px;transform: rotate(-45deg); -webkit-transform: rotate(-45deg);cursor:pointer; } .iconSetSave{ font-size:24px;cursor:pointer;margin-right:5px;margin-bottom:4px;color:#FFF; } .zhm_set_page{ z-index:1000000003; position:absolute; top:0px;left:300px; background:#fff; width:300px; height:100%; } .zhm_set_page_header{ border-bottom:1px solid #ccc; height:40px; line-height:40px; display: flex; justify-content: space-between; align-items: center; background-color:#fe6d73; color:#fff; font-size: 15px; } .zhm_set_page_content{ display: flex !important;justify-content: space-between;align-items: center; } .zhm_set_page_list{ margin:0px;padding:0px; } .zhm_set_page_list li{ /*border-bottom:1px solid #ccc;*/ padding:12px 20px; display:block; border-bottom:1px solid #eee; } li:last-child{ border-bottom:none; } /*-form-*/ :root { --base-color: #434a56; --white-color-primary: #f7f8f8; --white-color-secondary: #fefefe; --gray-color-primary: #c2c2c2; --gray-color-secondary: #c2c2c2; --gray-color-tertiary: #676f79; --active-color: #227c9d; --valid-color: #c2c2c2; --invalid-color: #f72f47; --invalid-icon: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%20%3Cpath%20d%3D%22M13.41%2012l4.3-4.29a1%201%200%201%200-1.42-1.42L12%2010.59l-4.29-4.3a1%201%200%200%200-1.42%201.42l4.3%204.29-4.3%204.29a1%201%200%200%200%200%201.42%201%201%200%200%200%201.42%200l4.29-4.3%204.29%204.3a1%201%200%200%200%201.42%200%201%201%200%200%200%200-1.42z%22%20fill%3D%22%23f72f47%22%20%2F%3E%3C%2Fsvg%3E"); } .text-input { font-size: 16px; position: relative; right:0px; z-index: 0; } .text-input__body { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: transparent; border: 1px solid var(--gray-color-primary); border-radius: 3px; height: 1.7em; line-height: 1.7; overflow: hidden; padding: 2px 1em; text-overflow: ellipsis; transition: background-color 0.3s; width:55%; font-size:14px; } .text-input__body:-ms-input-placeholder { color: var(--gray-color-secondary); } .text-input__body::-moz-placeholder { color: var(--gray-color-secondary); } .text-input__body::placeholder { color: var(--gray-color-secondary); } *, ::after, ::before { box-sizing: initial !important; } .text-input__body[data-is-valid] { padding-right: 1em; } .text-input__body[data-is-valid=true] { border-color: var(--valid-color); } .text-input__body[data-is-valid=false] { border-color: var(--invalid-color); box-shadow: inset 0 0 0 1px var(--invalid-color); } .text-input__body:focus { border-color: var(--active-color); box-shadow: inset 0 0 0 1px var(--active-color); outline: none; } .text-input__body:-webkit-autofill { transition-delay: 9999s; -webkit-transition-property: background-color; transition-property: background-color; } .text-input__validator { background-position: right 0.5em center; background-repeat: no-repeat; background-size: 1.5em; display: inline-block; height: 100%; left: 0; position: absolute; top: 0; width: 100%; z-index: -1; } .text-input__body[data-is-valid=false] + .text-input__validator { background-image: var(--invalid-icon); } .select-box { box-sizing: inherit; font-size: 16px; position: relative; transition: background-color 0.5s ease-out; width:90px; } .select-box::after { border-color: var(--gray-color-secondary) transparent transparent transparent; border-style: solid; border-width: 6px 4px 0; bottom: 0; content: ""; display: inline-block; height: 0; margin: auto 0; pointer-events: none; position: absolute; right: -72px; top: 0; width: 0; z-index: 1; } .select-box__body { box-sizing: inherit; -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: transparent; border: 1px solid var(--gray-color-primary); border-radius: 3px; cursor: pointer; height: 1.7em; line-height: 1.7; padding-left: 1em; padding-right: calc(1em + 16px); width: 140%; font-size:14px; padding-top:2px; padding-bottom:2px; } .select-box__body[data-is-valid=true] { border-color: var(--valid-color); box-shadow: inset 0 0 0 1px var(--valid-color); } .select-box__body[data-is-valid=false] { border-color: var(--invalid-color); box-shadow: inset 0 0 0 1px var(--invalid-color); } .select-box__body.focus-visible { border-color: var(--active-color); box-shadow: inset 0 0 0 1px var(--active-color); outline: none; } .select-box__body:-webkit-autofill { transition-delay: 9999s; -webkit-transition-property: background-color; transition-property: background-color; } .textarea__body { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-color: transparent; border: 1px solid var(--gray-color-primary); border-radius: 0; box-sizing: border-box; font: inherit; left: 0; letter-spacing: inherit; overflow: hidden; padding: 1em; position: absolute; resize: none; top: 0; transition: background-color 0.5s ease-out; width: 100%; } .textarea__body:only-child { position: relative; resize: vertical; } .textarea__body:focus { border-color: var(--active-color); box-shadow: inset 0 0 0 1px var(--active-color); outline: none; } .textarea__body[data-is-valid=true] { border-color: var(--valid-color); box-shadow: inset 0 0 0 1px var(--valid-color); } .textarea__body[data-is-valid=false] { border-color: var(--invalid-color); box-shadow: inset 0 0 0 1px var(--invalid-color); } .textarea ._dummy-box { border: 1px solid; box-sizing: border-box; min-height: 240px; overflow: hidden; overflow-wrap: break-word; padding: 1em; visibility: hidden; white-space: pre-wrap; word-wrap: break-word; } .toLeftMove{ nimation:moveToLeft 0.5s infinite; -webkit-animation:moveToLeft 0.5s infinite; /*Safari and Chrome*/ animation-iteration-count:1; animation-fill-mode: forwards; } @keyframes moveToLeft{ from {left:200px;} to {left:0px;} } @-webkit-keyframes moveToLeft /*Safari and Chrome*/{ from {left:200px;} to {left:0px;} } .toRightMove{ nimation:moveToRight 2s infinite; -webkit-animation:moveToRight 2s infinite; /*Safari and Chrome*/ animation-iteration-count:1; animation-fill-mode: forwards; } @keyframes moveToRight{ from {left:0px;} to {left:2000px;} } @-webkit-keyframes moveToRight /*Safari and Chrome*/{ from {left:0px;} to {left:200px;} } `; domStyle .appendChild(document.createTextNode(menuSetStyle)); domHead.appendChild(domStyle); var setListJson= [ {'listName':lang.iconPosition,'setListID':'iconPositionSetPage','setPageID':'movieIconSetPage','takePlace':'0px'}, {'listName':lang.playVideo,'setListID':'movieList','setPageID':'movieVideoSetPage','takePlace':'0px'}, {'listName':lang.playMusic,'setListID':'musicList','setPageID':'','takePlace':''}, {'listName':lang.zhNice,'setListID':'zhihuList','setPageID':'zhihuIconSetPage','takePlace':'220px'}, {'listName':lang.videoDownload,'setListID':'videoDownloadList','setPageID':'videoDownloadSetPage','takePlace':'0px'}, ]; var zhihuOptionJson = [ {'optionName':lang.zhVideoClose,'optionID':'removeVideo','default':'0'}, {'optionName':lang.zhVideoDownload,'optionID':'downloadVideo','default':'22'}, {'optionName':lang.zhADClose,'optionID':'removeAD','default':'22'}, {'optionName':lang.zhCloseLeft,'optionID':'removeRight','default':'0'}, {'optionName':lang.zhChangeLink,'optionID':'changeLink','default':'22'}, {'optionName':lang.specialColumn,'optionID':'specialColumn','default':22}, {'optionName':lang.videoTitle,'optionID':'videoTitle','default':22}, {'optionName':lang.zhKeywordClose,'optionID':'removeKeyword','default':'0'}, {'optionName':lang.authorNameClose,'optionID':'removeAuthorName','default':'0'}, {'optionName':lang.yanxuanClose,'optionID':'removeYanxuan','default':'0'} ]; var playVideoOptionJson = [{'optionName':'添加线路','optionID':'videoPlayLineAdd','default':videoPlayLineAdd}]; var videoDownloadOptionJson = [ {'optionName':lang.dyVideoDownload,'optionID':'dyVideoDownload','default':dyVideoDownload}, {'optionName':lang.ksVideoDownload,'optionID':'ksVideoDownload','default':ksVideoDownload}, {'optionName':lang.xiguaVideoDownload,'optionID':'xiguaVideoDownload','default':xiguaVideoDownload}, {'optionName':lang.biliVideoDownload,'optionID':'biliVideoDownload','default':biliVideoDownload}, {'optionName':lang.youtubeVideoDownload,'optionID':'youtubeVideoDownload','default':youtubeVideoDownload}, ]; var setHtml = "
"; setHtml +="
"; setHtml +="
"; setHtml +="
  • "+lang.iconPosition+"×
"; setHtml +="
    "; setHtml +="
  • "+lang.iconHeight+":
  • "; setHtml += "
  • "+lang.iconLine+":
  • " setHtml +="
  • "+lang.iconWidth+":
  • "; setHtml += "
  • "+lang.iconWaitTime+":
  • " setHtml +="
"; setHtml +="
"; setHtml +="
  • "+lang.videoDownload+"×
"; setHtml +="
    "; for(let i=0;i"; setHtml +="
    "; setHtml +="
    "; setHtml += "
"; setHtml += ""; } setHtml +="" setHtml +="
" setHtml +="
"; setHtml +=""; setHtml +="
"; setHtml +="
"; setHtml +="
"; setHtml +=""; setHtml +="
"; } setHtml +="" setHtml +="" setHtml +="
"; setHtml +=""; setHtml +="
"; if(zhihuOptionJson[optionN].optionID == 'removeKeyword'){ var keywordShow; if(GM_getValue('removeKeyword','0') == '22'){ keywordShow = 'block'; }else{ keywordShow = 'none'; } setHtml +="
"; } if(zhihuOptionJson[optionN].optionID == 'removeAuthorName'){ var authorNameShow; if(GM_getValue('removeAuthorName','0') == '22'){ authorNameShow = 'block'; }else{ authorNameShow = 'none'; } setHtml +="
"; } setHtml +=""; } setHtml +="" setHtml +=""; setHtml +=""; setHtml +=""; setHtml +="
"; setHtml +="
"; setHtml +="'; setHtml +='
'; setHtml += ""; if(document.querySelector('#setMask')) return; this.createElement('div','zhmMenu'); let zhmMenu = document.getElementById('zhmMenu'); zhmMenu.innerHTML = setHtml; let timerZhmIcon = setInterval(function(){ if (document.querySelector('#zhmMenu')){ clearInterval(timerZhmIcon); // 取消定时器 let circular = document.querySelectorAll('.circular'); circular.forEach(function(item){ item.addEventListener('click', function(_e){ let buttonStyle = item.children[0].style; let left = buttonStyle.left; left = parseInt(left); let listLeftValue; if(left==0){ buttonStyle.left = '22px'; buttonStyle.background = '#fe6d73'; item.style.background='#ffE5E5'; if(item.nextSibling && item.nextSibling.getAttribute('data')){ item.nextSibling.setAttribute('style','border: solid #ccc;border-width: 0 3px 3px 0;') } listLeftValue = 22; }else{ buttonStyle.left = '0px'; buttonStyle.background = '#fff'; item.style.background='#fff'; if(item.nextSibling){ item.nextSibling.setAttribute('style','border: solid #EEE;border-width: 0 3px 3px 0;') } listLeftValue = 0; } let setListID = item.id; if(setListID == 'removeKeyword' && listLeftValue==22){ document.querySelector('#zhihuKeyword').style.display='block'; //document.querySelector('#zhmTakePlace').style= 'height:220px'; } if(setListID == 'removeKeyword' && listLeftValue==0){ document.querySelector('#zhihuKeyword').style.display='none'; //document.querySelector('#zhmTakePlace').style= 'height:180px'; } if(setListID == 'removeAuthorName' && listLeftValue==22){ document.querySelector('#zhihuAuthorName').style.display='block'; //document.querySelector('#zhmTakePlace').style= 'height:260px'; } if(setListID == 'removeAuthorName' && listLeftValue==0){ document.querySelector('#zhihuAuthorName').style.display='none'; //document.querySelector('#zhmTakePlace').style= 'height:120px'; } if(setListID == 'videoPlayLineAdd' && listLeftValue==22){ document.querySelector('#videoPlayLineAddTextarea').style.display='block'; } if(setListID == 'videoPlayLineAdd' && listLeftValue==0){ document.querySelector('#videoPlayLineAddTextarea').style.display='none'; } GM_setValue(setListID,listLeftValue); }) }); let toRight = document.querySelectorAll('.to-right'); toRight.forEach(function(item){ item.addEventListener('click', function(e){ let left = item.previousSibling.children[0].style.left; left = parseInt(left); if(left != 22) return; let setPageID = item.getAttribute('data'); let pageId = document.getElementById(setPageID); pageId.className='iconSetPage toLeftMove'; //知乎设置暂位高度 if(setPageID=='zhihuIconSetPage'){ document.querySelector('#zhmTakePlace').style= `height:68px`; } //实时图标高度 if(setPageID == 'movieIconSetPage'){ document.querySelector('#iconTop').value=document.querySelector("#zhmlogo").offsetTop; } }) }) let toBack = document.querySelectorAll('.back'); toBack.forEach(function(item){ item.addEventListener('click', function(e){ let parentDom = item.parentNode.parentNode.parentNode; parentDom.className='iconSetPage toRightMove'; document.querySelector('#zhmTakePlace').style='height:40px;' }) }) let setSave = document.querySelectorAll('.iconSetSave'); setSave.forEach(function(item){ item.addEventListener('click',()=>{ let iconTop = document.getElementById('iconTop').value; let iconPosition = document.getElementById('iconPosition').value; let iconWidth = document.getElementById('iconWidth').value; let iconWaitTime = document.getElementById('iconWaitTime').value; let playVideoLineText = document.querySelector('#playVideoLineTextarea').value; let playVideoLineLeft = document.querySelector('#videoPlayLineAdd').children[0].style.left; let inputZhKeyword = document.getElementById('inputZhKeyword').value; let inputAuthorName = document.getElementById('inputZhAuthorName').value; if(iconTop != ''){ if(!(/(^[0-9][0-9]{0,2}$)/.test(iconTop))){ alert(lang.tipErrorIconHeight); return false; } //_this.setCookie('iconTop',iconTop,30); GM_setValue('iconTop',iconTop); } if(iconPosition != ''){ //_this.setCookie('iconPosition',iconPosition,30); GM_setValue('iconPosition',iconPosition); } if(iconWaitTime != ''){ GM_setValue('iconWaitTime',iconWaitTime); } if(iconWidth !=''){ if(!(/(^([1-9][0-9]?)$)/.test(iconWidth))){ alert(lang.tipErrorIconWidth); return false; } //_this.setCookie('iconWidth',iconWidth,30); GM_setValue('iconWidth',iconWidth); } if(GM_getValue('videoPlayLineAdd') == 22){ if(playVideoLineText){ let lineObj = _this.getLine(playVideoLineText); if(lineObj.length>0){ GM_setValue('playVideoLineText',playVideoLineText); }else{ alert('线路输入不正确'); return; } }else{ GM_setValue('playVideoLineText',''); } }else{ GM_setValue('playVideoLineText',playVideoLineText); } if(inputZhKeyword != ''){ GM_setValue('inputZhKeyword',inputZhKeyword); }else{ if(GM_getValue('inputZhKeyword')){ GM_deleteValue('inputZhKeyword'); } } if(inputAuthorName != ''){ GM_setValue('inputZhAuthorName',inputAuthorName); }else{ if(GM_getValue('inputZhAuthorName')){ GM_deleteValue('inputZhAuthorName'); } } history.go(0); }) }) document.getElementById('iconTop').addEventListener('change',function(){ let iconTop = this.value; if(!(/(^[1-9]\d*$)/.test(iconTop))){ this.setAttribute('data-is-valid','false') }else{ this.setAttribute('data-is-valid','true') } return false; }) document.getElementById('iconWidth').addEventListener('change',function(){ let iconWidth = this.value; if(!(/(^[1-9]\d*$)/.test(iconWidth))){ this.setAttribute('data-is-valid','false') }else{ this.setAttribute('data-is-valid','true') } return false; }) //腾讯视频快捷键冲突 if(couponUrl.match(/v\.qq\.com\/x\/cover/)){ let addLineText =document.querySelector('#playVideoLineTextarea'); addLineText.addEventListener('keydown',function(e){ let startPos = addLineText.selectionStart; let endPos = addLineText.selectionEnd; if (startPos === undefined || endPos === undefined) return; keyCode.forEach(function(item){ if(e.keyCode == item.code && e.shiftKey==item.isShift){ let textValue = addLineText.value; let startValue = textValue.substring(0,startPos); let endValue = textValue.substring(startPos); let allValue = startValue+item.value+endValue; addLineText.value=allValue; addLineText.selectionStart = startPos+1; addLineText.selectionEnd = endPos+1; } }) }) } } }) } createElement(dom,domId){ var rootElement = document.body; var newElement = document.createElement(dom); newElement.id = domId; var newElementHtmlContent = document.createTextNode(''); rootElement.appendChild(newElement); newElement.appendChild(newElementHtmlContent); } request(method,url,data,isCookie=''){ let request = new XMLHttpRequest(); return new Promise((resolve,reject)=>{ request.onreadystatechange=function(){ if(request.readyState==4){ if(request.status==200){ resolve(request.responseText); }else{ reject(request.status); } } } request.open(method,url); //request.withCredentials = true; if(isCookie){ request.withCredentials = true; } request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); request.send(data); }) } setCookie(cname,cvalue,exdays){ var d = new Date(); d.setTime(d.getTime()+(exdays*24*60*60*1000)); var expires = "expires="+d.toGMTString(); document.cookie = cname+"="+cvalue+"; "+expires; } getCookie(cname){ var name = cname + "="; var ca = document.cookie.split(';'); for(var i=0; i{obj[$1]=$2}); return obj; } getLine(text){ let textArr = text.split('\n'); if(textArr.length > 0){ let lineObj = []; let match = /^(.+)(https?:\/\/.+)$/; textArr.forEach(function(item){ item = item.replace(/\s*,*/g,''); if(!item) return true; let lineMatch = item.match(match); if(lineMatch){ lineObj.push({'name':lineMatch[1].substring(0,4),'url':lineMatch[2]}); }else{ lineObj=[]; return false; } }) return lineObj; } } static getElement(css){ return new Promise((resolve,reject)=>{ let num = 0; let timer = setInterval(function(){ num++ let dom = document.querySelector(css); if(dom){ clearInterval(timer); resolve(dom); }else{ if(num==20){clearInterval(timer);resolve(false);} } },300) }) } static toast(msg,duration){ duration=isNaN(duration)?3000:duration; let toastDom = document.createElement('div'); toastDom.innerHTML = msg; //toastDom.style.cssText="width: 60%;min-width: 150px;opacity: 0.7;height: 30px;color: rgb(255, 255, 255);line-height: 30px;text-align: center;border-radius: 5px;position: fixed;top: 40%;left: 20%;z-index: 999999;background: rgb(0, 0, 0);font-size: 12px;"; toastDom.style.cssText='padding:2px 15px;min-height: 36px;line-height: 36px;text-align: center;transform: translate(-50%);border-radius: 4px;color: rgb(255, 255, 255);position: fixed;top: 50%;left: 50%;z-index: 9999999;background: rgb(0, 0, 0);font-size: 16px;' document.body.appendChild(toastDom); setTimeout(function() { var d = 0.5; toastDom.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in'; toastDom.style.opacity = '0'; setTimeout(function() { document.body.removeChild(toastDom) }, d * 1000); }, duration); } //create zhmLogoIcon zhmLogo(){ var _this = this; let sortDiv = iconVipPosition=='left'?'row':'row-reverse'; let playVideoStyle = ` .zhm_play_vidoe_icon{ padding-top:2px; cursor:pointer; z-index:9999999; position:fixed;${iconVipPosition}:5px;top:${iconVipTop}px; text-align:center; overflow:visible; display:flex; flex-direction:${sortDiv}; width:auto; } .zhm_play_video_wrap{ z-index:9999999; overflow: hidden; width:300px; } .zhm_play_video_line{ width:320px; height:316px; overflow-y:scroll; overflow-x:hidden; } .zhm_play_vide_line_ul{ width:300px; display: flex; justify-content: flex-start; flex-flow: row wrap; list-style: none; padding:0px; margin:0px; } .zhm_play_video_line_ul_li{ padding:4px 0px; margin:2px; width:30%; color:#FFF; text-align:center; background-color:#f24443; box-shadow:0px 0px 10px #fff; font-size:14px; } .zhm_play_video_line_ul_li:hover{ color:#260033; background-color:#fcc0c0 } .zhm_line_selected{ color:#260033; background-color:#fcc0c0 } .zhm_play_video_jx{ width:100%; height:100%; z-index:999999; position: absolute;top:0px;padding:0px; } `; domStyle .appendChild(document.createTextNode(playVideoStyle)); domHead.appendChild(domStyle); let playWrapHtml = "