// ==UserScript== // @name 懒人专用,全网VIP视频免费破解去广告、全网音乐直接下载、知乎增强、短视频无水印下载、百度网盘直接下载等多功能工具箱,功能可独立开关。长期更新,放心使用。v5.4 // @namespace lanhaha // @version 5.4.13 // @description 自用多功能脚本工具箱,完全免费、无广告、无需关注公众号,集合了优酷、爱奇艺、腾讯、B站(bilibili)、芒果等全网VIP视频(PC+移动端)免费破解去广告,网易云音乐、QQ音乐、酷狗、酷我、虾米、蜻蜓FM、荔枝FM、喜马拉雅等网站音乐和有声书音频免客户端下载,知乎增强(知乎视频下载、去广告、关键词屏蔽、去除侧边栏等),视频无水印下载(bilibili、抖音、快手、西瓜),百度网盘直接下载,优惠券自动查询等几个自己常用的功能,且功能可独立开关。 // @author lanhaha,syhyz1990,zhmai // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAQ8ElEQVR4Xu1dCXQURRr+apIQT1wQw6EYBcSErCgKCoQowoocLirKeoAoLD5x2YDu+hTCPnddJeC5Ct6gIBtdlUMQxAPE95gMKkbhoWGCKMgpsPjUoEsIkNr3TadhMumeqe6ungRI8SBAV9fxf/Wf9VeXgIcipczy8PpR/aoQoszNBIWTl6SUvQAMAHAJgFbYsSsdH5e0wiclwMpVwK7dTpo7eupmNAO6dQa6dDJ+tsjYCGALgGIA7woh+FOpKAMi9+27GY0aDcSW7d3xyustECpJw2b22VBqUSCzNZB3yT6MuGkrmmcsR2XlIpGePk+FUkqAyG82/Bmnt7wWz868AC+92lSl4YY6ANIbAbfcsAt3DivBtu/ni3ZtpiWiS1xA5A8/dMe89wag7Vl98eDj52LnrhMTNdjw3IICzU8rx/33rMWGDYsxsO9icdppn9vRyRYQuXv3IKSkDMCkqT2x8IPTIZDeQGwPFJCyAgOv/A735S/FfrFQNP/NB1atWQIif947BPsrBmPUX7uj9OumEEjxMJSGV00KSHkAOe134sUnPkJqylzRuPH8WOLUAkTu23cjDsohGJGfizXhJg3U9IECHTvsxKynP0RaWpE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yjfMxJX3tAJlfudX3sUq0OSlVt7NODWKO0XLJm9DAJPiWbNlh06fyAXLZ2IL1bfhNfeykSg4erupGDNK7yHDi5Dp/NeEf17P8Y+DwNSXp6HA3JU5ILiX/fWjwuKk0KVOuzklMY78U7RAhw48LzIyIjclFnjhI784stb8N2WkSiY2AUB0XCnup9Y8Wa2SX9bjszM6aJTh/lmV7WOTMlnXhqHrduHYsF77QGR5ueYjtm2q+ReDLpqFVq3mCnuHD4tmg61Afn1104QabdhxOhBWBM+45glml8Tl7ICHbPX4tQmReLZR/8V243loUL5U0UfyMqhuP2uPlj7dXO/xnbMtUswcrLKIMRrYvb0R63mb3vKU5aXX4PUtMG4f3JPLFraXOuVesccEhFnby/6X1GGn8rfEC898bAdCeIeu5UVFQOQnt4fyz/uiX88ciZ2/PdEV1daHIsARM85o9kePHDvl1i/cY4YOaSWmIqrQ2JpJ6XsjA0beqNly1w8NzMb04syAHGiceehg2PUxyIovA5v1LAfcMewEmzbtUC0y3wxERmUKSr37++FJcEeyMnqiFmvZ2LFyibYuOVkCBwPiUYIIADJ31JUZ0BGt238nX9GMu+jjbzq/zBr13pu1q3xING86vZ5Zmsgt0sFbr1xM1q3CqKycrFIT5+nMihlQA6RZevWrpg+uwMymmRiUL+WCH6agc9WNcbKL47Dzt1pgEwFBMFJQQACVeBllQJEib8gq38TnMiXCg6DFemEzw8BVhtUlVk5r+OYDjW6aNEc6NoJ6HIh0PUioGXzCgCbUF4eROPGi4UQJapD8jYQ1V4a6ilT4P+GC5Ol+xIKnwAAAABJRU5ErkJggg== // @match *://pan.baidu.com/disk/home* // @match *://yun.baidu.com/disk/home* // @match *://pan.baidu.com/disk/main* // @match *://yun.baidu.com/disk/main* // @match *://pan.baidu.com/s* // @match *://yun.baidu.com/s* // @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 *://film.sohu.com/* // @match *://*.bilibili.com/* // @match *://*.pptv.com/* // @match *://item.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/* // @exclude *://*.zhmdy.top/* // @exclude *://*.eggvod.cn/* // @connect d.pcs.baidu.com // @connect baidu.com // @connect baidupcs.com // @connect youxiaohou.com // @connect localhost // @require https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/crypto-js/4.1.1/crypto-js.min.js // @require https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/limonte-sweetalert2/11.4.4/sweetalert2.all.min.js // @original-script https://greasyfork.org/scripts/376078 // @original-author zhmai // @original-license GPL License // @original-script https://github.com/syhyz1990/baiduyun/blob/master/baiduyun.user.js // @original-author youxiaohou // @original-license AGPL License // @original-changes 将强制关注公众号改为非强制。 // @antifeature referral-link 此提示为GreasyFork代码规范要求含有查券功能的脚本必须添加,实际使用无任何强制跳转,代码可查,请知悉。 // @license AGPL License // @grant GM_download // @grant GM_openInTab // @grant GM_setValue // @grant GM_getValue // @grant GM_deleteValue // @grant GM_xmlhttpRequest // @grant GM_addStyle // @grant unsafeWindow // @grant GM_setClipboard // @grant GM_getResourceURL // @grant GM_getResourceText // @grant GM_info // @grant GM_registerMenuCommand // @grant GM_cookie // ==/UserScript== (function() { 'use strict'; /*--config--*/ var Config ={ couponUrl:window.location.href, couponHost:window.location.host, zhmApiUrl:'https://www.eggvod.cn/', isMobile:/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent), iconVipTop:360, iconVipPosition : 'left', iconVipWidth : 40, 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), } var {couponUrl, couponHost, zhmApiUrl, isMobile, iconVipTop, iconVipPosition, iconVipWidth, jxCodeInfo, couponTimerNum, couponWaitTime, iconWaitTime, selectedLeft, selectedRight, videoPlayLineAdd, dyVideoDownload, ksVideoDownload, xiguaVideoDownload, biliVideoDownload } = 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:'链接直接跳转', zhKeywordClose:'屏蔽关键词', tipKeyword:'请输入关键词', dyVideoDownload:'抖音下载', ksVideoDownload:'快手下载', xiguaVideoDownload:'西瓜下载', biliVideoDownload:'B站 (bilibili) 下载', question:'常见问题', qqGroup:'交流群', reward:'打赏', redReward:'红包', thank:'感谢', }; /*--datas--*/ var datas = { getCoupon:[{isOpen:22,web:[ {funcName:"coupon",name:"taobao",node:".J_LinkAdd",match:/item\.taobao\.com/}, {funcName:"coupon",name:"tmall",node:"#J_LinkBasket",match:/detail\.tmall\.com/}, {funcName:"coupon",name:"tmall",node:"#J_LinkBasket",match:/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/}, ]}], 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":"纯净1","url":"https://z1.m1907.cn/?jx=","mobile":1}, {"name":"B站1","url":"https://jx.bozrc.com:4433/player/?url=","mobile":1}, {"name":"爱豆","url":"https://jx.aidouer.net/?url=","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="}, {"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":"乐多","url":"https://api.leduotv.com/wp-api/ifr.php?isDp=1&vid=","mobile":1}, {"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.blbo.cc:4433/?url=","mobile":0}, {"name":"七哥","url":"https://jx.mmkv.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/} ]}], videoDownload:[{isOpen:GM_getValue('videoDownloadList','22'),web:[ {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\//,isWebOpen:xiguaVideoDownload}, {funcName:'videoDownload',name:'biliVideoDownload',match:/^https?:\/\/www\.bilibili\.com\//,isWebOpen:biliVideoDownload} ]}], baidu:[{isOpen:GM_getValue('baiduList','22'),web:[ {funcName:'baidu',match:/https?:\/\/pan\.baidu\.com/} ]}], 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,videoDownload,keyCode,downloadOption,baidu} = datas; /*--create style--*/ var domHead = document.getElementsByTagName('head')[0]; var domStyle = document.createElement('style'); domStyle.type = 'text/css'; domStyle.rel = 'stylesheet'; /*--Class--*/ class BaseClass{ constructor(){ if(GM_getValue('iconPositionSetPage') != 0){ 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; 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; } .zhihuSetPageLi li{ border-bottom:1px solid #eee;padding:12px 20px;display:block; } .zhihuSetPageContent{ display: flex !important;justify-content: space-between;align-items: center; } li:last-child{ border-bottom:none; } .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; } /*-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'}, {'listName':lang.playVideo,'setListID':'movieList','setPageID':'movieVideoSetPage'}, {'listName':lang.playMusic,'setListID':'musicList','setPageID':''}, {'listName':lang.zhNice,'setListID':'zhihuList','setPageID':'zhihuIconSetPage'}, {'listName':lang.videoDownload,'setListID':'videoDownloadList','setPageID':'videoDownloadSetPage'}, ]; 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.zhKeywordClose,'optionID':'removeKeyword','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}, ]; var setHtml = "
"; setHtml +="
"; setHtml +="
"; setHtml +=""; setHtml +="
"; 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 +="
"; } 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'; } if(setListID == 'removeKeyword' && listLeftValue==0){ document.querySelector('#zhihuKeyword').style.display='none'; } 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'; }) }) let toBack = document.querySelectorAll('.back'); toBack.forEach(function(item){ item.addEventListener('click', function(e){ let parentDom = item.parentNode.parentNode.parentNode; parentDom.className='iconSetPage toRightMove' }) }) 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; if(iconTop != ''){ if(!(/(^[1-9][0-9]{0,2}$)/.test(iconTop))){ alert(lang.tipErrorIconHeight); return false; } _this.setCookie('iconTop',iconTop,30) } if(iconPosition != ''){ _this.setCookie('iconPosition',iconPosition,30) } 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); } 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'); } } 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){ 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.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); } } class CouponClass extends BaseClass{ constructor(){ super(); this.divElement = document.createElement("div"); this.divElement.id='zhm_div_s'; } taobao(){ let node = document.querySelector('#J_juValid'); node.style='overflow:inherit;' let className = 'zhm_tab_taobao'; this.getCouponInfo(node,className); } tmall(){ let node = document.querySelector('#J_LinkBuy').parentNode; let className = 'zhm_tab_tmall'; this.getCouponInfo(node,className); } jd(){ setTimeout(()=>{ let jdGoodsId = couponUrl.match(/jd\.com\/(\S*).html/); let node= document.querySelector('#choose-btns'); node.before(this.divElement); this.request('get',`https://zuihuimai.net/vrhr/index_jd_new.php?goods_id=${jdGoodsId[1]}`).then((result)=>{ let resp= JSON.parse(result); let html=''; resp.forEach(function(item){ html += `
¥
${item.discount}
满${item.quota}元可用
有效期
${item.endTime}
` }); document.getElementById('zhm_div_s').innerHTML = html; }) },couponWaitTime) } getCouponInfo(node,className){ setTimeout(()=>{ let goods_id = this.getQueryString('id'); if(!goods_id){console.log('goods_id');return}; if(className == 'zhm_tab_taobao'){ node.querySelector('div:nth-of-type(1)').before(this.divElement); }else{ node.before(this.divElement); } this.request('get',`https://www.zuihuimai.net/vrhr/index_new.php?goods_id=${goods_id}`).then((result)=>{ if(result){ let resp= JSON.parse(result); let html = `
¥
${resp.youhuiquan}
${resp.coupon_info}
有效期
${resp.coupon_end_time}
`; document.getElementById('zhm_div_s').innerHTML=html; } }) },couponWaitTime); } } class PlayVideoClass extends BaseClass{ constructor(){ super(); } } class PlayMusicClass extends BaseClass{ constructor(){ super(); } xmlyCreateCheckbox(){ let soundListli = document.querySelectorAll('.sound-list ul li'); soundListli.forEach(function(item){ let checkboxed = item.querySelector('input'); if(checkboxed){ return; } let title = item.querySelector('.text'); if(!title){ return; }; title.style = "width:360px"; let src = title.querySelector('a').getAttribute('href'); let firstDom = item.querySelector('.icon-wrapper'); let inputDom = firstDom.cloneNode(true); inputDom.style= 'min-width: 0px;'; inputDom.innerHTML = ""; firstDom.before(inputDom); }) } } class ZhClass extends BaseClass{ constructor(){ super(); } removeVideo(){ let card = document.querySelectorAll('.Feed'); card.forEach(function(item){ let dataZop = JSON.parse(item.getAttribute('data-za-extra-module')); let video = dataZop.card.content.video_id; if(video){ item.parentNode.style='display:none;'; } }) } removeAD(){ let zhHideAD = `.Pc-card{display:none !important;}.TopstoryItem--advertCard{display:none !important}`; domStyle .appendChild(document.createTextNode(zhHideAD)); domHead.appendChild(domStyle); } downloadVideo(){ window.addEventListener('click',(e)=>{ if(e.target.innerText == '下载'){ var videoId; if(document.querySelector('.ZVideo-player')){ let zVideo = document.querySelector('.ZVideo'); let videoData = JSON.parse(zVideo.getAttribute('data-za-extra-module')); videoId = videoData.card.content.video_id; }else{ let videoUrl = window.location.href; let videoObj = videoUrl.split('?'); videoId = videoObj[0].split('/').pop(); } let url = 'https://lens.zhihu.com/api/v4/videos/'+videoId; this.request('get',url).then((result)=>{ let data = JSON.parse(result); if(data.playlist != undefined){ let play_url = data.playlist.LD.play_url; let videoName = videoId+".mp4"; GM_download(play_url,videoName); }else{ BaseClass.toast('下载失败!'); } }); } }) document.addEventListener('DOMNodeInserted',(e) => { if(!e.relatedNode.querySelector) return; var playBar = e.relatedNode.querySelector(':scope > div:last-child > div:first-child > div:nth-of-type(2)'); if(!playBar || playBar.querySelector('.zhmDownload')) return; var playBut = playBar.querySelector(':scope > div:last-child'); if(!playBut) return; var playButLi = playBut.querySelector('div:first-child'); if(!playButLi) return; var downloadBut = playButLi.cloneNode(true); downloadBut.className = playButLi.className + ' zhmDownload'; if(!downloadBut.querySelector('._1tg8oir')) return; downloadBut.querySelector('._1tg8oir').innerText='下载'; playButLi.before(downloadBut); }) } removeRight(){ let zhFullScreen = `.GlobalSideBar {display: none !important;} .Question-sideColumn{display:none !important} .Topstory-mainColumn{width:100% !important} .Question-mainColumn{width:1000px !important} .css-cazg48{margin: 0px 16px 0px 0px !important;} .QuestionWaiting-mainColumn{width:100% !important;} .css-1j5d3ll{padding-left:10px;} .css-yhjwoe{justify-content: space-between !important;} `; domStyle .appendChild(document.createTextNode(zhFullScreen)); domHead.appendChild(domStyle); } changeLink(){ if(couponUrl.indexOf('target') != -1){ let obj = this.getUrlParams(couponUrl); if(obj.target == undefined) return; let link = decodeURIComponent(obj.target); location.href=link; } } removeKeyword(){ var GMKeyword = GM_getValue('inputZhKeyword','0'); if(GMKeyword == '0' || GMKeyword == '') return; let keyword = GMKeyword.split(','); let content = document.querySelectorAll('.ContentItem'); keyword.forEach(function(item){ content.forEach(function(value){ let dataZop = JSON.parse(value.getAttribute('data-zop')); if(dataZop.title.indexOf(item) != -1){ let itemCard = value.parentNode.parentNode.parentNode; let itemCardClass= itemCard.className; if(itemCardClass.indexOf('TopstoryItem-isRecommend') != -1){ itemCard.style='display:none'; } } }) }) } } class VideoDownloadClass extends BaseClass{ constructor(){ super(); } dyVideoDownload(){ var _this = this; window.addEventListener('load',function(){ async function getControls(){ let videoDom = await BaseClass.getElement('.xg-video-container'); if(!videoDom){ console.log('没有找到DOM');return; } let vsNav = document.querySelector('.fuy_wmct:nth-of-type(5)'); if((vsNav && vsNav.className.indexOf('LXX79le5') != -1) || couponUrl.indexOf('vsdetail') != -1){ console.log('综艺栏目关闭下载');return; } _this.createDyVideoDownload(); let videoPlayDomAll = document.querySelectorAll('video'); let videoIndex = videoPlayDomAll.length>1?videoPlayDomAll.length-2:videoPlayDomAll.length-1; let videoPlayDom = videoPlayDomAll[videoIndex]; //let videoPlayDom = videoPlayDomAll.length>1?videoPlayDomAll[videoPlayDomAll.length-2]:videoPlayDomAll[videoPlayDomAll.length-1]; videoPlayDom.addEventListener('ended',function(){ //结束 console.log("播放结束"); let autoPlay = document.querySelector('.xg-switch-checked'); if(autoPlay){ getControls(); return; } }, false); document.querySelector('#toDownload').addEventListener('click',function(){ BaseClass.toast('正在下载请稍侯'); let dataUrl = document.querySelector('#zhmDouyinDownload').getAttribute('data-url'); let match = /[https]?:?\/\/www\.douyin\.com\/.+\/([0-9]+)/; let video = dataUrl.match(match); let videoId = video[1]; let url = 'https://www.iesdouyin.com/web/api/v2/aweme/iteminfo/?item_ids='+video[1]; let uri = _this.request('get',url).then((result)=>{ let resp = JSON.parse(result); //let playUrl = resp.item_list[0].video.play_addr.url_list[0];//下载有水印 if(resp.item_list.length > 0){ let uriId = resp.item_list[0].video.play_addr.uri; let playUrl = `https://aweme.snssdk.com/aweme/v1/play/?video_id=${uriId}&line=0&ratio=540p&media_type=4&vr_type=0&improve_bitrate=0&is_play_url=1&is_support_h265=0&source=PackSourceEnum_PUBLISH`; let info = document.querySelectorAll('.Nu66P_ba'); let account = info[videoIndex*2].innerText; let titleArr = info[videoIndex*2+1].innerText.split('#'); let title = titleArr[0]?titleArr[0]:titleArr[1]; //console.log(account,title); GM_download(playUrl,title+account+".mp4"); }else{ console.log('API没有获取视频ID'); } }).catch((error)=>{ console.log(error);}) }) document.querySelector('#toCopy').addEventListener('click',function(){ BaseClass.toast('已复制到剪贴板'); GM_setClipboard(videoPlayDom.children[0].src); }) document.querySelector('.toLink').addEventListener('click',function(){ window.open(videoPlayDom.children[0].src); }) return; } getControls(); window.addEventListener("wheel",getControls); window.addEventListener('keydown',function(e){ if(e.code=='ArrowDown' || e.code=='ArrowUp'){ getControls(); } }) async function insertedDom(){ let videoDom = await BaseClass.getElement('video'); if(!videoDom){ console.log('没有找到DOM');return; } videoDom.addEventListener('DOMNodeInserted',(e) => { getControls(); }) } insertedDom(); window.addEventListener('click',getControls); }) } createDyVideoDownload(){ let controlAll = document.querySelectorAll('.xg-right-grid'); let controls = controlAll.length>1?controlAll[controlAll.length-2]:controlAll[controlAll.length-1]; let videoDownloadDom = document.querySelector('#zhmDouyinDownload'); if(videoDownloadDom){ //videoDownloadDom.parentNode.removeChild(videoDownloadDom); videoDownloadDom.parentNode.parentNode.parentNode.removeChild(videoDownloadDom.parentNode.parentNode) } let playSeting = controls.querySelector('.xgplayer-playback-setting'); let downloadDom = playSeting.cloneNode(true); downloadDom.style='margin-right:20px;'; let downloadText = downloadDom.querySelector('div:first-child > span:first-child'); downloadText.innerText='下载'; downloadText.style = 'font-size:12px;font-weight:400;'; downloadText.setAttribute('id','zhmDouyinDownload'); let detail = controls.querySelector('xg-icon:nth-of-type(1)').children[0]; let linkUrl = detail.getAttribute('href')?detail.getAttribute('href'):location.href; downloadText.setAttribute('data-url',linkUrl); downloadText.removeAttribute('target'); downloadText.setAttribute('href','javascript:void(0);'); downloadDom.onmouseover=function(){ downloadDom.className='xgplayer-playback-setting slide-show'; } downloadDom.onmouseout=function(){ downloadDom.className='xgplayer-playback-setting'; } let downloadHtml = ''; downloadOption.forEach(function(item){ downloadHtml += `
${item.name}
`; }) downloadDom.querySelector('.xgplayer-playratio-wrap').innerHTML = downloadHtml; downloadDom.querySelector('.xgplayer-slider').style='width:60px important;'; let autoPlay = document.querySelector('.xgplayer-autoplay-setting'); autoPlay.after(downloadDom); let divDom = document.createElement('div'); divDom.style="position: absolute;z-index:-999;height:80px;width:40px;margin-top:-80px;" downloadDom.appendChild(divDom); } ksVideoDownload(){ var _this = this; window.addEventListener('load',function(){ async function getControls(){ let videoDom = await BaseClass.getElement('.player-video'); if(!videoDom){ console.log('没有找到DOM');return; } if(videoDom.getAttribute('src').match(/^blob/)){ console.log('blob视频无法下载');return; } _this.createKsVideoDownload(videoDom); videoDom.addEventListener('playing',function(){ //播放中 console.log("播放中"); }); videoDom.addEventListener('ended',function(){ //结束 console.log("播放结束"); let autoPlay = document.querySelector('.auto-warpper').getAttribute('autoplay'); if(autoPlay){ getControls(); return; } }, false); document.querySelector('#toDownload').addEventListener('click',function(){ BaseClass.toast('正在下载请稍侯'); let playTimeTotal = document.querySelector('.total').innerText; let second = playTimeTotal.match(/(.+):(.+)/); let secondTotal = second[1]*60+parseInt(second[2]); let dataUrl = document.querySelector('#zhmKsDownload').getAttribute('data-url'); let account = document.querySelector('.profile-user-name-title').innerText; let title = document.querySelector('.video-info-title').innerText; let videoFileName = (account && title)?account+'-'+title+'.mp4':new Date().getTime()+'.mp4'; GM_download(dataUrl,videoFileName); }) document.querySelector('#toCopy').addEventListener('click',function(){ BaseClass.toast('已复制到剪贴板'); GM_setClipboard(videoDom.getAttribute('src')); }) document.querySelector('#toLink').addEventListener('click',function(){ window.open(videoDom.getAttribute('src')); }) } getControls(); document.addEventListener('click',function(e){ getControls(); }) }) } createKsVideoDownload(videoDom){ let match = /^https?:\/\/www\.kuaishou\.com\/(.+)\/.+/; let resp = location.href.match(match); if(!resp || (resp[1] != 'short-video' && resp[1] != 'video')){ console.log('当前不是视频播放页');return; } if(resp[1] == 'short-video'){ let playerArea = document.querySelector('.video-container-player'); let playerAreaWidth = playerArea.style.width.match(/(.+)px/); let playerBarProgress = document.querySelector('.player-bar-progress'); playerBarProgress.style.width = playerAreaWidth[1]-260+'px'; let timeTotal = document.querySelector('.total'); timeTotal.style.right='120px'; } let controls = document.querySelector('.right'); let videoDownloadDom = document.querySelector('#zhmKsDownload'); if(videoDownloadDom){ videoDownloadDom.parentNode.removeChild(videoDownloadDom); } let detailDom = controls.querySelector('div:nth-of-type(1)'); let xgIcon = detailDom.cloneNode(true); let linkUrl = videoDom.getAttribute('src'); xgIcon.querySelector('.kwai-player-volume-sound').innerHTML="
下载
"; let slider = xgIcon.querySelector('.pl-slider'); slider.style = 'width:49px;padding:10px 5px 20px;'; let downloadList = ''; downloadOption.forEach(function(item){ downloadList += `
${item.name}
`; }) slider.innerHTML = downloadList; xgIcon.setAttribute('data-url',linkUrl); xgIcon.setAttribute('id','zhmKsDownload'); //console.log(xgIcon); //xgIcon.innerHTML="
下载
"; detailDom.before(xgIcon); //重构播放操作按钮 let zhmKsButton = document.querySelector('#zhmKsButton'); //console.log(zhmKsButton); if(zhmKsButton){ //zhmKsButton.parentNode.removeChild(zhmKsButton); return false; } let buttonIcon = detailDom.cloneNode(true); //console.log(buttonIcon); buttonIcon.setAttribute('id','zhmKsButton'); let buttonIconImg = buttonIcon.querySelector('.unmuted-icon'); buttonIconImg.style = 'background: url(https://s2-10623.kwimgs.com/udata/pkg/cloudcdn/img/player-setting.ad1f5ce8.svg) no-repeat'; detailDom.after(buttonIcon); let plSlider = buttonIcon.querySelector('.pl-slider'); plSlider.style='width:auto;padding:10px 10px 25px 10px;'; plSlider.innerHTML = ""; let buttonFour = controls.querySelector('div:nth-of-type(4)'); buttonFour.style.margin='0px'; let autoPlay = document.querySelector('.play-setting-container'); autoPlay.style.margin='0px 40px 0px 0px'; let buttonFive = controls.querySelector('div:nth-of-type(5)'); buttonFive.style.margin='15px 0px'; buttonFive.onmouseover=function(){ setTimeout(function(){ let toolTip = document.querySelector('.kwai-player-rotate-tooltip'); if(toolTip){ toolTip.parentNode.removeChild(toolTip); } },30) } let buttonSix = controls.querySelector('div:nth-of-type(6)'); buttonSix.style.margin='15px 0px'; let toolTip = document.querySelector('.kwai-player-fullscreen-tooltip'); buttonSix.onmouseover=function(){ setTimeout(function(){ let toolTip = document.querySelector('.kwai-player-fullscreen-tooltip'); if(toolTip){ toolTip.parentNode.removeChild(toolTip); } },30) } plSlider.appendChild(buttonFour); plSlider.appendChild(buttonFive); plSlider.appendChild(buttonSix); } xiguaVideoDownload(){ var _this = this; window.addEventListener('load',function(){ async function getControls(){ let videoDom = await BaseClass.getElement('video'); if(!videoDom){ console.log('没有找到DOM');return; } _this.createXiguaVideoDownload(); let url = 'https://test.jpnet.cc/xiguaVideo.php?url='+encodeURIComponent(location.href); let uri = _this.request('get',url).then((result)=>{ let resp = JSON.parse(result); let videoSrc = ''; if(resp.code == 0){ videoSrc = resp.data.url; } document.querySelector('#toDownload').addEventListener('click',function(){ if(!videoSrc){ BaseClass.toast('该视频无法下载'); return; } let videoTitle = document.querySelector('.videoTitle h1').innerText; let videoAuthor = document.querySelector('.author__userName').title; BaseClass.toast('正在下载请稍侯'); GM_download(videoSrc,videoTitle+'@'+videoAuthor+'.mp4'); }) document.querySelector('#toCopy').addEventListener('click',function(){ if(!videoSrc){ BaseClass.toast('该视频不能复制地址'); return; } BaseClass.toast('已复制到剪贴板'); GM_setClipboard(videoSrc); }) document.querySelector('#toLink').addEventListener('click',function(){ if(!videoSrc){ BaseClass.toast('该视频不能直接打开'); return; } window.open(videoSrc); }) document.addEventListener('click',function(e){ e.path.forEach(function(item){ if(item.className == 'xgplayer-control-item control_playnext common-control-item'){ setTimeout(function(){ location.reload(); return; },1000) }; }) var objLink = {}; e.path.forEach(function(item){ if(item.href){ objLink.href = item.href?item.href:''; objLink.target = item.target?item.target:''; return; } }) if(objLink.href && objLink.target != '_blank'){ location.href = objLink.href; return; } }) }).catch((error)=>{ console.log(error);}) document.querySelector('video').addEventListener('ended',function(){ //结束 console.log("播放结束"); setTimeout(function(){ location.reload(); },5500); }, false); } getControls(); }) } createXiguaVideoDownload(){ let rightGrid = document.querySelector('.xg-right-grid'); let playControl = rightGrid.querySelector('div:nth-of-type(2)'); let control = playControl.cloneNode(true); let entry= control.querySelector('.xgplayer-control-item__entry'); entry.innerHTML = '
下载
'; let popover = control.querySelector('.xgplayer-control-item__popover'); let downloadList = ''; popover.innerHTML = downloadList; playControl.before(control); let divDom = document.createElement('div'); divDom.style="width: 80px; height: 140px;position:absolute;bottom:40px;left:20px;z-index:-1"; control.appendChild(divDom); control.onmouseover=function(){ popover.style.display='block'; } control.onmouseout=function(){ popover.style.display='none'; } } biliVideoDownload(){ var _this = this; window.addEventListener('load',function(){ async function getControls(){ let videoDom; if(location.href.indexOf('bangumi') != -1){ let rightControl = await BaseClass.getElement('.squirtle-controller-wrap-right'); if(!rightControl){ console.log('没有找到DOM');return; } _this.createBiliVideoDownload(); }else{ let n=0; let timer = setInterval(function(){ let dom = document.querySelector('.bilibili-player-video-btn-quality'); let domOther = document.querySelector('.bpx-player-ctrl-quality'); if(dom){ clearInterval(timer); _this.createBiliVideoDownload(); return; }else if(domOther){ clearInterval(timer); _this.createBiliVideoDownloadOther(); return; }else{ if(n++>30)clearInterval(timer); } },100) return; } //_this.createBiliVideoDownload(); let timerZhmIcon = setInterval(function(){ let videoDom = [{name:'video',type:'dom'},{name:'bwp_video',type:'dom'},{name:'.bilibili-player-video',type:'class'}]; for(let i = 0;i"; 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\/m\/play\?cid/}, {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:"#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:".player-container",nodeType:'id',match:/www\.bilibili\.com\/video/}, {funcName:"playVideo", node:"#bilibili-player",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-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\//}, ]; //创建logo_icon playVideoClass.createElement('div','zhmIcon'); let zhmPlay = document.getElementById('zhmIcon'); zhmPlay.innerHTML = playWrapHtml; let jxVideoWeb = jxVideoData.filter(function(item){ return location.href.match(item.match); }) //选择平台 if(isMobile){ document.querySelector('#zhmlogo').addEventListener('click',function(){ let jxVideoWeb = jxVideoData.filter(function(item){ return location.href.match(item.match); }) if(jxVideoWeb.length == 0){ BaseClass.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'); playVideoClass.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'; } } }) }else{ //是否在播放页 if(jxVideoWeb.length == 0){ document.querySelector('#zhmIcon').addEventListener('click',function(){ BaseClass.toast('请在视频播放页点击图标'); }) }else{ var {funcName,match:nowMatch,node:nowNode,name:nowName} = jxVideoWeb[0]; //鼠标经过显示线路 document.querySelector('.playButton').onmouseover=()=>{ document.querySelector(".playLineDiv").style.display='block'; } document.querySelector('.playButton').onmouseout=()=>{ document.querySelector(".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'); playVideoClass.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('视频网站结点不存在'); } }) }) /*--特殊处理--*/ //优酷去广告 if(nowNode=="#player"){ setTimeout(function(){ let youkuAd = document.querySelector('.advertise-layer'); let ykAd = youkuAd.lastChild; ykAd.parentNode.removeChild(ykAd); document.querySelector('.kui-dashboard-0').style='display:flex'; let playVideo = document.querySelector('.video-layer video'); playVideo.play(); let n=0; //暂停 document.querySelector('.kui-play-icon-0').addEventListener('click',function(){ let video = document.querySelector('.video-layer video'); if(n++%2 == 0){ video.pause(); }else{ video.play(); } }); playVideo.addEventListener('timeupdate',function(){ //播放时间改变 let youkuAd = document.querySelector('.advertise-layer'); let ykAd = youkuAd.lastChild; if(ykAd){ ykAd.parentNode.removeChild(ykAd); } document.querySelector('.kui-dashboard-0').style='display:flex'; }); },3000) } //爱奇艺去广告 if(nowNode=="#flashbox"){ setTimeout(function(){ let dom = document.querySelector('.skippable-after'); if(dom){ dom.click(); } },3000) } //腾讯去vip弹窗 if(nowNode=="#player-container"){ let n = 0; let timer = setInterval(function(){ if(n++ < 100){ let panelTipVip = document.querySelector('.panel-overlay'); if(panelTipVip){ panelTipVip.style.display='none'; clearInterval(timer); } }else{ clearInterval(timer); } },100) } //乐视选集处理 if(nowNode == "#le_playbox"){ setTimeout(function(){ let jBlock = document.querySelectorAll('.j_block'); if(!jBlock) return; for(let i=0;i{ location.href=`${zhmApiUrl}/jxjx.php?lrspm=${result}&zhm_jx=${location.href}`; }).cath(err=>{}) }) //全局click监听 document.addEventListener('click',function(e){ /*爱奇艺选集去广告*/ if(nowName=='iqiyiPc'){ e.path.forEach(function(item){ if(item.className.indexOf('select-item')!= -1){ setTimeout(function(){ location.href=location.href; },1000) } }) setTimeout(function(){ let dom = document.querySelector('.skippable-after'); if(dom){ dom.click(); }else{ return; } },5000) } let areaClassName = []; e.path.filter(function(item){ if(item.className == nowWeb[0].areaClassName){ areaClassName=item; }; }) if(areaClassName.length == 0){ console.log('不在选集范围'); return; } if(nowName=='qqPC'){ e.path.forEach(function(item){ if(item.className=='episode-list-rect__item' || item.className.indexOf('episode-item') != -1){ setTimeout(function(){ location.href=location.href; },1000) } }) } }) /*腾讯视频点击其它视频跳转*/ if(nowName=='qqPC'){ let figure = document.querySelectorAll('.figure'); let figureDetail = document.querySelectorAll('.figure_detail'); let listItem = [...figure,...figureDetail]; if(listItem.length > 0){ listItem.forEach(function(item){ item.addEventListener('click',function(){ let link = this.getAttribute('href'); if(link){ location.href = link; return; } }) }); } } } } } function playMusicFunc(){ if(self.frameElement && self.frameElement.tagName == "IFRAME"){ return; } var playMusicClass = new PlayMusicClass(); const webUrl = 'http://music.eggvod.cn/'; var musicId = Math.ceil(Math.random()*100000000); var musicHtml = "
"; //netease 路由两次,需重定义 var newUrl = location.href; let jxMusicWeb = jxMusic[0].web.filter(function(item){ return newUrl.match(item.match); }) if(jxMusicWeb.length){ let timerZhmIcon = setInterval(function(){ if (document.querySelector('#zhmIcon')){ clearInterval(timerZhmIcon); // 取消定时器 if(jxMusicWeb[0].name=='kuwo'){ setTimeout(function(){ let control = document.querySelector('.icon-bar_icon_download_'); let icon = control.cloneNode(true); icon.className = ''; icon.style='margin-left:10px;'; icon.innerHTML = "下载"; let controls = document.querySelector('.col_r'); controls.before(icon); document.querySelector('#kuwoDownload').addEventListener('click',function(){ let audioSrc = document.querySelector("audio").src; let songName = document.querySelector('.control .song_name').title; let artist = document.querySelector('.control .artist').title; GM_download(audioSrc,songName+'-'+artist+'.mp3'); }) },2000) } if(jxMusicWeb[0].name=='ximalaya'){ setTimeout(function(){ //播放器创建下载icon let xmControls = document.querySelector('.xm-player-oprations'); let control = xmControls.querySelector('a:nth-of-type(2)'); let icon = control.cloneNode(true); icon.innerHTML = "下载"; xmControls.style='position: relative;margin-left:-20px;'; document.querySelector('.xm-player-progress').style.width='450px'; document.querySelector('.xm-player-playtime').style='position: absolute;right:40px;'; xmControls.prepend(icon); //播放器下载事件 document.querySelector('#ximaDownload').addEventListener('click',function(){ let fmTitle = document.querySelector('.fm-title'); let fmTitleMatch = fmTitle.href.match(/^https?:\/\/www\.ximalaya\.com\/sound\/(\S*)$/); let url = 'https://mobile.ximalaya.com/mobile-playpage/track/v3/baseInfo/'+new Date().getTime()+'?device=web&trackId='+fmTitleMatch[1]; playMusicClass.request('get',url).then((result)=>{ let data = JSON.parse(result); let playUrl = data.trackInfo.playUrlList[1].url; let str1 = playUrl.replaceAll('-','+'); let str2 = str1.replaceAll('_','/'); let num = str2.length%4; if(num){ str2 += '===='.substr(num); } let decrypted = CryptoJS.AES.decrypt({ ciphertext: CryptoJS.enc.Base64.parse(str2) }, CryptoJS.enc.Hex.parse("aaad3e4fd540b0f79dca95606e72bf93"), { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }).toString(CryptoJS.enc.Utf8); console.log(decrypted); if(decrypted){ GM_download(decrypted,data.trackInfo.title+'.mp3'); }else{ console.log('解密地址失败'); } }) }) //页面列表创建批量下载 let urlMatch = newUrl.match(/^https:\/\/www.ximalaya.com\/album\/[0-9]+/); if(urlMatch){ let soundList = document.querySelector('#anchor_sound_list'); if(soundList){ let soundListHead = soundList.querySelector('.head'); let soundListHeadTitle = soundListHead.querySelector('.sort').lastChild; let data = [{name:'批量下载',id:'batchDownload'},{name:'重置',id:'reset'},{name:'全选',id:'selectAll'}]; data.forEach(function(item){ let control = soundListHeadTitle.cloneNode(true); control.setAttribute('id',item.id); control.innerText = item.name; soundListHeadTitle.after(control); control.before(" | "); }); playMusicClass.xmlyCreateCheckbox(); document.querySelector('#selectAll').addEventListener('click',function(){ let zhmCheckbox = soundList.querySelectorAll("input[name='zhmCheckbox']"); zhmCheckbox.forEach(function(item){ if(!item.checked){ item.checked=true; } }) }); document.querySelector('#reset').addEventListener('click',function(){ let zhmCheckbox = soundList.querySelectorAll("input[name='zhmCheckbox']"); zhmCheckbox.forEach(function(item){ item.checked = false; }) }) document.querySelector('#batchDownload').addEventListener('click',function(){ //BaseClass.toast('已下载,请稍候'); let zhmCheckbox = soundList.querySelectorAll("input[name='zhmCheckbox']"); zhmCheckbox.forEach(function(item){ if(item.checked){ let scrMatch = item.value.match(/\/sound\/([0-9]+)/); let url = 'https://mobile.ximalaya.com/mobile-playpage/track/v3/baseInfo/'+new Date().getTime()+'?device=web&trackId='+scrMatch[1]; playMusicClass.request('get',url).then((result)=>{ let data = JSON.parse(result); let playUrl = data.trackInfo.playUrlList[1].url; let str1 = playUrl.replaceAll('-','+'); let str2 = str1.replaceAll('_','/'); let num = str2.length%4; if(num){ str2 += '===='.substr(num); } let decrypted = CryptoJS.AES.decrypt({ ciphertext: CryptoJS.enc.Base64.parse(str2) }, CryptoJS.enc.Hex.parse("aaad3e4fd540b0f79dca95606e72bf93"), { mode: CryptoJS.mode.ECB, padding: CryptoJS.pad.Pkcs7 }).toString(CryptoJS.enc.Utf8); //console.log(decrypted); if(decrypted){ GM_download(decrypted,data.trackInfo.title+'.mp3'); }else{ console.log('解密地址失败'); } }) } }) }) //正序倒序事件 soundListHead.querySelector('.sort').firstChild.addEventListener('click',function(){ setTimeout(function(){ playMusicClass.xmlyCreateCheckbox(); },2000) }); soundListHeadTitle.addEventListener('click',function(){ setTimeout(function(){ playMusicClass.xmlyCreateCheckbox(); },2000) }); //翻页事件 let pageBar = document.querySelector('.pagination-page'); pageBar.addEventListener('click',function(){ setTimeout(function(){ playMusicClass.xmlyCreateCheckbox(); },2000) }) //跳页事件 document.querySelector('button[type=submit]').addEventListener('click',function(){ setTimeout(function(){ playMusicClass.xmlyCreateCheckbox(); },1000) }) } }else{ console.log('url地址错误'); } },1000); //全局点击事件 document.addEventListener('click',function(e){ var objLink = {}; e.path.forEach(function(item){ if(item.href){ objLink.href = item.href?item.href:''; objLink.target = item.target?item.target:''; return; } }) if(objLink.href && objLink.target != '_blank'){ location.href = objLink.href; return; } }) } if(jxMusicWeb[0].name=='kugou'){ let aDom = document.querySelectorAll('a'); aDom.forEach(function(item){ let dataObj = item.getAttribute('dataobj'); if(dataObj){ item.removeAttribute('dataobj'); item.setAttribute('target','_blank'); //console.log(dataObj); } }) if(couponUrl.indexOf('mixsong')!=-1 || couponUrl.indexOf('song') != -1){ setTimeout(function(){ let volumeDom = document.querySelector('#volume'); let downloadDom = volumeDom.cloneNode(true); downloadDom.removeAttribute('id'); downloadDom.style='margin-top:30px'; downloadDom.innerHTML = "下载"; volumeDom.before(downloadDom); volumeDom.style='left:50px;'; document.querySelector('#mode').style='margin-left:90px;'; document.querySelector('#pb_download').style='margin-left:130px;'; document.querySelector('#pb_share').style='margin-left:170px;'; document.querySelector('#list').style='right:-20px;'; document.querySelector('#kugouDownload').addEventListener('click',function(){ let audio = document.querySelector('#myAudio'); let audioSrc = audio.getAttribute('src'); let singerName = document.querySelector('.singerName').title; let songName = document.querySelector('#songNameTemp').title; GM_download(audioSrc,songName+'-'+singerName.substr(0,singerName.length-1)+'.mp3'); }) },1000) } console.log(couponUrl); } if(jxMusicWeb[0].name=='netease' && location.href == 'https://music.163.com/st/download'){ return false; } let zhmPlay = document.getElementById('zhmIcon'); setTimeout(function(){ zhmPlay.innerHTML = musicHtml; document.querySelector('.zhm_icon').addEventListener('click',function(){ let musicUrlData = [ {match:/^https?:\/\/music\.163\.com\/#\/(?:song|dj)\?id/}, {match:/^https?:\/\/y\.music\.163\.com\/m\/(?:song|dj)\?id/}, {match:/^https?:\/\/music\.163\.com\/(?:song|dj)\?id/}, {match:/^https?:\/\/y\.qq\.com\/n\/ryqq\/player/}, {match:/kugou\.com/}, {match:/kuwo\.cn/}, {match:/^https?:\/\/www\.ximalaya\.com/}, ] let musicUrl = musicUrlData.filter(function(item){ return location.href.match(item.match); }) if(musicUrl.length==0){ BaseClass.toast(jxMusicWeb[0].tip); return; } switch(jxMusicWeb[0].name){ case 'netease': neteaseFun(); break; case 'qq': qqFun(); break; case 'kugou': kugouFun(); break; case 'kuwo': kuwoFun(); break; case 'ximalaya': ximalayaFun(); break; } function neteaseFun(){ let urlParams = playMusicClass.getUrlParams(location.href); if(urlParams.id == undefined) return; let neteaseUrlEncode = encodeURIComponent('https://music.163.com/song?id='+urlParams.id); let openUrl = webUrl+'?url='+neteaseUrlEncode; window.open(openUrl); } function qqFun(){ let qqSongMatch; if(document.querySelector(".player_music__info")){ qqSongMatch = document.querySelector(".player_music__info").childNodes[0].href.match(/songDetail\/(\S*)\?/); }else if(document.querySelector("#sim_song_info")){ qqSongMatch = document.querySelector("#sim_song_info").childNodes[0].href.match(/song\/(\S*).html/); }else{ qqSongMatch = ''; } if(!qqSongMatch[1]){console.log('没有获取到歌曲ID'); return}; let audioLink = encodeURIComponent(document.querySelector("audio").src); let openUrl = webUrl+'?id='+qqSongMatch[1]+'&type=qq&playUrl='+audioLink; window.open(openUrl); } function kugouFun(){ let audioModule = document.querySelector('#audioModule'); if(audioModule){ document.querySelector('#audioModule').style='bottom:0px;'; document.querySelector('#showHide_playbar').className = 'icon show-playbar-btn'; } BaseClass.toast('请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"',2000) } function kuwoFun(){ document.querySelector('.playControl').style='bottom:0px'; BaseClass.toast('请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"',2000) } function ximalayaFun(){ document.querySelector('.xm-player').style='bottom:0px'; BaseClass.toast('请点击播放需要下载的歌曲,然后在网页下方播放器内点击"下载"',2000) } }) },iconWaitTime); }else{ playMusicClass.createElement('div','zhmIcon'); } }) }else{ let zhmPlayDom = document.querySelector('#zhmIcon'); if(zhmPlayDom){ zhmPlayDom.parentNode.removeChild(zhmPlayDom); } console.log('当前音频网址没有添加匹配或匹配错误'); } } function zhNiceFunc(){ var zhClass = new ZhClass(); var zhData = [ {func:'removeVideo',isOpen:GM_getValue('removeVideo','0'),isOnscroll:1,onload:1}, {func:'removeAD',isOpen:GM_getValue('removeAD','22'),isOnscroll:0,onload:0}, {func:'downloadVideo',isOpen:GM_getValue('downloadVideo','22'),isOnscroll:0,onload:0}, {func:'removeRight',isOpen:GM_getValue('removeRight','0'),isOnscroll:0,onload:0}, {func:'changeLink',isOpen:GM_getValue('changeLink','22'),isOnscroll:0,onload:0}, {func:'removeKeyword',isOpen:GM_getValue('removeKeyword','0'),isOnscroll:1,onload:1}, ] zhData.forEach(function(item){ if(item.isOpen==22 && item.onload==0){ zhClass[item.func](); } }) window.onload=function(){ zhData.forEach(function(item){ if(item.isOpen==22 && item.onload==1){ zhClass[item.func](); } }) } window.onscroll = function(){ var scrollTop = document.documentElement.scrollTop; if(scrollTop > 200){ zhData.forEach(function(item){ if(item.isOpen==22 && item.isOnscroll==1){ zhClass[item.func](); } }) } } } function baiduFunc(){ let pt = '', selectList = [], params = {}, mode = '', width = 800, pan = {}, color = '', doc = $(document), progress = {}, request = {}, ins = {}, idm = {}; const version = '5.8.4'; const author = 'GreasyFork'; const name = '网盘直链下载助手'; const customClass = { popup: 'pl-popup', header: 'pl-header', title: 'pl-title', closeButton: 'pl-close', content: 'pl-content', input: 'pl-input', footer: 'pl-footer' }; const terminalType = { wc: "Windows CMD", wp: "Windows PowerShell", lt: "Linux 终端", ls: "Linux Shell", mt: "MacOS 终端", }; let toast = Swal.mixin({ toast: true, position: 'top', showConfirmButton: false, timer: 3500, timerProgressBar: false, didOpen: (toast) => { toast.addEventListener('mouseenter', Swal.stopTimer); toast.addEventListener('mouseleave', Swal.resumeTimer); } }); const message = { success: (text) => { toast.fire({title: text, icon: 'success'}); }, error: (text) => { toast.fire({title: text, icon: 'error'}); }, warning: (text) => { toast.fire({title: text, icon: 'warning'}); }, info: (text) => { toast.fire({title: text, icon: 'info'}); }, question: (text) => { toast.fire({title: text, icon: 'question'}); } }; let base = { clog(c) { console.group(`[${name}]`); console.log(c); console.groupEnd(); }, getCookie(name) { let arr = document.cookie.replace(/\s/g, "").split(';'); for (let i = 0, l = arr.length; i < l; i++) { let tempArr = arr[i].split('='); if (tempArr[0] == name) { return decodeURIComponent(tempArr[1]); } } return ''; }, getValue(name) { return GM_getValue(name); }, setValue(name, value) { GM_setValue(name, value); }, getStorage(key) { return localStorage.getItem(key); }, setStorage(key, value) { return localStorage.setItem(key, value); }, setClipboard(text) { GM_setClipboard(text, 'text'); }, e(str) { return btoa(unescape(encodeURIComponent(str))); }, d(str) { return decodeURIComponent(escape(atob(str))); }, getExtension(name) { const reg = /(?!\.)\w+$/; if (reg.test(name)) { let match = name.match(reg); return match[0].toUpperCase(); } return ''; }, sizeFormat(value) { if (value === +value) { let unit = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; let index = Math.floor(Math.log(value) / Math.log(1024)); let size = value / Math.pow(1024, index); size = size.toFixed(1); return size + unit[index]; } return ''; }, sortByName(arr) { const handle = () => { return (a, b) => { const p1 = a.filename ? a.filename : a.server_filename; const p2 = b.filename ? b.filename : b.server_filename; return p1.localeCompare(p2, "zh-CN"); }; }; arr.sort(handle()); }, blobDownload(blob, filename) { if (blob instanceof Blob) { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = filename; a.click(); URL.revokeObjectURL(url); } }, post(url, data, headers, type) { if (Object.prototype.toString.call(data) === '[object Object]') { data = JSON.stringify(data); } return new Promise((resolve, reject) => { GM_xmlhttpRequest({ method: "POST", url, headers, data, responseType: type || 'json', onload: (res) => { type === 'blob' ? resolve(res) : resolve(res.response || res.responseText); }, onerror: (err) => { reject(err); }, }); }); }, get(url, headers, type, extra) { return new Promise((resolve, reject) => { let requestObj = GM_xmlhttpRequest({ method: "GET", url, headers, responseType: type || 'json', onload: (res) => { if (res.status === 204) { requestObj.abort(); idm[extra.index] = true; } if (type === 'blob') { res.status === 200 && base.blobDownload(res.response, extra.filename); resolve(res); } else { resolve(res.response || res.responseText); } }, onprogress: (res) => { if (extra && extra.filename && extra.index) { res.total > 0 ? progress[extra.index] = (res.loaded * 100 / res.total).toFixed(2) : progress[extra.index] = 0.00; } }, onloadstart() { extra && extra.filename && extra.index && (request[extra.index] = requestObj); }, onerror: (err) => { reject(err); }, }); }); }, addStyle(id, tag, css) { tag = tag || 'style'; let doc = document, styleDom = doc.getElementById(id); if (styleDom) return; let style = doc.createElement(tag); style.rel = 'stylesheet'; style.id = id; tag === 'style' ? style.innerHTML = css : style.href = css; doc.getElementsByTagName('head')[0].appendChild(style); }, initDefaultConfig() { let value = [{ name: 'setting_rpc_domain', value: 'http://localhost' }, { name: 'setting_rpc_port', value: '16800' }, { name: 'setting_rpc_path', value: '/jsonrpc' }, { name: 'setting_rpc_token', value: '' }, { name: 'setting_rpc_dir', value: 'D:' }, { name: 'setting_terminal_type', value: 'wc' }, { name: 'setting_theme_color', value: '#09AAFF' }, { name: 'setting_init_code', value: '' }]; value.forEach((v) => { base.getValue(v.name) === undefined && base.setValue(v.name, v.value); }); }, showSetting() { let dom = '', btn = '', colorList = ['#09AAFF', '#cc3235', '#526efa', '#518c17', '#ed944b', '#f969a5', '#bca280']; dom += ``; dom += ``; dom += ``; dom += ``; dom += ``; colorList.forEach((v) => { btn += `
`; }); dom += ``; dom += `