"use strict"; // ==UserScript== // @name DouyuEx-斗鱼直播间增强插件 // @namespace https://github.com/qianjiachun // @icon https://s2.ax1x.com/2020/01/12/loQI3V.png // @version 2020.02.27.01 // @description 弹幕自动变色防检测循环发送 一键续牌 查看真实人数/查看主播数据 已播时长 一键签到(直播间/车队/鱼吧/客户端) 一键领取鱼粮(宝箱/气泡/任务) 一键寻宝 送出指定数量的礼物 一键清空背包 屏蔽广告 调节弹幕大小 自动更新 同屏画中画/多直播间小窗观看/可在斗鱼看多个平台直播(b站虎牙) 获取真实直播流地址 自动抢礼物红包 不绑定手机发送弹幕 // @author 小淳 // @match *://*.douyu.com/0* // @match *://*.douyu.com/1* // @match *://*.douyu.com/2* // @match *://*.douyu.com/3* // @match *://*.douyu.com/4* // @match *://*.douyu.com/5* // @match *://*.douyu.com/6* // @match *://*.douyu.com/7* // @match *://*.douyu.com/8* // @match *://*.douyu.com/9* // @match *://*.douyu.com/topic/* // @match *://msg.douyu.com/* // @require https://cdn.jsdelivr.net/npm/flv.js@1.5.0/dist/flv.min.js // @grant GM_openInTab // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @downloadURL none // ==/UserScript== "use strict";function _asyncToGenerator(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,n){function o(i,a){try{var r=t[i](a),s=r.value}catch(e){return void n(e)}if(!r.done)return Promise.resolve(s).then(function(e){o("next",e)},function(e){o("throw",e)});e(s)}return o("next")})}}function initPkg(){initPkg_ExIcon(),initPkg_ExPanel(),initPkg_RemoveAD(),initPkg_RealAudience(),initPkg_Update(),initPkg_PopupPlayer(),initPkg_ExpandTool(),initPkg_BarrageLoop(),initPkg_FansContinue(),initPkg_FishFood(),initPkg_FishPond(),initPkg_Sign()}function initPkg_Timer(){initPkg_FishPond_Timer()}function initTimer(){initPkg_Timer(),exTimer=setInterval(initPkg_Timer,2e4)}function initStyles(){var e=document.createElement("style");e.appendChild(document.createTextNode('\n.bloop {\n\tbackground-color: rgba(255,255,255,0.9);\n\twidth: 100%;\n\theight: 200px;\n\tposition: relative;\n\tbottom: 200px;\n\tdisplay: none;\n}\n\n.bloop__switch {\n\tposition: absolute;\n\tright: 0;\n\tbottom: 0;\n}\n.ex-icon {\n\tdisplay: inline-block;\n\tvertical-align: middle;\n\tmargin-right: 8px;\n}\n.extool {\n\tbackground-color: rgba(255,255,255,0.9);\n\twidth: 100%;\n\theight: 200px;\n\tposition: relative;\n\tbottom: 200px;\n\tdisplay: none;\n}\n\n.extool__switch {\n\tposition: absolute;\n\tright: 0;\n\tbottom: 0;\n}\n.extool__bsize,.extool__sendgift {\n\tmargin-bottom: 5px;\n}\n\n.ex-panel {\n\twidth: 500px;\n\theight: 50px;\n\tposition: absolute;\n\tbottom: 35px;\n\tright: 75px;\n\tbackground-color: rgba(255,255,255,0.9);\n\tdisplay: none;\n\tborder: 2px rgb(234,173,26) solid;\n}\n.ex-panel__wrap {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 100%;\n\theight: 100%;\n}\n.ex-panel__icon {\n\tmargin: 0 10px;\n\tdisplay: block;\n\tposition: relative;\n\tpadding: 5px;\n}\n.ex-panel__tip {\n\tdisplay:none;\n\tbackground:#f00;\n\tborder-radius:50%;\n\twidth:8px;\n\theight:8px;\n\ttop:0px;\n\tright:0px;\n\tposition:absolute;\n}\n.videoDiv {\n width: 400px;\n height: 200px;\n background-color: rgba(255, 255, 255, 0);\n position: absolute;\n z-index: 7777;\n}\n\n.videoPlayer {\n width: 100%;\n height: 100%;\n cursor: move;\n}\n\n.videoScale {\n width: 10px;\n height: 10px;\n overflow: hidden;\n cursor: se-resize;\n position: absolute;\n right: 0;\n bottom: 0;\n background-color: rgb(231, 57, 57);\n}\n\n.videoInfo {\n width: 100%;\n height: 30px;\n background-color: gray;\n position: absolute;\n top: -30px;\n line-height: 30px;\n}\n\n.videoClose {\n width: 30px;\n float: right;\n color: white;\n}\n\n.videoQn, .videoCDN {\n margin-left: 5px;\n}\n\n.videoRID {\n margin: 0px 5px;\n font-weight: 800;\n font-size: medium;\n}\n\n#popup-player__prompt {\n display: none;\n}\n\n.postbird-box-container{width:100%;height:100%;overflow:hidden;position:fixed;top:0;left:0;z-index:9999;display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.postbird-box-container.active{display:block}.postbird-box-content{width:400px;max-width:90%;min-height:170px;background-color:#fff;border:solid 1px #dfdfdf;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);margin-top:-100px}.postbird-box-header{width:100%;padding:10px 15px;position:relative;font-size:1.1em;letter-spacing:2px}.postbird-box-close-btn{cursor:pointer;font-weight:700;color:#000;float:right;opacity:.5;font-size:1.3em;margin-top:-3px;display:none}.postbird-box-close-btn:hover{opacity:1}.postbird-box-text{box-sizing: border-box;width:100%;padding:0 10%;text-align:center;line-height:40px;font-size:20px;letter-spacing:1px}.postbird-box-footer{width:100%;position:absolute;bottom:0;padding:0;margin:0;display:flex;display:-webkit-flex;justify-content:space-around;border-top:solid 1px #dfdfdf;align-items:flex-end}.postbird-box-footer .btn-footer{line-height:44px;border:0;cursor:pointer;background-color:#fff;color:#0e90d2;font-size:1.1em;letter-spacing:2px;transition:background-color .5s;-webkit-transition:background-color .5s;-o-transition:background-color .5s;-moz-transition:background-color .5s;outline:0}.postbird-box-footer .btn-footer:hover{background-color:#e5e5e5}.postbird-box-footer .btn-block-footer{width:100%}.postbird-box-footer .btn-left-footer,.postbird-box-footer .btn-right-footer{position:relative;width:100%}.postbird-box-footer .btn-left-footer::after{content:"";position:absolute;right:0;top:0;background-color:#e5e5e5;height:100%;width:1px}.postbird-box-footer .btn-footer-cancel{color:#333}.postbird-prompt-input{width:100%;padding:5px;font-size:16px;border:1px solid #ccc;outline:0}\n.real-audience {\n cursor: pointer;\n}\n/*\n Notice.css\n*/\n.noticejs-top{top:0;width:100%!important}.noticejs-top .item{border-radius:0!important;margin:0!important}.noticejs-topRight{top:10px;right:10px}.noticejs-topLeft{top:10px;left:10px}.noticejs-topCenter{top:10px;left:50%;transform:translate(-50%)}.noticejs-middleLeft,.noticejs-middleRight{right:10px;top:50%;transform:translateY(-50%)}.noticejs-middleLeft{left:10px}.noticejs-middleCenter{top:50%;left:50%;transform:translate(-50%,-50%)}.noticejs-bottom{bottom:0;width:100%!important}.noticejs-bottom .item{border-radius:0!important;margin:0!important}.noticejs-bottomRight{bottom:10px;right:10px}.noticejs-bottomLeft{bottom:10px;left:10px}.noticejs-bottomCenter{bottom:10px;left:50%;transform:translate(-50%)}.noticejs{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.noticejs .item{margin:0 0 10px;border-radius:3px;overflow:hidden}.noticejs .item .close{float:right;font-size:18px;font-weight:700;line-height:1;color:#fff;text-shadow:0 1px 0 #fff;opacity:1;margin-right:7px}.noticejs .item .close:hover{opacity:.5;color:#000}.noticejs .item a{color:#fff;border-bottom:1px dashed #fff}.noticejs .item a,.noticejs .item a:hover{text-decoration:none}.noticejs .success{background-color:#64ce83}.noticejs .success .noticejs-heading{background-color:#3da95c;color:#fff;padding:10px}.noticejs .success .noticejs-body{color:#fff;padding:10px}.noticejs .success .noticejs-body:hover{visibility:visible!important}.noticejs .success .noticejs-content{visibility:visible}.noticejs .info{background-color:#3ea2ff}.noticejs .info .noticejs-heading{background-color:#067cea;color:#fff;padding:10px}.noticejs .info .noticejs-body{color:#fff;padding:10px}.noticejs .info .noticejs-body:hover{visibility:visible!important}.noticejs .info .noticejs-content{visibility:visible}.noticejs .warning{background-color:#ff7f48}.noticejs .warning .noticejs-heading{background-color:#f44e06;color:#fff;padding:10px}.noticejs .warning .noticejs-body{color:#fff;padding:10px}.noticejs .warning .noticejs-body:hover{visibility:visible!important}.noticejs .warning .noticejs-content{visibility:visible}.noticejs .error{background-color:#e74c3c}.noticejs .error .noticejs-heading{background-color:#ba2c1d;color:#fff;padding:10px}.noticejs .error .noticejs-body{color:#fff;padding:10px}.noticejs .error .noticejs-body:hover{visibility:visible!important}.noticejs .error .noticejs-content{visibility:visible}.noticejs .progressbar{width:100%}.noticejs .progressbar .bar{width:1%;height:30px;background-color:#4caf50}.noticejs .success .noticejs-progressbar{width:100%;background-color:#64ce83;margin-top:-1px}.noticejs .success .noticejs-progressbar .noticejs-bar{width:100%;height:5px;background:#3da95c}.noticejs .info .noticejs-progressbar{width:100%;background-color:#3ea2ff;margin-top:-1px}.noticejs .info .noticejs-progressbar .noticejs-bar{width:100%;height:5px;background:#067cea}.noticejs .warning .noticejs-progressbar{width:100%;background-color:#ff7f48;margin-top:-1px}.noticejs .warning .noticejs-progressbar .noticejs-bar{width:100%;height:5px;background:#f44e06}.noticejs .error .noticejs-progressbar{width:100%;background-color:#e74c3c;margin-top:-1px}.noticejs .error .noticejs-progressbar .noticejs-bar{width:100%;height:5px;background:#ba2c1d}@keyframes noticejs-fadeOut{0%{opacity:1}to{opacity:0}}.noticejs-fadeOut{animation-name:noticejs-fadeOut}@keyframes noticejs-modal-in{to{opacity:.3}}@keyframes noticejs-modal-out{to{opacity:0}}.noticejs-rtl .noticejs-heading{direction:rtl}.noticejs-rtl .close{float:left!important;margin-left:7px;margin-right:0!important}.noticejs-rtl .noticejs-content{direction:rtl}.noticejs{position:fixed;z-index:10050;width:320px}.noticejs ::-webkit-scrollbar{width:8px}.noticejs ::-webkit-scrollbar-button{width:8px;height:5px}.noticejs ::-webkit-scrollbar-track{border-radius:10px}.noticejs ::-webkit-scrollbar-thumb{background:hsla(0,0%,100%,.5);border-radius:10px}.noticejs ::-webkit-scrollbar-thumb:hover{background:#fff}.noticejs-modal{position:fixed;width:100%;height:100%;background-color:#000;z-index:10000;opacity:.3;left:0;top:0}.noticejs-modal-open{opacity:0;animation:noticejs-modal-in .3s ease-out}.noticejs-modal-close{animation:noticejs-modal-out .3s ease-out;animation-fill-mode:forwards}\n\n')),document.head.appendChild(e)}function showExPanel(){var e=document.getElementsByClassName("ex-panel")[0];"block"!=e.style.display?e.style.display="block":e.style.display="none"}function sleep(e){return new Promise(function(t){return setTimeout(t,e)})}function formatSeconds(e){var t=parseInt(e),n=0,o=0;t>60&&(n=parseInt(t/60),t=parseInt(t%60),n>60&&(o=parseInt(n/60),n=parseInt(n%60)));var i=parseInt(t)+"秒";return n>0&&(i=parseInt(n)+"分"+i),o>0&&(i=parseInt(o)+"小时"+i),i}function getStrMiddle(e,t,n){var o=e.match(new RegExp(t+"(.*?)"+n));return!!o&&o[1]}function getToken(){var e=document.cookie;return getStrMiddle(e,"acf_uid=",";")+"_"+getStrMiddle(e,"acf_biz=",";")+"_"+getStrMiddle(e,"acf_stk=",";")+"_"+getStrMiddle(e,"acf_ct=",";")+"_"+getStrMiddle(e,"acf_ltkid=",";")}function getDyDid(){return getStrMiddle(document.cookie,"dy_did=",";")}function setCookie(e,t){var n=new Date;n.setTime(n.getTime()+108e5),document.cookie=e+"="+escape(t)+"; path=/; expires="+n.toGMTString()}function getCCN(){var e=document.cookie,t=getStrMiddle(e,"acf_ccn=",";");return 0==t&&(setCookie("acf_ccn","1"),t="1"),t}function showMessage(e,t){new NoticeJs({text:e,type:t,position:"bottomRight"}).show()}function openPage(e,t){GM_openInTab(e,{active:t})}function closePage(){-1!=navigator.userAgent.indexOf("Firefox")||-1!=navigator.userAgent.indexOf("Chrome")?(window.location.href="about:blank",window.close()):(window.opener=null,window.open("","_self"),window.close())}function getQueryString(e){var t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i");if(window.location.hash.indexOf("?")<0)return null;var n=window.location.hash.split("?")[1].match(t);return null!=n?decodeURIComponent(n[2]):null}function dateFormat(e,t){var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in n)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return e}function getRandom(e,t){return Math.floor(Math.random()*(t-e)+e)}function isRid(e){return!!/^[0-9]+$/.test(e)}function initPkg_BarrageLoop(){initPkg_BarrageLoop_Dom(),initPkg_BarrageLoop_Func(),initPkg_BarrageLoop_Set()}function BarrageLoop_insertModal(){var e="",t=document.createElement("div");t.className="bloop",e+="
",e+='',e+='