"use strict"; // ==UserScript== // @name DouyuEx-斗鱼直播间增强插件 // @namespace https://github.com/qianjiachun // @icon https://s2.ax1x.com/2020/01/12/loQI3V.png // @version 2021.04.07.03 // @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 *://www.douyu.com/member/cp/getFansBadgeList // @match *://passport.douyu.com/* // @match *://msg.douyu.com/* // @match *://yuba.douyu.com/* // @match *://v.douyu.com/* // @require https://cdn.jsdelivr.net/npm/flv.js@1.5.0/dist/flv.min.js // @require https://cdn.jsdelivr.net/npm/svgaplayerweb@2.3.1/build/svga.min.js // @grant GM_openInTab // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @grant GM_setValue // @grant GM_getValue // @grant GM_listValues // @grant GM_deleteValue // @grant GM_cookie // @grant GM_registerMenuCommand // @grant unsafeWindow // @connect douyucdn.cn // @connect douyu.com // @connect 122.51.5.63 // @connect qq.com // @connect ddocr.com // @connect douyuex.com // @connect bojianger.com // @connect greasyfork.org // @connect bilibili.com // @connect huya.com // @connect jsdelivr.net // @connect shadiao.app // @connect fz996.com // @connect toubang.tv // @downloadURL none // ==/UserScript== function init(){initPkg_Night_Set_Fast();removeAD();initPkg_Statistics();initPkg_Console();Update_checkVersion();initPkg_Menu();initPkg_FollowList()}function initPkg(){initPkg_Night();initPkg_ExIcon();initPkg_ExPanel();initPkg_RealAudience();initPkg_CopyRealLive();initPkg_AudioLine();initPkg_RemoveAD();initPkg_BagInfo();initPkg_Update();initPkg_MiniProgram();initPkg_PopupPlayer();initPkg_LiveTool();initPkg_VideoTools();initPkg_ExpandTool();initPkg_Refresh();initPkg_BarrageLoop();initPkg_FansContinue();initPkg_FishFood();initPkg_Sign();initPkg_BarragePanel();initPkg_AdVideo();initPkg_AccountList();initPkg_ChatTools()}function initPkg_Timer(){initPkg_FishPond_Timer()}function initTimer(){initPkg_Timer();exTimer=setInterval(initPkg_Timer,3e4)}function initStyles(){let e=document.createElement("style");e.appendChild(document.createTextNode(`\n#ex-accountList-wrap { left: -152px; top: -16px; /* max-height: 330px; overflow-y: scroll; scrollbar-width: none; -ms-overflow-style: none; */ -webkit-transition: all .2s cubic-bezier(.22,.58,.12,.98); -o-transition: all cubic-bezier(.22,.58,.12,.98) .2s; -moz-transition: all cubic-bezier(.22,.58,.12,.98) .2s; transition: all .2s cubic-bezier(.22,.58,.12,.98); -webkit-transform-origin: 80% 0; -moz-transform-origin: 80% 0; -ms-transform-origin: 80% 0; -o-transform-origin: 80% 0; transform-origin: 80% 0; -webkit-animation: scale-in-ease .5s cubic-bezier(.22,.58,.12,.98); -moz-animation: scale-in-ease cubic-bezier(.22,.58,.12,.98) .5s; -o-animation: scale-in-ease cubic-bezier(.22,.58,.12,.98) .5s; animation: scale-in-ease .5s cubic-bezier(.22,.58,.12,.98);}/* #ex-accountList-wrap::-webkit-scrollbar { display: none;} */.ex-accountList-item { padding: 10px; display: flex; border-radius: 10px; align-items: center;}.ex-accountList-item:hover { background-color: rgb(244,244,244);}#ex-accountList-iframe { display: none;}#ex-accountList-iframe2 { display: none;}#ex-accountList-item-add { padding: 10px; text-align: center; margin-bottom:0px; border-radius: 10px;}#ex-accountList-item-add:hover { background-color: rgb(244,244,244);}.ex-accountList-item__imgWrap { flex: 0 0 25%;}.ex-accountList-item__img { width: 50px; height: 50px; border-radius: 50%;}.ex-accountList-item__name { line-height: 50px; flex: 0 0 55%;}.ex-accountList-item__btn { height: 30px; width: 50px; border-radius: 10px; align-items: center; flex: auto; text-align: center; line-height: 28px; color: white; background-color: rgb(245,108,108);}.ex-accountList-item__btn:hover { background-color: rgb(247,137,137);}#ex-audio-line { cursor: pointer;}.bag-info { position: absolute; background-color: rgba(0, 0, 0, 0.6); color: white; width: 20px; font-weight: 800; height: 20px; text-align: center;}.bag-button { position: relative; color: rgb(255, 255, 255); text-align: center; height: 15px; line-height: 15px; cursor: pointer; margin-left: 5px; background: rgb(70, 171, 255); border-radius: 9px; padding: 0px 10px; float: right; right: 20px;}.bloop {\tbackground-color: rgba(255,255,255,0.9);\twidth: 100%;\theight: 200px;\tposition: relative;\tbottom: 200px;\tdisplay: none;}.bloop__switch {\tposition: absolute;\tright: 0;\tbottom: 0;}.bloop__mode {\tdisplay: inline-block;}.barragePanel__funcPanel { position: absolute; width: 232px; height: 270px; display: block; background: white; overflow-y: scroll;}.barragePanel__funcPanel::-webkit-scrollbar {display:none}.barragePanel__muteTime { position: absolute; left: 25px; top: 123px; z-index: 5;}#copy-real-live { cursor: pointer;}.ex-icon {\tdisplay: inline-block;\tvertical-align: middle;\tmargin-right: 8px;\t-moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none;}.extool {\tbackground-color: rgba(255,255,255,0.9);\twidth: 100%;\theight: 200px;\tposition: relative;\tbottom: 200px;\tdisplay: none;}.extool__switch {\tposition: absolute;\tright: 0;\tbottom: 0;}.extool__bsize,.extool__sendgift {\tmargin-bottom: 5px;}.extool__redpacket_room,.extool__gold {\tdisplay: inline-block;}.ex_giftAnimation {\twidth: 100%;\theight: 100%;\tposition: absolute;\tz-index: 50;\tpointer-events: none;}.ex-panel {\tposition: absolute;\tbottom: 35px;\tright: 38px;\tbackground-color: rgba(255,255,255,0.9);\tdisplay: none;\tborder: 2px rgb(234,173,26) solid;\tz-index: 1015;\tuser-select: none;}.ex-panel__wrap {\tdisplay: flex;\talign-items: center;\tjustify-content: center;\twidth: 100%;\theight: 100%;}.ex-panel__icon {\tmargin: 0 10px;\tdisplay: block;\tposition: relative;\tpadding: 5px;\ttransition: 0.5s;}.ex-panel__icon:hover {\ttransform: scale(1.15);}.ex-panel__tip {\tdisplay:none;\tbackground:#f00;\tborder-radius:50%;\twidth:8px;\theight:8px;\ttop:0px;\tright:0px;\tposition:absolute;}#refreshFollowList { color: grey;position: absolute;right: 5px;top:0px;cursor: default;}.enter__panel { width: 100%; display: none; margin-top: 4px;}#enter__title { cursor: pointer;}#enter__select { width: 190px;}.enter__option { margin-top: 5px;}#enter__enterId { width: 40px;}#enter__reply { width: 150px;}#enter__word { width: 140px;}#enter__level { width: 25px; text-align: center;}.gift__panel { width: 100%; display: none; margin-top: 4px;}#gift__title { cursor: pointer;}#gift__select { width: 190px;}.gift__option { margin-top: 5px;}#gift__giftId { width: 40px;}#gift__reply { width: 150px;}.livetool {\tbackground-color: rgba(255,255,255,0.9);\twidth: 100%;\theight: 290px;\tposition: relative;\tbottom: 290px;\tdisplay: none;}.livetool__cell {\tposition: relative; display: -webkit-box; display: -webkit-flex; display: flex; box-sizing: border-box; width: 100%; padding: 10px 16px; overflow: hidden; color: #323233; font-size: 14px; line-height: 24px;\tbackground-color: #fff;\tborder-bottom: 1px solid rgba(0,0,0,0.2);\tflex-wrap: wrap; -webkit-flex-wrap: wrap;}.livetool__cell_title {\tflex: 1; -webkit-box-flex: 1;}.livetool__cell_option {\tflex: 1;\t-webkit-box-flex: 1;\ttext-align: right;}.livetool__cell_switch {\tfloat: right;}.mute__panel { width: 100%; display: none; margin-top: 4px;}#mute__title { cursor: pointer;}#mute__idlist { cursor: pointer; color: royalblue; margin-left: 10px;}#mute__select { width: 110px;}.mute__option { margin-top: 5px;}#mute__word { width: 70px;}#mute__count { width: 30px;}#mute__time { width: 65px;}.reply__panel { width: 100%; display: none; margin-top: 4px;}#reply__title { cursor: pointer;}#reply__select { width: 190px;}.reply__option { margin-top: 5px;}#reply__word { width: 70px;}#reply__reply { width: 147px;}.livetool__Treasure { width: 100%; position: relative; z-index: 999;}.vote__panel { width: 100%; display: none; margin-top: 4px;}#vote__title { cursor: pointer;}#vote__select { width: 100px;}.vote__option { margin-top: 5px;}#vote__theme { width: 70px;}#vote__options { width: 133px;}#vote__time { width: 35px;}#vote__show-result { cursor: pointer; color: royalblue; margin-left: 10px;}.vote__result { position: absolute; top: 0px; width: 300px; background: rgba(255,255,255,0.85); left: 0px; z-index: 999; padding: 5px; border-radius: 10px; user-select: none; display: none;}#vote__result-theme { font-size: 20px; font-weight: 600; margin-bottom: 10px;}#vote__result-close { position: absolute; top: 5px; right: 10px; font-size: 14px; cursor: pointer; color: gray;}.vote__option-wrap { margin-bottom: 10px;}.vote__option-choice { display: inline-block; font-size: 14px;}.vote__option-num { float: right; font-size: 14px;}.vote__progress { width: 100%; background-color: #ddd; border-radius: 10px;}.vote__progress-bar { width: 0%; height: 14px; background-color: #4CAF50; text-align: center; line-height: 30px; border-radius: 10px;}.miniprogram__panel { position: absolute; right: 43px; bottom: 100px; animation: move-in 0.75s; z-index: 101; text-align: center; display: none;}.miniprogram__wrap { overflow: hidden; background-color: white; border-radius: 5%; width: 200px; box-shadow: 0px 2px 20px 0px #888888; font-size: 14px;}.miniprogram__triangle { width: 0px; height: 0px; border-color: white transparent transparent transparent; border-style: solid; border-width: 10px; position: absolute; left: 100px;}#ex-point { cursor: pointer; float: left; line-height: 30px; -moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none;}#point__value { color: #333;}#ex-exchange { position: absolute; left: 0; bottom: 37px; z-index: 100;}.exchange__panel { width: 400px; height: 500px; position: relative;}.exchange__wrap { width: 400px; height: 500px; background-color: white; border-radius: 3%; overflow-y: scroll; overflow-x: hidden; box-shadow: 0px 0px 20px 0px #888888;}.exchange__wrap::-webkit-scrollbar { display:none}.exchange__close { position: absolute; color: rgb(127, 127, 137); right: 10px; top: 5px; font-size: 15px; cursor: pointer; z-index: 101;}.item__wrap { width: 100%; height: 130px; border-bottom: 1px solid rgba(121,127,137,0.4); position: relative;}.item__pic { left: 10px; top: 10px; position: absolute; height: 110px; width: 110px;}.item__name { position: absolute; top: 7px; left: 130px; color: #353536;; font-size: 15px; margin-right: 10px;}.item__description { position: absolute; top: 32px; left: 130px; font-size: 12px; margin-right: 10px; color: #969799;}.item__num { position: absolute; bottom: 27px; left: 130px; font-size: 12px; color: #969799;}.item__price { position: absolute; bottom: 7px; left: 130px; font-size: 14px; color: rgb(255,93,35); font-weight: 600;}.item__exchange { position: absolute; bottom: 8px; right: 10px; font-size: 14px; color: white; text-align: center; width: 80px; height: 25px; background-color: rgb(255,93,35); border-radius: 999px; cursor: pointer;}#ex-pointlist { position: absolute; width: 300px; height: 400px; background-color: white; border-radius: 3%; overflow: auto; z-index: 100; bottom: 37px;}#ex-pointlist::-webkit-scrollbar { display:none}.pointlist__wrap { width: 100%; height: 100%; margin: 15px 0; position: absolute;}.pointlist__close { position: absolute; color: rgb(127, 127, 137); right: 7px; font-size: 15px; cursor: pointer;}.pointlist__wrap table { border-collapse: collapse; margin: 0 auto; text-align: center;}.pointlist__wrap td,.pointlist__wrap th { border: 1px solid #cad9ea; color: #666; height: 30px; width: 85px;}.pointlist__wrap thead th { background-color: #CCE8EB; width: 100px;}.pointlist__wrap tr:nth-child(odd) { background: #fff;}.pointlist__wrap tr:nth-child(even) { background: #F5FAFA;}.point__panel { position: absolute; left: 0px; bottom: 37px; display: none; animation: move-in 0.75s; z-index: 101;}@keyframes move-in { 0% { opacity: 0; } 100% { opacity: 0.95; }}.panel__wrap { overflow: hidden; background-color: white; border-radius: 5%; width: 120px; box-shadow: 0px 2px 20px 0px #888888; font-size: 14px;}.panel__cell { width: 100%; height: 37px; line-height: 37px; border-bottom: 1px solid rgba(121,127,137,0.4); text-align: center; cursor: pointer;}.panel__cell:hover { background-color: rgb(217, 217, 217); transition: 0.75s;}.panel__triangle { width: 0px; height: 0px; border-color: white transparent transparent transparent; border-style: solid; border-width: 10px; position: absolute; left: 35px;}#ex-record { width: 300px; height: 400px; position: absolute; bottom: 67px; z-index: 100;}.record__close { position: absolute; color: rgb(127, 127, 137); right: -20px; font-size: 15px; cursor: pointer;}.records__wrap { width: 100%; height: 100%; background-color: white; border-radius: 3%; box-shadow: 0px 0px 20px 0px #888888; padding: 15px; overflow-y: scroll; overflow-x: hidden;}.records__wrap::-webkit-scrollbar { display:none}.record__wrap { height: 50px; width: 100%; border: 1px solid rgba(121,127,137,0.4); margin-bottom: 10px; display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; transition: 0.75s; cursor: pointer;}.record__wrap:hover { background-color: #e9f5ff;}.record__left { flex: 1; position: relative;}.record__name { position: absolute; flex: 1; color: #353536;; font-size: 15px; top: 2px; margin-left: 5px;}.record__updatetime { position: absolute; margin-left: 5px; font-size: 12px; bottom: 2px; color: #969799;}.record__price { line-height: 50px; color: rgb(255,93,35); margin-right: 10px;}.record__pagenav { display: -webkit-box; display: -moz-box; display: -ms-flexbox; display: -webkit-flex; display: flex; width: 310px; position: absolute; bottom: -20px; padding-left: 10px; padding-right: 10px; cursor: pointer;}.record__prev { flex: 1; text-align: center; border: 1px solid rgba(121,127,137,0.8); transition: 0.75s; color: white; background-color: rgb(57,169,237);}.record__prev:hover { background-color: #7167ff;}.record__next { flex: 1; text-align: center; border: 1px solid rgba(121,127,137,0.8); transition: 0.75s; background-color: rgb(57,169,237); color: white;}.record__next:hover { background-color: #7167ff;}.exVideoDiv { width: 400px; height: 200px; background-color: rgba(255, 255, 255, 0); position: absolute; z-index: 1015;}.exVideoPlayer { width: 100%; height: 100%; cursor: move;}.exVideoScale { width: 10px; height: 10px; overflow: hidden; cursor: se-resize; position: absolute; right: 0; bottom: 0; background-color: rgb(231, 57, 57);}.exVideoInfo { width: 100%; height: 30px; background-color: gray; position: absolute; top: -30px; line-height: 30px;}.exVideoClose { width: 30px; float: right; color: white;}.exVideoQn, .exVideoCDN { margin-left: 5px;}.exVideoRID { margin: 0px 5px; font-weight: 800; font-size: medium;}#popup-player__prompt { display: none;}.real-audience { cursor: pointer; display: flex; padding: 0 7px; line-height: 33px;}#refresh-video { float: left; width: 24px; height: 24px; margin-right: 5px; cursor: pointer; background-size: contain;}#refresh-video2 { display: none; position: absolute; top: 20px; right: 20px; cursor: pointer;}#refresh-video2-svg { fill: rgba(0,0,0,.6)}.refresh-barrage { display: inline-block; vertical-align: top; margin: 0 2px; padding: 0 8px; height: 22px; line-height: 21px; background-color: #fff; border: 1px solid #e5e4e4; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; cursor: pointer;}#refresh-barrage__svg { vertical-align: middle;}#ex-cinema { float: left; width: 24px; height: 24px; margin-right: 10px; cursor: pointer; background-size: contain;}.cinema__wrap { display: none; position: relative; height: 100%; margin-right: -15px; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; float: left; right: -12px;}.cinema__panel { position: absolute; border: 1px solid #000; border-radius: 4px; transform: translateY(calc(-4px - 100%)) translateX(-50%); left: 33%; background-color: #000; opacity: .75; width: 70px;}.cinema__panel li { padding: 0 2px; white-space: nowrap; color: #fff; text-align: center; cursor: pointer;}.cinema__panel li:hover { background-color: rgb(85, 85, 85);} #ex-filter { float: left; width: 24px; height: 24px; margin-right: 10px; cursor: pointer; background-size: contain;}.filter__wrap { display: none; position: relative; height: 100%; margin-right: -15px; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; float: left; right: -12px;}.filter__panel { position: absolute; border: 1px solid #000; border-radius: 4px; transform: translateY(calc(-4px - 100%)) translateX(-50%); left: 33%; background-color: #000; opacity: .75; width: 300px; padding-top: 10px; padding-left: 10px; padding-right: 10px;}.filter__panel li { padding: 0 2px; white-space: nowrap; color: #fff; text-align: center; cursor: pointer;}.filter__panel li:hover { background-color: rgb(85, 85, 85);}.filter__scroll { width: 255px; height: 5px; background: #ccc; position: relative; display: inline-block;}.filter__scroll-bar { width: 15px; height: 15px; background: #369; position: absolute; top: -5px; left: 100px; cursor: pointer; border-radius: 100%;}.filter__scroll-mask { position: absolute; left: 0; top: 0; background: #369; width: 100px; height: 5px;}.filter__title { color: white; display: inline-block; cursor: initial; margin-right: 2px;}#filter__select { width: 260px; float: right;}.filter__filter { margin-top: 5px;}#ex-videospeed { float: left; width: 24px; height: 24px; margin-right: 10px; cursor: pointer; background-size: contain;}.videospeed__wrap { display: none; position: relative; height: 100%; margin-right: -15px; border-radius: 4px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; float: left; right: -12px;}.videospeed__panel { position: absolute; border: 1px solid #000; border-radius: 4px; transform: translateY(calc(-4px - 100%)) translateX(-50%); left: 33%; background-color: #000; opacity: .75; width: 70px;}.videospeed__panel li { padding: 0 2px; white-space: nowrap; color: #fff; text-align: center; cursor: pointer;}.videospeed__panel li:hover { background-color: rgb(85, 85, 85);} #ex-videosync { float: left; width: 24px; height: 24px; margin-left: 20px; cursor: pointer; background-size: contain;}/* Notice.css*/.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}/** * PostbirdAlertBox.js * - 原生javascript弹框插件 * Author: Postbird - http://www.ptbird.cn * License: MIT * Date: 2017-09-23 */.postbird-box-container { width: 100%; height: 100%; overflow: hidden; position: fixed; top: 0; left: 0; z-index: 9999; background-color: rgba(0, 0, 0, 0.2); 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 { min-width: 400px; max-width: 600px; min-height: 150px; 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; padding: 0; margin: 0; bottom: 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}.onoffswitch { position: relative; width: 45px; -webkit-user-select:none; -moz-user-select:none; -ms-user-select: none;}.onoffswitch-checkbox { position: absolute; opacity: 0; pointer-events: none;}.onoffswitch-label { display: block; overflow: hidden; cursor: pointer; height: 20px; padding: 0; line-height: 20px; border: 2px solid #E3E3E3; border-radius: 20px; background-color: #FFFFFF; transition: background-color 0.3s ease-in;}.onoffswitch-label:before { content: ""; display: block; width: 20px; margin: 0px; background: #FFFFFF; position: absolute; top: 0; bottom: 0; right: 23px; border: 2px solid #E3E3E3; border-radius: 20px; transition: all 0.3s ease-in 0s; }.onoffswitch-checkbox:checked + .onoffswitch-label { background-color: #3AAD38;}.onoffswitch-checkbox:checked + .onoffswitch-label, .onoffswitch-checkbox:checked + .onoffswitch-label:before { border-color: #3AAD38;}.onoffswitch-checkbox:checked + .onoffswitch-label:before { right: 0px; }.layui-timeline { padding-left: 5px;}.layui-timeline-item { position: relative; padding-bottom: 20px;}li { list-style: none;}.layui-timeline-item:first-child::before { display: block;}.layui-timeline-item:last-child::before { content: ''; position: absolute; left: 5px; top: 0; z-index: 0; width: 0; height: 100%;}.layui-timeline-item::before { content: ''; position: absolute; left: 5px; top: 0; z-index: 0; width: 1px; height: 100%;}.layui-timeline-item::before,hr { background-color: #e6e6e6;}.layui-timeline-axis { position: absolute; left: -5px; top: 0; z-index: 10; width: 20px; height: 20px; line-height: 20px; background-color: #fff; color: #5FB878; border-radius: 50%; text-align: center; cursor: pointer;}.layui-icon { font-family: layui-icon !important; font-size: 16px; font-style: normal;}.layui-timeline-content { padding-left: 25px;}.layui-text { line-height: 22px; font-size: 14px; color: rgb(85,85,85);}.layui-timeline-title { position: relative;}\n`));document.head.appendChild(e)}(function(){initRouter(window.location.href)})();var exTimer=0;var url=document.getElementsByTagName("html")[0].innerHTML;var urlLen="$ROOM.room_id =".length;var ridPos=url.indexOf("$ROOM.room_id =");var rid=url.substring(ridPos+urlLen,url.indexOf(";",ridPos+urlLen));rid=rid.trim();url=null;urlLen=null;ridPos=null;var my_uid=getCookieValue("acf_uid");var dyToken=getToken();function showExPanel(){let e=document.getElementsByClassName("ex-panel")[0];if(e.style.display!="block"){e.style.display="block"}else{e.style.display="none"}}function sleep(e){return new Promise(t=>setTimeout(t,e))}function formatSeconds(e){let t=parseInt(e);let n=0;let o=0;if(t>60){n=parseInt(t/60);t=parseInt(t%60);if(n>60){o=parseInt(n/60);n=parseInt(n%60)}}let i=""+parseInt(t)+"秒";if(n>0){i=""+parseInt(n)+"分"+i}if(o>0){i=""+parseInt(o)+"小时"+i}return i}async function verifyFans(e,t){return true;let n=false;let o=await fetch("https://www.douyu.com/member/cp/getFansBadgeList",{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.text()}).catch(e=>{console.log("请求失败!",e)});o=(new DOMParser).parseFromString(o,"text/html");let i=o.getElementsByClassName("fans-badge-list")[0].lastElementChild;let a=i.children.length;for(let o=0;o=t){n=true;break}else{n=false}}return n}function getStrMiddle(e,t,n){let o=e.match(new RegExp(t+"(.*?)"+n));return o?o[1]:false}function getToken(){let e=getCookieValue("acf_uid")+"_"+getCookieValue("acf_biz")+"_"+getCookieValue("acf_stk")+"_"+getCookieValue("acf_ct")+"_"+getCookieValue("acf_ltkid");return e}function getDyDid(){let e=getCookieValue("dy_did");return e}function setCookie(e,t){let n=new Date;n.setTime(n.getTime()+3*60*60*1e3);document.cookie=e+"="+escape(t)+"; path=/; expires="+n.toGMTString()}function getCookieValue(e){let t,n=new RegExp("(^| )"+e+"=([^;]*)(;|$)");if(t=document.cookie.match(n)){return unescape(t[2])}else{return null}}function getCCN(){let e=getCookieValue("acf_ccn");if(e==null){setCookie("acf_ccn","1");e="1"}return e}function getCTN(){let e=getCookieValue("acf_ctn");if(e==null){setCookie("acf_ctn","1");e="1"}return e}function getUID(){let e=getCookieValue("acf_uid");return e}function showMessage(e,t){new NoticeJs({text:e,type:t,position:"bottomRight"}).show()}function openPage(e,t){GM_openInTab(e,{active:t})}function closePage(){if(navigator.userAgent.indexOf("Firefox")!=-1||navigator.userAgent.indexOf("Chrome")!=-1){window.location.href="about:blank";window.close()}else{window.opener=null;window.open("","_self");window.close()}}function getQueryString(e){let t=new RegExp("(^|&)"+e+"=([^&]*)(&|$)","i");if(window.location.hash.indexOf("?")<0){return null}let n=window.location.hash.split("?")[1].match(t);if(n!=null)return decodeURIComponent(n[2]);return null}function dateFormat(e,t){let 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()};if(/(y+)/.test(e))e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length));for(let t in n)if(new RegExp("("+t+")").test(e))e=e.replace(RegExp.$1,RegExp.$1.length==1?n[t]:("00"+n[t]).substr((""+n[t]).length));return e}function getRandom(e,t){return Math.floor(Math.random()*(t-e)+e)}function isRid(e){if(/^[0-9]+$/.test(e)){return true}else{return false}}function getAvailableSheet(e){let t=-1;for(let n=e;n{fetch("https://www.douyu.com/member/cp",{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.text()}).then(t=>{t=(new DOMParser).parseFromString(t,"text/html");let n=t.getElementsByClassName("uname_con")[0].title;e(n)}).catch(e=>{console.error("请求失败",e)})})}function getTextareaPosition(e){let t=0;if(document.selection){let n=document.selection.createRange();n.moveStart("character",-e.value.length);t=n.text.length}else if(e.selectionStart||e.selectionStart=="0"){t=e.selectionStart}return t}let svg_accountList=``;let cleanOverTimes=0;function initPkg_AccountList(){initPkg_AccountList_Dom();initPkg_AccountList_Func()}function initPkg_AccountList_Dom(){AccountList_insertIcon()}function AccountList_insertIcon(){let e=document.createElement("div");e.style="position: absolute;right: -14px;top: 32px;cursor: pointer;";e.id="ex-accountList-icon";let t=`\n
\n
\n
\n
\n
\n
\n
\n \n
\n `;e.innerHTML=svg_accountList+t;let n=document.getElementsByClassName("Header-right")[0];n.appendChild(e);addAccount()}function initPkg_AccountList_Func(){setPassportCmd("null",my_uid);unsafeWindow.addEventListener("message",e=>{switch(e.data){case"cleanOver":setTimeout(()=>{window.location.reload()},50);break;case"msgCleanOver":cleanOverTimes++;if(cleanOverTimes>=4){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"yubaCleanOver":cleanOverTimes++;if(cleanOverTimes>=4){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"videoCleanOver":cleanOverTimes++;if(cleanOverTimes>=4){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"switchOver":cleanOverTimes++;if(cleanOverTimes>=4){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"deleteOver":renderAccountList();showMessage("【账号管理】删除完毕","success");break;default:break}});document.getElementById("ex-accountList-icon").addEventListener("mouseenter",()=>{document.getElementById("ex-accountList-wrap").style.display="block"});document.getElementById("ex-accountList-icon").addEventListener("mouseleave",()=>{document.getElementById("ex-accountList-wrap").style.display="none"})}function renderAccountList(e){document.getElementById("ex-accountList-content").innerHTML=getAccountListHtml(e);let t=document.getElementsByClassName("ex-accountList-item");for(let e=0;e{switchAccount(o,()=>{});setPassportCmd("switch",o);setYubaAndMsgAndVideoClean()});n.getElementsByClassName("ex-accountList-item__btn")[0].addEventListener("click",e=>{e.stopPropagation();showMessage("【账号管理】正在删除...","info");deleteAccount(o,()=>{});setPassportCmd("delete",o)})}document.getElementById("ex-accountList-item-add").addEventListener("click",()=>{cleanCookie(()=>{});setPassportCmd("clean","null")})}function getAccountListHtml(e){let t=e==undefined?JSON.parse(GM_getValue("Ex_accountList")||"{}"):e;let n="";for(const e in t){if(e=="null"){continue}let o=t[e];n+=`\n
\n
\n \n
\n
${decodeURIComponent(o.nickname)}
\n
删除
\n
`}n+=`\n
\n \n
\n `;return n}function switchAccount(e,t){let n=JSON.parse(GM_getValue("Ex_accountList"));let o=[];let i=0;GM_cookie("list",{path:"/"},function(e){for(let n=0;n=e.length){let e=0;for(let n=0;n=o.length){t()}})}}})}})}function switchAccountPassport(e,t){let n=JSON.parse(GM_getValue("Ex_accountListPassport"));let o=n[e];let i=0;GM_cookie("list",{path:"/"},function(e){for(let n=0;n=e.length){let e=0;for(let n=0;n=o.length){t()}})}}})}})}function addAccount(){let e=JSON.parse(GM_getValue("Ex_accountList")||"{}");let t={};let n="";GM_cookie("list",{path:"/"},function(o){let i=[];if(o==undefined){document.getElementById("ex-accountList-content").innerHTML="请升级Tampermonkey版本
点我升级,选择Crx4Chrome";return}for(let e=0;e{if(n){for(let o=0;o=n.length){e()}})}}else{e()}})}function setPassportCmd(e,t){document.getElementById("ex-accountList-iframe").innerHTML=`\n \n `}function setYubaAndMsgAndVideoClean(){document.getElementById("ex-accountList-iframe2").innerHTML=`\n \n \n \n `}function deleteAccount(e,t){let n=JSON.parse(GM_getValue("Ex_accountList")||"{}");delete n[e];GM_setValue("Ex_accountList",JSON.stringify(n));t()}function deleteAccountPassport(e,t){let n=JSON.parse(GM_getValue("Ex_accountListPassport")||"{}");delete n[e];GM_setValue("Ex_accountListPassport",JSON.stringify(n));t()}function initPkg_AdVideo(){initPkg_Sign_Ad_FishPond()}function initPkg_AdVideo_Xiaoxiaole(){startGetXiaoxiaoleFishBall()}async function startGetXiaoxiaoleFishBall(){let e=await getXiaoxiaoleStatus();if(e.error=="0"){let t=Number(e.data["20201021xiaoxiaole_T1"].curCompleteNum);let n=Number(e.data["20201021xiaoxiaole_T1"].taskLimitNum);let o=n-t;if(o>0){showMessage(`【消消乐】开始领取鱼丸,剩余${o}次`,"info")}for(let e=0;e{let t=await e.finish();if(t==true){showMessage("【消消乐】成功领取40鱼丸","success")}})}}function getXiaoxiaoleStatus(){return new Promise(e=>{fetch("https://www.douyu.com/japi/carnival/nc/actTask/userStatus",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`tasks=20201021xiaoxiaole_T1&token=${dyToken}`}).then(e=>{return e.json()}).then(t=>{e(t)}).catch(e=>{console.log("请求失败!",e)})})}function initPkg_Sign_Ad_FishPond(){getFishBall_Ad_FishPond()}function getFishBall_Ad_FishPond(){GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/tasksys/ytxb/userStatusV3?client_sys=android",data:"roomId="+rid+"&token="+dyToken,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:async function(e){let t=e.response.data.taskList;for(let e=0;e{let o=await getFishBall_Ad_FishPond_finish(e,t,n,i,a);if(o==false){o=await getFishBall_Ad_FishPond_finish(e,t,n,i,a);if(o==false){o=await getFishBall_Ad_FishPond_finish(e,t,n,i,a)}}if(o==true){let e=await getFishBall_Ad_FishPond_Bubble(t)}})}initPkg_Sign_Ad_Yuba()}}}}})}function getFishBall_Ad_FishPond_info(e,t,n){return new Promise(n=>{GM_xmlhttpRequest({method:"POST",url:"https://rtbapi.douyucdn.cn/japi/sign/app/getinfo?token="+t+"&mdid=phone"+"&client_sys=android",data:"posid="+e+"&roomid="+rid+"&cate1=1&cate2=1&chanid=30"+'&device={"nt":"1"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data.length==0){n(false);return}let e=t.data[0].mid;let o=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:o})}}})})}function getFishBall_Ad_FishPond_start(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/start?client_sys=android",data:"token="+t+"&uid="+n+"&roomId="+rid+"&posCode="+e+"&clientType=1&creativeId="+o+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){a(true)}}})})}function getFishBall_Ad_FishPond_finish(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/finish?client_sys=android",data:"uid="+n+"&clientType=1&posCode="+e+"&creativeId="+o+"&roomId="+rid+"&token="+t+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){a(true)}}})})}function getFishBall_Ad_FishPond_Bubble(e){return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/tasksys/ytxb/getPrize?client_sys=android",data:"token="+e+"&id=182",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let n=e.response;if(n.error=="0"){showMessage("【鱼塘鱼丸】"+n.data.msg,"success")}else{showMessage("【鱼塘鱼丸】"+n.msg,"error")}t(n.error)}})})}function initPkg_Sign_Ad_Guess(){getFishBall_Ad_Guess()}async function getFishBall_Ad_Guess(){let e=await getFishBall_Ad_Guess_chance();if(e>0){for(let t=0;t{if(await e.finish()==true){showMessage("【预言鱼丸】成功领取40鱼丸","success")}await sleep(1e3)})}}}else{}initPkg_AdVideo_Xiaoxiaole()}function getFishBall_Ad_Guess_chance(){return new Promise(e=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/chance?client_sys=android",data:"token="+dyToken+"&uid="+getUID()+"&posCode=1114337&clientType=1",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:async function(t){let n=t.response;if(n.error=="0"){let t=n.data.chanceNum;e(t)}else{e(0)}}})})}function initPkg_Sign_Ad_Search(){getFishBall_Ad_Search()}function getFishBall_Ad_Search(){GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/chance?client_sys=android",data:"token="+dyToken+"&uid="+getUID()+"&posCode=1124343&clientType=1",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:async function(e){let t=e.response;if(t.error=="0"){let e=t.data.chanceNum;if(e>0){for(let t=0;t{let o=await getFishBall_Ad_Search_finish(e,t,n,i,a);if(o==true){showMessage("【搜索鱼丸】成功领取40鱼丸","success");await sleep(1e3)}})}}}else{initPkg_Sign_Ad_Guess();return}}initPkg_Sign_Ad_Guess()}})}function getFishBall_Ad_Search_info(e,t,n){return new Promise(n=>{GM_xmlhttpRequest({method:"POST",url:"https://rtbapi.douyucdn.cn/japi/sign/app/getinfo?token="+t+"&mdid=phone"+"&client_sys=android",data:"posid="+e+"&roomid="+rid+"&cate1=1&cate2=1&chanid=30"+'&device={"nt":"1"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data.length==0){n(false);return}let e=t.data[0].mid;let o=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:o})}}})})}function getFishBall_Ad_Search_start(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/start?client_sys=android",data:"token="+t+"&uid="+n+"&roomId="+rid+"&posCode="+e+"&clientType=1&creativeId="+o+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){a(true)}}})})}function getFishBall_Ad_Search_finish(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/finish?client_sys=android",data:"uid="+n+"&clientType=1&posCode="+e+"&creativeId="+o+"&roomId="+rid+"&token="+t+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data=="1"){a(true)}}}})})}function initPkg_Sign_Ad_Yuba(){getFishBall_Ad_Yuba()}function getFishBall_Ad_Yuba(){GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/chance?client_sys=android",data:"token="+dyToken+"&uid="+getUID()+"&posCode=1042329&clientType=1",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:async function(e){let t=e.response;if(t.error=="0"){let e=t.data.chanceNum;if(e>0){for(let t=0;t{let o=await getFishBall_Ad_Yuba_finish(e,t,n,i,a);if(o==true){showMessage("【鱼吧鱼丸】成功领取40鱼丸","success");await sleep(1e3)}})}}}else{initPkg_Sign_Ad_Search();return}}initPkg_Sign_Ad_Search()}})}function getFishBall_Ad_Yuba_info(e,t,n){return new Promise(n=>{GM_xmlhttpRequest({method:"POST",url:"https://rtbapi.douyucdn.cn/japi/sign/app/getinfo?token="+t+"&mdid=phone"+"&client_sys=android",data:"posid="+e+"&roomid="+rid+"&cate1=1&cate2=1&chanid=30"+'&device={"nt":"1"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data.length==0){n(false);return}let e=t.data[0].mid;let o=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:o})}}})})}function getFishBall_Ad_Yuba_start(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/start?client_sys=android",data:"token="+t+"&uid="+n+"&roomId="+rid+"&posCode="+e+"&clientType=1&creativeId="+o+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){a(true)}}})})}function getFishBall_Ad_Yuba_finish(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/finish?client_sys=android",data:"uid="+n+"&clientType=1&posCode="+e+"&creativeId="+o+"&roomId="+rid+"&token="+t+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data=="1"){a(true)}}}})})}function initPkg_AudioLine(){initPkg_AudioLine_Dom();initPkg_AudioLine_Func()}function initPkg_AudioLine_Dom(){AudioLine_insertIcon()}function AudioLine_insertIcon(){let e=document.createElement("div");e.className="Title-blockInline";e.id="ex-audio-line";e.innerHTML='
切换音频线路
';let t=document.getElementsByClassName("Title-col")[4];if(t.childNodes.length>1){t.insertBefore(e,t.childNodes[1])}}function initPkg_AudioLine_Func(){document.getElementById("ex-audio-line").addEventListener("click",function(){document.getElementsByClassName("pause-c594e8")[0].click();getRealLive_Douyu(rid,true,false,"1015",e=>{createNewAudio_Douyu(videoPlayerArr.length,rid)})})}let timeout;function initPkg_BagInfo(){initPkg_BagInfo_Func()}function initPkg_BagInfo_Func(){document.getElementsByClassName("BackpackButton")[0].addEventListener("click",function(){clearTimeout(timeout);timeout=setTimeout(()=>{if(document.getElementsByClassName("Backpack JS_Backpack").length>0){getBagGifts(rid,e=>{let t=e.data.list.length;if(t>0){let n=0;let o=0;for(let i=0;i{if(confirm("确认清空?")!=true){return}showMessage("【清空背包】执行中...","info");getBagGifts(rid,e=>{clearBagGifts(e,rid)})})}})}},500)})}async function clearBagGifts(e,t){let n=e.data.list.length;if(n>0){for(let o=0;o0){await sleep(100).then(()=>{sendGift_bag(n,i,t)})}else{for(let e=0;e{sendGift_bag(n,1,t)})}}}showMessage("【清空背包】执行完毕!","success")}else{showMessage("背包礼物为空","error")}}let barrageColorArr=[];let barrageArr=[];let barrageColorLength=0;let barrageLength=0;let bloopTimer;let barrageOffset=0;let barrageColorOffset=0;let isChangeColor=true;let isMatch=false;let bloopStopTimer;function initPkg_BarrageLoop(){initPkg_BarrageLoop_Dom();initPkg_BarrageLoop_Func();initPkg_BarrageLoop_Set()}function BarrageLoop_insertModal(){let e="";let t=document.createElement("div");t.className="bloop";e+='
';e+='
';e+='';e+='
~
';e+='
';e+='
';e+='
';t.innerHTML=e;let n=document.getElementsByClassName("layout-Player-chat")[0];n.insertBefore(t,n.childNodes[0])}function BarrageLoop_insertIcon(){let e=document.createElement("div");e.className="bloop-icon";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function getBarrageColorArr(){barrageColorArr.length=0;barrageColorLength=0;let e=document.getElementsByClassName("FansBarrageSwitcher");let t=document.getElementsByClassName("NobleBarrageSwitcher is-active");let n=false;if(t.length>0){n=true}if(e.length==0){isMatch=true;let t=document.getElementsByClassName("MatchSystemFansBarrageSwitcher")[0];if(t!=undefined){t.click();e=document.getElementsByClassName("MatchSystemFansBarrageColor-item")}else{isMatch=false}}else{e[0].click();e=document.getElementsByClassName("FansBarrageColor-item");isMatch=false}for(let t=0;tbarrageColorLength){barrageColorOffset=0}}if(document.getElementById("bloop__checkbox_tiangou").checked==true){let e=await getBarrageTxt_Tiangou();e=String(e).replace(/他/g,"她");sendBarrage(e)}else{sendBarrage(barrageArr[barrageOffset]);barrageOffset++;if(barrageOffset>barrageLength){barrageOffset=0}}bloopTimer=setTimeout(doLoopBarrage,getSpeed())}function initPkg_BarrageLoop_Func(){document.getElementsByClassName("bloop-icon")[0].addEventListener("click",function(){let e=document.getElementsByClassName("bloop")[0];if(e.style.display!="block"){e.style.display="block";if(document.getElementsByClassName("extool")[0].style.display=="block"){document.getElementsByClassName("extool")[0].style.display="none"}if(document.getElementsByClassName("livetool")[0].style.display=="block"){document.getElementsByClassName("livetool")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("bloop__checkbox_changeColor").addEventListener("click",function(){isChangeColor=document.getElementById("bloop__checkbox_changeColor").checked});document.getElementById("bloop__checkbox_startSend").addEventListener("click",function(){let e=document.getElementById("bloop__checkbox_startSend").checked;if(e==true){barrageOffset=0;barrageColorOffset=0;getBarrageArr();getBarrageColorArr();saveData_BarrageLoop();bloopTimer=setTimeout(doLoopBarrage,getSpeed());bloopStopTimer=setTimeout(()=>{document.getElementById("bloop__checkbox_startSend").checked=false;clearTimeout(bloopTimer)},getStopTime())}else{clearTimeout(bloopTimer);clearTimeout(bloopStopTimer)}});document.getElementById("bloop__checkbox_tiangou").addEventListener("click",function(){let e=document.getElementById("bloop__checkbox_tiangou").checked;if(e==true){document.getElementById("bloop__textarea").disabled=true}else{document.getElementById("bloop__textarea").disabled=false}saveData_BarrageLoop()})}function initPkg_BarrageLoop_Dom(){BarrageLoop_insertModal();BarrageLoop_insertIcon()}function initPkg_BarrageLoop_Set(){let e=localStorage.getItem("ExSave_BarrageLoop");if(e!=null){let t=JSON.parse(e);if("speed1"in t==false){t.speed1=2e3}if("speed2"in t==false){t.speed2=3e3}if("stopTime"in t==false){t.stopTime=5}if("isTiangouMode"in t==false){t.isTiangouMode=false}document.getElementById("bloop__textarea").value=t.text;document.getElementById("bloop__checkbox_changeColor").checked=t.isChangeColor;isChangeColor=Boolean(t.isChangeColor);document.getElementById("bloop__text_speed1").value=t.speed1;document.getElementById("bloop__text_speed2").value=t.speed2;document.getElementById("bloop__text_stoptime").value=t.stopTime;if(t.isTiangouMode==true){document.getElementById("bloop__checkbox_tiangou").checked=t.isTiangouMode;document.getElementById("bloop__textarea").disabled=true}}}function getBarrageTxt_Tiangou(){return new Promise(e=>{GM_xmlhttpRequest({method:"GET",url:"https://chp.shadiao.app/api.php",responseType:"text",onload:function(t){let n=t.response;if(n!=""){e(n)}}})})}function initPkg_BarragePanel(){let e=setInterval(()=>{if(document.getElementsByClassName("danmuTips-1ee820").length>0){clearInterval(e);document.getElementsByClassName("danmuTips-1ee820")[0].parentElement.id="Ex_BarragePanel";setBarragePanelCallBack()}},1500);initPkg_BarragePanel_Tip()}function setBarragePanelCallBack(){let e=new DomHook("#Ex_BarragePanel",true,e=>{let t=false;if(e.length>0){for(let n=0;n0){let e=t[0];if("getElementsByClassName"in e==false){return}let n=e.getElementsByClassName("danmuAuthor-3d7b4a");let o="";if(n.length>0){o=n[0].innerText;setUserFansMedal(n[0],o);setMuteButton(e);setSearchBarrageButton(e);setMuteTimeButton(e);setReplyBarrageButton(e);setBarrgePanelFunc(e,o)}}}else{let e=document.getElementsByClassName("barragePanel__funcPanel");if(e.length>0){e[0].remove()}let t=document.getElementsByClassName("danmudiv-32f498")[0];if(t==undefined){return}let n=t.getElementsByClassName("danmuAuthor-3d7b4a");let o="";if(n.length>0){o=n[0].innerText;setUserFansMedal(n[0],o);setMuteButton(t);setSearchBarrageButton(t);setMuteTimeButton(t);setReplyBarrageButton(t);setBarrgePanelFunc(t,o)}}}})}function getUserFansMedal(e){let t=false;let n=document.getElementsByClassName("Barrage-listItem");for(let o=n.length-1;o>=0;o--){let i=n[o].lastElementChild;if(i!=null&&i!=undefined&&i.innerHTML.indexOf(e)!=-1){let e=i.getElementsByClassName("FansMedal");if(e.length>0){t=e[0].cloneNode(true);break}}}return t}function getUserLevelText(e){let t="";let n=document.getElementsByClassName("Barrage-listItem");for(let o=n.length-1;o>=0;o--){let i=n[o].lastElementChild;if(i!=null&&i!=undefined&&i.innerHTML.indexOf(e)!=-1){let e=i.getElementsByClassName("Barrage-icon--roomAdmin");if(e.length>0){t+="【房管】"}let n=i.getElementsByClassName("Barrage-nobleImg");if(n.length>0){t+=`【${n[0].title}】`}let o=i.getElementsByClassName("UserLevel");if(o.length>0){t+=o[0].title}break}}return t}function setUserFansMedal(e,t){if(document.getElementById("barragePanel__id")==undefined){e.removeChild(e.childNodes[0]);let n=getUserLevelText(t);let o=document.createElement("span");o.innerHTML=t;o.title=n;o.id="barragePanel__id";e.insertBefore(o,e.childNodes[0])}let n=getUserFansMedal(t);if(n!=false){a=document.createElement("div");a.style="display:inline-block";a.appendChild(n);e.insertBefore(a,e.childNodes[0])}}function setMuteButton(e){if(document.getElementById("barragePanel__mute")!=null){return}let t=document.createElement("div");t.className="ReportButton-41fa9e";t.id="barragePanel__mute";t.innerText="禁言";t.style="margin-top:120px;z-index:5";e.insertBefore(t,e.childNodes[0])}function setSearchBarrageButton(e){if(document.getElementById("barragePanel__search")!=null){return}let t=document.createElement("div");t.className="HideButton-d22988";t.innerText="查弹幕";t.id="barragePanel__search";t.style="margin-top:120px;z-index:5";e.insertBefore(t,e.childNodes[0])}function setReplyBarrageButton(e){if(document.getElementById("barragePanel__reply")!=null){return}let t=document.createElement("div");t.className="HideButton-d22988";t.innerText="回复";t.id="barragePanel__reply";t.style="margin-top:90px;z-index:5";e.insertBefore(t,e.childNodes[0])}function setMuteTimeButton(e){if(document.getElementsByClassName("barragePanel__muteTime").length>0){return}let t=document.createElement("div");t.className="barragePanel__muteTime";t.innerHTML=`\n \n `;e.insertBefore(t,e.childNodes[0])}function setBarrgePanelFunc(e,t){document.getElementById("barragePanel__reply").onclick=(()=>{let n=e.getElementsByClassName("danmuContent-25f266")[0].innerText;if(n!=""){document.getElementsByClassName("ChatSend-txt")[0].value=`@${t}:${n}`}});document.getElementById("barragePanel__mute").onclick=(async()=>{let e=document.getElementById("barragePanel__muteSelect").value||"1";let n=await addMuteUser(rid,t,e);if(n.msg=="添加成功"){showMessage(`【禁言】${t}已被禁言${e}分钟`,"success")}else{showMessage(n.msg,"error")}});document.getElementById("barragePanel__search").onclick=(async()=>{insertBarragePanel_SearchBarrage_Dom(e);barragePanelLastName=t;let n=await getUserRecentBarrage(t);let o=JSON.parse(n.data);let i=document.getElementById("barragePanel__searchPanel");if(o.msg=="成功"){if("danmuVoList"in o.data==false){return}for(let e=0;e\n
\n

${t.time}

\n

\n ${t.anchorName}:
\n ${t.txt}\n

\n
\n `;if(i!=null||i!=undefined){i.appendChild(n)}}let e=document.createElement("li");e.className="layui-timeline-item";e.innerHTML=`\n \n
\n
\n
\n `;if(i!=null||i!=undefined){i.appendChild(e)}}else{showMessage("【查弹幕】查询失败","error")}})}function insertBarragePanel_SearchBarrage_Dom(e){let t=parseInt(e.style.marginLeft);let n="-237px";if(t>237){n="-237px"}else{n="237px"}let o=document.createElement("div");o.className="barragePanel__funcPanel";o.style=`margin-left:${n}`;o.innerHTML=`\n
    \n \n
\n `;e.insertBefore(o,e.childNodes[0])}function getUserRecentBarrage(e){return new Promise(t=>{GM_xmlhttpRequest({method:"GET",url:"https://dyapi.fz996.com/api/Wx/GetDataBarrage?keyword="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let n=e.response;t(n)}})})}function initPkg_BarragePanel_Tip(){setBarragePanelTipCallBack()}function setBarragePanelTipCallBack(){let e=new DomHook("#comment-dzjy-container",false,e=>{if(e.length<=0){return}if(e[0].addedNodes.length<=0){return}let t=e[0].addedNodes[0];renderBarragePanelTip(t);setBarragePanelTipFunc()})}function renderBarragePanelTip(e){let t=document.createElement("div");t.style.display="inline-block";document.getElementsByClassName("btnscontainer-4e2ed0")[0].insertBefore(t,e.childNodes[0]);t=document.createElement("p");t.className="sugun-e3fbf6";t.innerText="|";e.appendChild(t);t=document.createElement("div");t.className="labelfisrt-407af4";t.id="barrage-panel-tip__+1";t.innerText="+1";e.appendChild(t)}function setBarragePanelTipFunc(){document.getElementById("barrage-panel-tip__+1").onclick=(()=>{let e=document.getElementById("comment-higher-container").innerText;sendBarrage(e)})}let barrageMemoryArr=[];let barrageMemoryIndex=0;let prevTextareaPosition=0;function initPkg_ChatMemory(){initPkg_ChatMemory_Func()}function initPkg_ChatMemory_Func(){document.getElementsByClassName("ChatSend-txt")[0].addEventListener("keydown",e=>{let t=e.target;if(e.keyCode==38){if(getTextareaPosition(t)==0){barrageMemoryIndex=barrageMemoryIndex>0?barrageMemoryIndex-1:barrageMemoryIndex;chatMemory_setBarrage()}}else if(e.keyCode==40){if(getTextareaPosition(t)==t.value.length){barrageMemoryIndex=barrageMemoryIndex{chatMemory_pushBarrage(getBarrageValue())})}function chatMemory_pushBarrage(e){barrageMemoryIndex=barrageMemoryArr.push(e)}function chatMemory_setBarrage(){if(barrageMemoryArr[barrageMemoryIndex]==undefined){return}setBarrageValue(barrageMemoryArr[barrageMemoryIndex]||"")}function getBarrageValue(){let e=document.getElementsByClassName("ChatSend-txt")[0];if(e!=undefined&&e!=null){return e.value}return""}function setBarrageValue(e){let t=document.getElementsByClassName("ChatSend-txt")[0];if(t!=undefined&&t!=null){t.value=e}}function initPkg_ChatTools(){initPkg_ChatMemory()}function initPkg_Console(){console_watermark_douyEx()}function console_watermark_douyEx(){return}function initPkg_CopyRealLive(){initPkg_CopyRealLive_Dom();initPkg_CopyRealLive_Func()}function initPkg_CopyRealLive_Dom(){CopyRealLive_insertIcon()}function CopyRealLive_insertIcon(){let e=document.createElement("div");e.className="Title-blockInline";e.id="copy-real-live";e.innerHTML='
复制直播流
';let t=document.getElementsByClassName("Title-col")[4];if(t.childNodes.length>1){t.insertBefore(e,t.childNodes[1])}}function initPkg_CopyRealLive_Func(){document.getElementById("copy-real-live").addEventListener("click",function(){getRealLive_Douyu(rid,true,false,"1015",e=>{if(e=="None"){showMessage("房间未开播或其他错误","error")}else{GM_setClipboard(String(e).replace("https","http"));showMessage("复制成功","success")}})});document.getElementsByClassName("Title-header")[0].addEventListener("click",function(){getRealLive_Douyu(rid,true,false,"1015",e=>{if(e=="None"){showMessage("房间未开播或其他错误","error")}else{GM_setClipboard(String(e).replace("https","http"));showMessage("复制成功","success")}})});let e=document.getElementsByClassName("RecommendViewTit-04ebd8");let t="";if(e.length>0){t=e[0].innerText+"\n"}document.getElementsByClassName("Title-header")[0].style.cursor="pointer";document.getElementsByClassName("Title-header")[0].title=t+"点击复制直播流"}function initPkg_ExIcon(){initPkg_ExIcon_insertDom();initPkg_ExIcon_Func()}function initPkg_ExIcon_insertDom(){let e=document.createElement("div");e.className="ex-icon";e.innerHTML='';let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_ExIcon_Func(){document.getElementsByClassName("ex-icon")[0].addEventListener("click",showExPanel)}function ExIcon_showTip(e){let t=document.getElementById("ex-icon__tip");if(e==true){t.style.display="block"}else{t.style.display="none"}}function initPkg_ExpandTool(){initPkg_ExpandTool_Dom();initPkg_ExpandTool_Func();initPkg_ExpandTool_Module()}function initPkg_ExpandTool_Module(){initPkg_ExpandTool_Treasure();initPkg_ExpandTool_Gold();initPkg_ExpandTool_RedPacket_Room();initPkg_ExpandTool_ClearBag();initPkg_ExpandTool_SendGift();initPkg_ExpandTool_BarrageSize()}function initPkg_ExpandTool_Dom(){ExpandTool_insertModal();ExpandTool_insertIcon()}function ExpandTool_insertModal(){let e=document.createElement("div");e.className="extool";let t=document.getElementsByClassName("layout-Player-chat")[0];t.insertBefore(e,t.childNodes[0])}function ExpandTool_insertIcon(){let e=document.createElement("div");e.className="extool-icon";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_ExpandTool_Func(){document.getElementsByClassName("extool-icon")[0].addEventListener("click",function(){let e=document.getElementsByClassName("extool")[0];if(e.style.display!="block"){e.style.display="block";if(document.getElementsByClassName("bloop")[0].style.display=="block"){document.getElementsByClassName("bloop")[0].style.display="none"}if(document.getElementsByClassName("livetool")[0].style.display=="block"){document.getElementsByClassName("livetool")[0].style.display="none"}}else{e.style.display="none"}})}function initPkg_ExpandTool_BarrageSize(){ExpandTool_BarrageSize_insertDom();ExpandTool_BarrageSize_insertFunc();initPkg_ExpandTool_BarrageSize_Set();setBarrageSize(getBarrageSize())}function ExpandTool_BarrageSize_insertDom(){let e=document.createElement("div");e.className="extool__bsize";e.innerHTML='';let t=document.getElementsByClassName("extool")[0];t.insertBefore(e,t.childNodes[0])}function setBarrageSize(e){cancelBarrageSize();StyleHook_set("Ex_Style_DanmuSize",".danmuItem-31f924{font-size:"+e+"px !important;}")}function cancelBarrageSize(){StyleHook_remove("Ex_Style_DanmuSize")}function getBarrageSize(){return document.getElementById("extool__bsize_value").value}function ExpandTool_BarrageSize_insertFunc(){document.getElementById("extool__bsize_btn").addEventListener("click",function(){setBarrageSize(getBarrageSize());saveData_BarrageSize()})}function saveData_BarrageSize(){let e={size:getBarrageSize()};localStorage.setItem("ExSave_BarrageSize",JSON.stringify(e))}function initPkg_ExpandTool_BarrageSize_Set(){let e=localStorage.getItem("ExSave_BarrageSize");if(e!=null){let t=JSON.parse(e);document.getElementById("extool__bsize_value").value=t.size}}function initPkg_ExpandTool_ClearBag(){ExpandTool_ClearBag_insertDom();ExpandTool_ClearBag_insertFunc()}function ExpandTool_ClearBag_insertDom(){let e="";e+='礼物id示例
';e+='';e+='';e+='';let t=document.createElement("div");t.className="extool__clearbag";t.innerHTML=e;let n=document.getElementsByClassName("extool")[0];n.insertBefore(t,n.childNodes[0])}function ExpandTool_ClearBag_insertFunc(){document.getElementById("extool__clearbag_sendbtn").addEventListener("click",async function(){if(confirm("确认送出?")!=true){return}let e=document.getElementById("extool__clearbag_id").value;let t=Number(document.getElementById("extool__clearbag_cnt").value);showMessage("【背包送礼】执行中...","info");for(let n=0;n{sendGift_bag(e,1,rid).then(e=>{if(e.msg!="success"){showMessage("【背包送礼】"+rid+"赠送失败 "+e.msg,"error");console.log(rid,e)}}).catch(e=>{showMessage("【背包送礼】"+rid+"赠送失败","error");console.log(rid,e)})})}showMessage("【背包送礼】执行完毕!","success")});document.getElementById("extool__clearbag_showid").addEventListener("click",function(){getBagGifts(rid,e=>{let t=e.data.list.length;if(t>0){for(let n=0;n{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})}let user_name;let animationNum=0;let goldBarrageHook;let goldBarrageListHook;let goldGiftHook;function initPkg_ExpandTool_Gold(){ExpandTool_Gold_insertDom();ExpandTool_Gold_insertGiftDom();ExpandTool_Gold_insertFunc();ExpandTool_Gold_Set()}function ExpandTool_Gold_insertDom(){let e="";e+='';e+='';let t=document.createElement("div");t.className="extool__gold";t.innerHTML=e;let n=document.getElementsByClassName("extool")[0];n.insertBefore(t,n.childNodes[0])}function ExpandTool_Gold_insertGiftDom(){let e=document.createElement("div");e.className="ex_giftAnimation";let t=document.getElementsByClassName("Barrage-main")[0];t.insertBefore(e,t.childNodes[0])}function ExpandTool_Gold_insertFunc(){document.getElementById("extool__gold_start").addEventListener("click",async function(){let e=document.getElementById("extool__gold_start").checked;if(e==true){goldBarrageHook=new DomHook(".danmu-6e95c1",true,goldBarrage);goldBarrageListHook=new DomHook(".Barrage-list",true,goldBarrageList);goldFansMedal()}else{goldBarrageHook.closeHook();goldBarrageListHook.closeHook()}saveData_Gold()});document.getElementById("extool__goldGift_start").addEventListener("click",async function(){user_name=await getUserName();let e=document.getElementById("extool__goldGift_start").checked;if(e==true){goldGiftHook=new DomHook(".BarrageBanner",true,fansToSuperRocket)}else{goldGiftHook.closeHook()}saveData_GoldGift()})}function saveData_Gold(){let e=document.getElementById("extool__gold_start").checked;let t={isGold:e};localStorage.setItem("ExSave_Gold",JSON.stringify(t))}function saveData_GoldGift(){let e=document.getElementById("extool__goldGift_start").checked;let t={isGoldGift:e};localStorage.setItem("ExSave_GoldGift",JSON.stringify(t))}function ExpandTool_Gold_Set(){let e=localStorage.getItem("ExSave_Gold");if(e!=null){let t=JSON.parse(e);if(t.isGold==true){document.getElementById("extool__gold_start").click()}}e=localStorage.getItem("ExSave_GoldGift");if(e!=null){let t=JSON.parse(e);if(t.isGoldGift==true){document.getElementById("extool__goldGift_start").click()}}}function goldBarrageList(e){if(e.length==0){return}if(e[0].addedNodes.length==0){return}let t=e[0].addedNodes[0];let n=t.lastElementChild;if(n!=null&&n.innerHTML.indexOf("is-self")!=-1){let e=setTimeout(()=>{t.className="Barrage-listItem js-noblefloating-barrage";n.className="js-noblefloating-barragecont Barrage-notice--noble";n.setAttribute("style","background-color: #fff3df");let o=n.getElementsByClassName("Barrage-nickName")[0];o.setAttribute("class","Barrage-nickName is-self js-nick");let i=n.querySelector(".UserLevel");if(i!=null){i.className="UserLevel UserLevel--150";i.setAttribute("title","用户等级:150")}let a=n.querySelector(".RoomLevel");if(a!=null){a.className="RoomLevel RoomLevel--18";a.setAttribute("title","房间等级:18")}let l=t.querySelector(".FansMedal");if(l!=null){l.style="display:none;"}let s=document.getElementsByClassName("FansMedal-name")[0];let r=document.getElementsByClassName("FansRankList-item FansRankList-item--top")[0];if(s!=undefined&&r!=undefined){if(r.innerHTML.indexOf("background-image:")==-1){let e=document.createElement("div");let t=document.createElement("span");e.className="FansMedal level-50 js-fans-dysclick Barrage-icon";t.className="FansMedal-name js-fans-dysclick";t.innerHTML=s.innerText;e.appendChild(t);n.insertBefore(e,n.querySelector(".UserLevel"))}else{let e=document.createElement("div");e.className="FansMedal is-made js-fans-dysclick Barrage-icon";e.setAttribute("style",r.getElementsByClassName("FansMedal is-made")[0].getAttribute("style"));let t=document.createElement("span");t.className="FansMedal-name js-fans-dysclick";t.innerHTML=s.innerText;e.appendChild(t);n.insertBefore(e,n.querySelector(".UserLevel"))}}else{let e=document.createElement("div");e.className="FansMedal level-50 js-fans-dysclick Barrage-icon";e.setAttribute("data-rid","5189167");let t=document.createElement("span");t.className="FansMedal-name js-fans-dysclick";t.setAttribute("data-rid","5189167");t.innerHTML="歆崽";e.appendChild(t);n.insertBefore(e,n.querySelector(".UserLevel"))}let d=t.querySelector(".Barrage-nobleImg");if(d!=null){d.src="//res.douyucdn.cn/resource/2019/08/15/common/4e85776071ffbae2867bb9d116e9a43c.gif";d.title="幻神"}else{let e=document.createElement("span");let t=document.createElement("img");e.className="Barrage-icon Barrage-noble";t.className="Barrage-nobleImg";t.setAttribute("src","//res.douyucdn.cn/resource/2019/08/15/common/4e85776071ffbae2867bb9d116e9a43c.gif");t.setAttribute("title","幻神");e.appendChild(t);n.insertBefore(e,n.firstElementChild)}clearTimeout(e)},100)}}function goldFansMedal(){document.getElementsByClassName("FansMedalEnter-enterContent")[0].setAttribute("data-medal-level","50")}function goldBarrage(e){if(e.length==0){return}if(e[0].addedNodes.length==0){return}let t=e[0].addedNodes[0];if(t.className.indexOf("noble-bf13ad")==-1&&t.innerHTML.indexOf("border: 2px solid rgb(2, 255, 255)")!=-1){t.style.zIndex="30";t.className="danmuItem-31f924 noble-bf13ad";let e=document.createElement("img");e.className="super-noble-icon-9aacaf";e.setAttribute("src","https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h1_dcd226.png");e.setAttribute("style","margin-left: -57px; margin-top: -4px;");t.insertBefore(e,t.firstElementChild);let n=document.createElement("img");n.className="super-user-icon-574f31";let o=document.getElementsByClassName("Avatar is-circle")[0];if(o!=undefined){o=o.getElementsByTagName("img")[0].getAttribute("src");n.setAttribute("src",o.replace(new RegExp("_middle"),"_small"))}else{}t.insertBefore(n,t.firstElementChild);let i=t.getElementsByClassName("afterpic-8a2e13")[0];i.remove();let a=t.getElementsByClassName("text-879f3e")[0];a.className="super-text-0281ca";a.setAttribute("style","font: bold 23px SimHei, 'Microsoft JhengHei', Arial, Helvetica, sans-serif; color: rgb(255, 255, 255); background: url('https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h2_8e5e64.png'); height: 44px;");let l=document.createElement("div");l.setAttribute("class","afterpic-8a2e13");l.setAttribute("style","margin-top: 7px; margin-left: -1px;");a.appendChild(l);let s=document.createElement("img");s.className="super-tail-bffa58";s.setAttribute("src","https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h3_fd2e5b.png");t.appendChild(s)}}function fansToSuperRocket(e){if(e.length==0){return}if(e[0].addedNodes.length==0){return}let t=e[0].addedNodes[0];if(t.getElementsByClassName("Banner4gift-senderName")[0].title==user_name){let e=t.getElementsByClassName("Banner4gift-objectName")[0].title;if(e=="粉丝荧光棒"){t.className="Banner4gift Banner4gift--size2";t.getElementsByClassName("Banner4gift-bg")[0].src="https://gfs-op.douyucdn.cn/dygift/2019/03/15/6651f2de52dd359c7b553a77b9d00020.png";t.getElementsByClassName("Banner4gift-objectName")[0].title="超级火箭";t.getElementsByClassName("Banner4gift-objectName")[0].innerText="超级火箭";t.getElementsByClassName("Banner4gift-headerImg")[0].src="https://gfs-op.douyucdn.cn/dygift/2018/11/27/3adbb0c17d9886c1440d55c9711f4c79.gif";if(document.getElementsByClassName("ex_giftAnimation_exist").length>0){return}animationNum++;let e=document.createElement("div");let n="ex_giftAnimation_"+String(animationNum);e.id=n;e.className="ex_giftAnimation_exist";let o=document.getElementsByClassName("ex_giftAnimation")[0];o.appendChild(e);let i=new SVGA.Player("#"+n);let a=new SVGA.Parser("#"+n);a.load("https://gfs-op.douyucdn.cn/dygift/2018/11/27/6c6349672e662750ad5c019b240d57f2.svga",e=>{i.setVideoItem(e);i.startAnimation();setTimeout(()=>{i=null;a=null;document.getElementById(n).remove()},4e3)})}}}let redpackets_room_arr=[];let redpacket_room_timer;function initPkg_ExpandTool_RedPacket_Room(){ExpandTool_RedPacket_Room_insertDom();ExpandTool_RedPacket_Room_insertFunc();ExpandTool_RedPacket_Room_Set()}function ExpandTool_RedPacket_Room_insertDom(){let e="";e+='';let t=document.createElement("div");t.className="extool__redpacket_room";t.innerHTML=e;let n=document.getElementsByClassName("extool")[0];n.insertBefore(t,n.childNodes[0])}function ExpandTool_RedPacket_Room_insertFunc(){document.getElementById("extool__redpacekt_room_start").addEventListener("click",function(){verifyFans("5189167",6).then(e=>{if(e==true){let e=document.getElementById("extool__redpacekt_room_start").checked;if(e==true){redpacket_room_timer=setInterval(()=>{getRoomRedPacketsList(rid)},1100)}else{clearInterval(redpacket_room_timer)}saveData_RedPacket_Room()}else{document.getElementById("extool__redpacekt_room_start").checked=false;showMessage("本功能需拥有6级歆崽粉丝牌(5189167)才可使用","error")}})})}function getRoomRedPacketsList(e){fetch("https://www.douyu.com/japi/interactnc/web/propredpacket/getPrpList?type_id=1&room_id="+e,{method:"GET",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{return e.json()}).then(e=>{if(e.data.list.length>0){for(let t=0;t0){setTimeout(()=>{getRoomRedPacket(n);getRoomRedPacket(n);getRoomRedPacket(n);showMessage("【礼物红包】抢红包执行完毕!","success")},a)}else{getRoomRedPacket(n);getRoomRedPacket(n);getRoomRedPacket(n);showMessage("【礼物红包】抢红包执行完毕!","success")}}}}}).catch(e=>{console.log("请求失败!",e)})}function getRoomRedPacket(e){fetch("https://www.douyu.com/japi/interactnc/web/propredpacket/grab_prp",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"activityid="+e+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(t=>{if(t.data.isSuc==2){getRoomRedPacket(e)}})}function saveData_RedPacket_Room(){let e=document.getElementById("extool__redpacekt_room_start").checked;let t={isGetRedPacket:e};localStorage.setItem("ExSave_RedPacket_Room",JSON.stringify(t))}function ExpandTool_RedPacket_Room_Set(){let e=localStorage.getItem("ExSave_RedPacket_Room");if(e!=null){let t=JSON.parse(e);if(t.isGetRedPacket==true){verifyFans("5189167",6).then(e=>{if(e==true){document.getElementById("extool__redpacekt_room_start").click()}else{let e={isGetRedPacket:false};localStorage.setItem("ExSave_RedPacket_Room",JSON.stringify(e));showMessage("本功能需拥有6级歆崽粉丝牌(5189167)才可使用","error")}})}}}function initPkg_ExpandTool_SendGift(){ExpandTool_SendGift_insertDom();ExpandTool_SendGift_insertFunc()}function ExpandTool_SendGift_insertDom(){let e="";e+='礼物id示例
';e+='';e+='';e+='';e+='';let t=document.createElement("div");t.className="extool__sendgift";t.innerHTML=e;let n=document.getElementsByClassName("extool")[0];n.insertBefore(t,n.childNodes[0])}function ExpandTool_SendGift_insertFunc(){document.getElementById("extool__sendgift_btn").addEventListener("click",async()=>{if(confirm("确认送出?")!=true){return}let e=document.getElementById("extool__sendgift_id").value;let t=document.getElementById("extool__sendgift_cnt").value;let n=Number(document.getElementById("extool__sendgift_delay").value);let o=0;let i=0;for(let a=0;a{if(n.data!=null){if(n.msg!="鱼翅不足"){o=o+1;i=i+Number(n.data.priceType)}else{console.log("【送礼】"+e+n.msg)}}else{console.log("【送礼】"+e+n.msg)}if(a==Number(t)-1){showMessage("【送礼】赠送完毕!详细信息可以在F12控制台查看","success");console.log("【送礼】赠送完毕!详细信息可以在F12控制台查看")}}).catch(e=>{console.log("请求失败!",e)});if(n>0){await sleep(n)}}showMessage("【送礼】执行中...","info")})}function sendGift_any(e,t,n){return fetch("https://www.douyu.com/japi/gift/donate/mainsite/v1",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"giftId="+e+"&giftCount="+t+"&roomId="+n+"&bizExt=%7B%22yzxq%22%3A%7B%7D%7D"}).then(e=>{return e.json()})}var isGetTreasure=false;function initPkg_ExpandTool_Treasure(){ExpandTool_Treasure_insertDom();ExpandTool_Treasure_insertFunc();ExpandTool_Treasure_Set()}function ExpandTool_Treasure_insertDom(){let e="";e+='';e+='ms';e+='';let t=document.createElement("div");t.className="extool__treasure";t.innerHTML=e;let n=document.getElementsByClassName("extool")[0];n.insertBefore(t,n.childNodes[0])}function ExpandTool_Treasure_insertFunc(){document.getElementById("extool__treasure_start").addEventListener("click",function(){verifyFans("5189167",9).then(e=>{if(e==true){let e=document.getElementById("extool__treasure_start").checked;if(e==true){isGetTreasure=true;getTreasure_Existing()}else{isGetTreasure=false}saveData_Treasure()}else{document.getElementById("extool__treasure_start").checked=false;showMessage("本功能需拥有9级歆崽粉丝牌(5189167)才可使用","error")}})})}function saveData_Treasure(){isGetTreasure=document.getElementById("extool__treasure_start").checked;let e=document.getElementById("extool__treasure_delay").value;let t=document.getElementById("extool__treasure_skey").value;let n={isGetTreasure:isGetTreasure,treasureDelay:e,skey:t};localStorage.setItem("ExSave_Treasure",JSON.stringify(n))}function ExpandTool_Treasure_Set(){let e=localStorage.getItem("ExSave_Treasure");if(e!=null){let t=JSON.parse(e);if("treasureDelay"in t==true){document.getElementById("extool__treasure_delay").value=t.treasureDelay}else{document.getElementById("extool__treasure_delay").value="3200"}if("skey"in t==true){document.getElementById("extool__treasure_skey").value=t.skey}if(t.isGetTreasure==true){verifyFans("5189167",9).then(e=>{if(e==true){document.getElementById("extool__treasure_start").click()}else{let e={isGetTreasure:false};localStorage.setItem("ExSave_Treasure",JSON.stringify(e));showMessage("本功能需拥有9级歆崽粉丝牌(5189167)才可使用","error")}})}}}function getTreasureDelay(){let e=document.getElementById("extool__treasure_delay").value;return Number(e)}function getTreasureSkey(){let e=document.getElementById("extool__treasure_skey").value;return e}function getTreasure_Existing(){getTslist(e=>{if(e==null){return}let t=String(e.list).split("@S/");for(let e=0;e=0){a=a*1e3+getTreasureDelay();treasureNum++;setTimeout(()=>{getTreasure(rid,n,i,s)},a)}else{getTreasure(rid,n,i,s)}}})}function getTslist(e){unsafeWindow.socketProxy.socketStream.subscribe("tslist",e)}function initPkg_ExPanel(){initPkg_ExPanel_insertDom()}function initPkg_ExPanel_insertDom(){let e=document.createElement("div");e.className="ex-panel";e.innerHTML='
';let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_FansBadgeList(){setFansBadgeList()}function setFansBadgeList(){let e=(new Date).getTime();let t=document.querySelectorAll(".fans-badge-list tr");if(t.length<=1){return}for(let n=1;n=300?"font-weight:600;color:red;":"";let r=o.getElementsByTagName("td")[1];r.innerHTML+=`\n 已获取 ${l}
\n ${a}`}}function initPkg_FansContinue(){initPkg_FansContinue_Dom();initPkg_FansContinue_Func()}function initPkg_FansContinue_Dom(){FansContinue_insertIcon()}function FansContinue_insertIcon(){let e=document.createElement("div");e.className="fans-continue";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_FansContinue_Func(){document.getElementsByClassName("fans-continue")[0].addEventListener("click",function(){let e=prompt("每个直播间赠送几根荧光棒?","1");if(e==null){return}if(e==""){return}fetch("https://www.douyu.com/member/cp/getFansBadgeList",{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.text()}).then(async t=>{t=(new DOMParser).parseFromString(t,"text/html");let n=t.getElementsByClassName("fans-badge-list")[0].lastElementChild;let o=n.children.length;for(let t=0;t{sendGift_bag(268,Number(e),o).then(e=>{if(e.msg=="success"){showMessage("【续牌】"+o+"赠送荧光棒成功","success")}else{showMessage("【续牌】"+o+"赠送失败 "+e.msg,"error");console.log(o,e)}}).catch(e=>{showMessage("【续牌】"+o+"赠送失败","error");console.log(o,e)})})}}).catch(e=>{console.log("请求失败!",e)})})}function sendGift_bag(e,t,n){return fetch("https://www.douyu.com/japi/prop/donate/mainsite/v1",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"propId="+e+"&propCount="+t+"&roomId="+n+"&bizExt=%7B%22yzxq%22%3A%7B%7D%7D"}).then(e=>{return e.json()})}function initPkg_FirePower(){initPkg_FirePower_Dom();initPkg_FirePower_Func()}function initPkg_FirePower_Dom(){FirePower_insertIcon()}function FirePower_insertIcon(){let e=document.createElement("div");e.className="firepower";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_FirePower_Func(){document.getElementsByClassName("firepower")[0].addEventListener("click",function(){fetch("https://www.douyu.com/japi/firepower/apinc/activeTask/getRecRid",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},body:"token="+getCCN()}).then(e=>{return e.json()}).then(e=>{let t=e.data;window.location.href="https://www.douyu.com/"+t}).catch(e=>{console.log("请求失败!",e)})})}function initPkg_FishFood(){initPkg_FishFood_Dom();initPkg_FishFood_Func()}function initPkg_FishFood_Dom(){FishFood_insertIcon()}function FishFood_insertIcon(){let e=document.createElement("div");e.className="fish-food";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_FishFood_Func(){document.getElementsByClassName("fish-food")[0].addEventListener("click",function(){getFishFoodV2();fetch("https://www.douyu.com/japi/activepointnc/api/getActivePointInfo",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{return e.json()}).then(async e=>{let t=Math.floor(Number(e.data.userActivePoint)/Number(e.data.onceLotteryActivePoint));if(t==0){showMessage("【寻宝】"+"鱼粮不足","warning");return}t=Number(e.data.dailyMaxLotteryTimes)-Number(e.data.usedLotteryCount);if(t==0){showMessage("【寻宝】"+"今日寻宝次数已到达上限","warning");return}for(let e=0;e{fetch("https://www.douyu.com/japi/activepointnc/api/dolottery",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"rid="+rid+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(e=>{if(e.data!=null){if(Object.keys(e.data).length!=0){showMessage("【寻宝】"+e.data.msg,"success")}}else{showMessage("【寻宝】"+e.msg,"warning")}}).catch(e=>{console.log("请求失败!",e)})})}})})}function getFishFoodV2(){fetch("https://www.douyu.com/japi/activepointnc/apinc/seniorLotteryV2",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"ctn="+getCCN()}).then(e=>{return e.json()}).then(async e=>{if(e.data==null){return}let t=Number(e.data.leftChance);if(t==0){showMessage("【高级寻宝】"+"今日寻宝次数已到达上限","warning");return}if(Number(e.data.yuliang){fetch("https://www.douyu.com/japi/activepointnc/apinc/doSeniorLotteryV2",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"rid="+rid+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(e=>{if(e.data!=null){if(Object.keys(e.data).length!=0){showMessage("【高级寻宝】"+e.data.lotteryRes.data.msg,"success")}}else{showMessage("【高级寻宝】"+e.msg,"warning")}}).catch(e=>{console.log("请求失败!",e)})})}})}function initPkg_FishPond(){initPkg_FishPond_Dom();initPkg_FishPond_Func()}function initPkg_FishPond_Timer(){initPkg_FishPond_Bubble_Timer();initPkg_FishPond_Box_Timer();initPkg_FishPond_Task_Timer();initPkg_FishPond_RoomSign_Timer();initPkg_FishPond_Task2_Timer()}function initPkg_FishPond_Func(){}function initPkg_FishPond_Dom(){FishPond_insertIcon()}function FishPond_insertIcon(){}function getAllFishPond(){initPkg_FishPond_Bubble();initPkg_FishPond_Box();initPkg_FishPond_Task()}function FishPond_showTip(e){}let boxList=[];function initPkg_FishPond_Box(){getFishPond_Box()}function initPkg_FishPond_Box_Timer(){getFishPond_BoxList()}function getFishPond_Box(){if(boxList.length==0){return}let e=boxList.concat();for(let t=0;t{return e.json()}).then(e=>{let t="";for(let n=0;n{console.log("请求失败!",e)})}function getFishPond_BubbleList(){fetch("https://www.douyu.com/japi/tasksys/ytxb/bubble",{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{bubbleList.length=0;for(let t=0;t{console.log("请求失败!",e)})}let roomSignList=[];function initPkg_FishPond_RoomSign(){getFishPond_RoomSign()}function initPkg_FishPond_RoomSign_Timer(){getFishPond_RoomSignList()}function getFishPond_RoomSign(){fetch("https://www.douyu.com/japi/roomuserlevel/apinc/getPrize",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"rid="+rid+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(e=>{if(e.error=="0"){showMessage("【签到宝箱】领取结果:"+e.msg,"success")}}).catch(e=>{console.log("请求失败!",e)})}function getFishPond_RoomSignList(){fetch("https://www.douyu.com/japi/roomuserlevel/apinc/levelInfo?rid="+rid+"&clientType=0",{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{if(e.error=="0"){if(e.data.treasure.status=="1"){getFishPond_RoomSign()}}}).catch(e=>{console.log("请求失败!",e)})}let taskList=[];function initPkg_FishPond_Task(){getFishPond_Task()}function initPkg_FishPond_Task_Timer(){getFishPond_TaskList()}function getFishPond_Task(){fetch("https://www.douyu.com/japi/tasksys/ytxb/batchGetPrize",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"ids=1182%2C1183%2C1184%2C1185%2C1186"+"&rid="+rid}).then(e=>{return e.json()}).then(e=>{if(e.data!==null){for(let t=0;t{console.log("请求失败!",e)});if(taskList.length==0){return}let e=taskList.concat();for(let t=0;t{console.log("请求失败!",e)})}taskList.length=0}function getFishPond_TaskList(){taskList.length=0;getFishPond_TaskList_Day();getFishPond_TaskList_Week();getFishPond_TaskList_Ytzb()}function getFishPond_TaskList_Day(){fetch("https://www.douyu.com/japi/tasksys/ytxb/userStatusV2?cycleType=1&roomId="+rid,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{for(let t=0;t{console.log("请求失败!",e)})}function getFishPond_TaskList_Week(){fetch("https://www.douyu.com/japi/tasksys/ytxb/userStatusV2?cycleType=2&roomId="+rid,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{for(let t=0;t{console.log("请求失败!",e)})}function getFishPond_TaskList_Ytzb(){fetch("https://www.douyu.com/japi/tasksys/ytxb/userStatusV2?cycleType=25&roomId="+rid,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{for(let t=0;t{console.log("请求失败!",e)})}function initPkg_FishPond_Task2(){getFishPond_Task2()}function initPkg_FishPond_Task2_Timer(){getFishPond_Task2()}async function getFishPond_Task2(){let e=await getFishPond_Task2List();if(e.data==null){return}getFishPond_Task2Panel(e.data.panel);getFishPond_Task2Bubble(e.data.bubble)}function getFishPond_Task2List(){return new Promise(e=>{fetch("https://www.douyu.com/japi/fishpoolTask/w/apinc/taskList",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"rid="+rid+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(t=>{e(t)}).catch(e=>{console.log("请求失败!",e)})})}async function getFishPond_Task2Panel(e){for(let t=0;t{getFishPond_Task2GetPrize(e)})}}}}function getFishPond_Task2GetPrize(e){fetch("https://www.douyu.com/japi/fishpoolTask/w/apinc/getPrize",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"id="+e+"&rid="+rid+"&ctn="+getCCN()}).then(e=>{return e.json()}).then(e=>{if(e.error==0){showMessage("【高级鱼塘】"+e.data.msg,"success")}else{showMessage("【高级鱼塘】"+e.msg,"error")}}).catch(e=>{console.log("请求失败!",e)})}async function getFishPond_Task2Bubble(e){for(let t=0;t{getFishPond_Task2GetPrize(e)})}}}let followListHook;function initPkg_FollowList(){let e=setInterval(()=>{if(typeof document.getElementsByClassName("DropPane-icon Follow-icon")[0]!="undefined"){followListHook=new DomHook(".Header-follow-content",false,handleFollowList);clearInterval(e)}},1e3)}function handleFollowList(e){let t=document.getElementsByClassName("Header-follow-tab is-active")[0].innerText;if(t=="特别关注"){return}let n=document.getElementsByClassName("Header-follow-listWrap");if(n.length==0){return}n[0].style.marginTop="12px";document.getElementsByClassName("Header-follow-listBox")[0].style.display="none";setNewFollowList(n[0])}async function setNewFollowList(e){let t=await getFollowList();if(t.error!="0"){return}const n=10;let o=0;let i=`
长按弹出同屏播放
`;let a=Math.floor(Date.now()/1e3);for(let e=0;e
${l.nickname}

${l.online}${l.room_name}

${l.nickname}已播${formatSeconds(a-Number(l.show_time))}

`;o++}if(o>=n){break}}e.innerHTML+=i;let l=document.getElementsByClassName("ExFollowListItem");for(let e=0;e{createNewVideo(videoPlayerArr.length,l[e].getAttribute("rid"),"Douyu");document.querySelector(".Follow .public-DropMenu").className="public-DropMenu"});t.click(()=>{openPage("https://www.douyu.com/"+l[e].getAttribute("rid"),true)})}}function getFollowList(){return new Promise(e=>{fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/list?sort=1&cid1=0",{method:"GET",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{return e.json()}).then(t=>{e(t)})})}let isEnterOn=false;let enterWordList={};function initPkg_LiveTool_Enter(){LiveTool_Enter_insertDom();LiveTool_Enter_insertFunc();initPkg_Enter_Set()}function LiveTool_Enter_insertDom(){let e=document.createElement("div");e.className="livetool__cell";let t=`\n
\n 进场欢迎\n
\n
\n
\n \n \n
\n
\n `;let n=`\n
\n \n \n \n
\n \n \n
\n
\n `;e.innerHTML=t+n;let o=document.getElementsByClassName("livetool")[0];o.insertBefore(e,o.childNodes[0])}function LiveTool_Enter_insertFunc(){document.getElementById("enter__switch").addEventListener("click",()=>{let e=document.getElementById("enter__switch").checked;if(e==true){isEnterOn=true}else{isEnterOn=false}saveData_isEnter()});document.getElementById("enter__title").addEventListener("click",()=>{let e=document.getElementsByClassName("enter__panel")[0];if(e.style.display!="block"){e.style.display="block";if(rid!=="5189167"){if(document.getElementsByClassName("mute__panel")[0].style.display=="block"){document.getElementsByClassName("mute__panel")[0].style.display="none"}}if(document.getElementsByClassName("reply__panel")[0].style.display=="block"){document.getElementsByClassName("reply__panel")[0].style.display="none"}if(document.getElementsByClassName("gift__panel")[0].style.display=="block"){document.getElementsByClassName("gift__panel")[0].style.display="none"}if(document.getElementsByClassName("vote__panel")[0].style.display=="block"){document.getElementsByClassName("vote__panel")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("enter__select").onclick=function(){if(this.options.length==0){return}let e=this.options[this.selectedIndex].text;let t=enterWordList[e].enter;document.getElementById("enter__word").value=e;document.getElementById("enter__level").value=t;localStorage.setItem("ExSave_LastEnterWord",e)};document.getElementById("enter__add").addEventListener("click",()=>{let e=document.getElementById("enter__select");let t=document.getElementById("enter__word").value;let n=document.getElementById("enter__level").value;if(t==""){return}if(n==""){return}enterWordList[t]={enter:Number(n)};e.options.add(new Option(t,""));saveData_Enter()});document.getElementById("enter__del").addEventListener("click",()=>{let e=document.getElementById("enter__select");let t=e.options[e.selectedIndex].text;delete enterWordList[t];e.options.remove(e.selectedIndex);saveData_Enter()})}function saveData_Enter(){let e=enterWordList;localStorage.setItem("ExSave_Enter",JSON.stringify(e))}function saveData_isEnter(){let e=[];let t=localStorage.getItem("ExSave_isEnter");if(t!=null){let n=JSON.parse(t);if("rooms"in n==true){e=n.rooms}}let n=e.indexOf(rid);if(isEnterOn==true){if(n==-1){e.push(rid)}}else{e.splice(n,1)}let o={rooms:e};localStorage.setItem("ExSave_isEnter",JSON.stringify(o))}function initPkg_Enter_Set(){let e=localStorage.getItem("ExSave_Enter");if(e==""){return}let t=document.getElementById("enter__select");if(e!=null){let n=JSON.parse(e);enterWordList=n;for(let e in n){if(n.hasOwnProperty(e)){t.options.add(new Option(e,""))}}}e=localStorage.getItem("ExSave_LastEnterWord");if(e!=null){let n=0;for(const o in enterWordList){if(o==e){t.selectedIndex=n;let o=enterWordList[e].enter;document.getElementById("enter__word").value=e;document.getElementById("enter__level").value=o;break}n++}}e=localStorage.getItem("ExSave_isEnter");if(e!=null){let t=JSON.parse(e);let n=[];if("rooms"in t==true){n=t.rooms}if(n.indexOf(rid)==-1){isEnterOn=false}else{isEnterOn=true}document.getElementById("enter__switch").checked=isEnterOn}else{isEnterOn=false;document.getElementById("enter__switch").checked=isEnterOn}}function initPkg_LiveTool_Enter_Handle(e){if(isEnterOn==false){return}if(getType(e)=="uenter"){let t=getStrMiddle(e,"uid@=","/");if(t==my_uid){return}let n=getStrMiddle(e,"nn@=","/");let o=getStrMiddle(e,"level@=","/");let i=document.getElementById("enter__select");let a=i.options[i.selectedIndex].text;let l=enterWordList[a].enter;if(Number(o)/g,n);sendBarrage(a)}}let isGiftOn=false;let giftWordList={};function initPkg_LiveTool_Gift(){LiveTool_Gift_insertDom();LiveTool_Gift_insertFunc();initPkg_Gift_Set()}function LiveTool_Gift_insertDom(){let e=document.createElement("div");e.className="livetool__cell";let t=`\n
\n 自动谢礼物\n
\n
\n
\n \n \n
\n
\n `;let n=`\n
\n \n \n \n
\n \n \n
\n
\n `;e.innerHTML=t+n;let o=document.getElementsByClassName("livetool")[0];o.insertBefore(e,o.childNodes[0])}function LiveTool_Gift_insertFunc(){document.getElementById("reply__show_gid").addEventListener("click",()=>{console.log(`\n背包礼物:http://webconf.douyucdn.cn/resource/common/prop_gift_list/prop_gift_config.json\n鱼翅礼物:http://open.douyucdn.cn/api/RoomApi/room/5189167\n`);showMessage("请按F12到控制台(console)查看礼物id","success")});document.getElementById("gift__switch").addEventListener("click",()=>{let e=document.getElementById("gift__switch").checked;if(e==true){isGiftOn=true}else{isGiftOn=false}saveData_isGift()});document.getElementById("gift__title").addEventListener("click",()=>{let e=document.getElementsByClassName("gift__panel")[0];if(e.style.display!="block"){e.style.display="block";if(rid!="5189167"){if(document.getElementsByClassName("mute__panel")[0].style.display=="block"){document.getElementsByClassName("mute__panel")[0].style.display="none"}}if(document.getElementsByClassName("enter__panel")[0].style.display=="block"){document.getElementsByClassName("enter__panel")[0].style.display="none"}if(document.getElementsByClassName("reply__panel")[0].style.display=="block"){document.getElementsByClassName("reply__panel")[0].style.display="none"}if(document.getElementsByClassName("vote__panel")[0].style.display=="block"){document.getElementsByClassName("vote__panel")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("gift__select").onclick=function(){if(this.options.length==0){return}let e=this.options[this.selectedIndex].text;let t=giftWordList[e].reply;document.getElementById("gift__giftId").value=e;document.getElementById("gift__reply").value=t};document.getElementById("gift__add").addEventListener("click",()=>{let e=document.getElementById("gift__select");let t=document.getElementById("gift__giftId").value;let n=document.getElementById("gift__reply").value;if(t==""){return}giftWordList[t]={reply:n};e.options.add(new Option(t,""));saveData_Gift()});document.getElementById("gift__del").addEventListener("click",()=>{let e=document.getElementById("gift__select");let t=e.options[e.selectedIndex].text;delete giftWordList[t];e.options.remove(e.selectedIndex);saveData_Gift()})}function saveData_Gift(){let e=giftWordList;localStorage.setItem("ExSave_Gift",JSON.stringify(e))}function saveData_isGift(){let e=[];let t=localStorage.getItem("ExSave_isGift");if(t!=null){let n=JSON.parse(t);if("rooms"in n==true){e=n.rooms}}let n=e.indexOf(rid);if(isGiftOn==true){if(n==-1){e.push(rid)}}else{e.splice(n,1)}let o={rooms:e};localStorage.setItem("ExSave_isGift",JSON.stringify(o))}function initPkg_Gift_Set(){let e=localStorage.getItem("ExSave_Gift");if(e!=null){let t=JSON.parse(e);giftWordList=t;let n=document.getElementById("gift__select");for(let e in t){if(t.hasOwnProperty(e)){n.options.add(new Option(e,""))}}}e=localStorage.getItem("ExSave_isGift");if(e!=null){let t=JSON.parse(e);let n=[];if("rooms"in t==true){n=t.rooms}if(n.indexOf(rid)==-1){isGiftOn=false}else{isGiftOn=true}document.getElementById("gift__switch").checked=isGiftOn}else{isGiftOn=false;document.getElementById("gift__switch").checked=isGiftOn}}function initPkg_LiveTool_Gift_Handle(e){if(isGiftOn==false){return}if(getType(e)=="dgb"){let t=getStrMiddle(e,"uid@=","/");if(t==my_uid){return}let n=getStrMiddle(e,"nn@=","/");let o=getStrMiddle(e,"gfid@=","/");let i=getStrMiddle(e,"gfcnt@=","/");for(let e in giftWordList){if(o==e){let t=giftWordList[e].reply;t=String(t).replace(//g,n);t=String(t).replace(//g,i);sendBarrage(t);break}}}}let timer_closing;let closingNum=0;function initPkg_LiveTool_LiveNotice(){}function initPkg_LiveTool_LiveNotice_Handle(e){if(getType(e)=="rss"){let t=getStrMiddle(e,"rid@=","/");let n=getStrMiddle(e,"ss@=","/");if(n=="1"){showMessageWindow("开播提醒","直播间:"+t+"开播了,点我签到",()=>{signRoom(t)})}else{clearInterval(timer_closing);timer_closing=setInterval(()=>{if(closingNum>30){clearInterval(timer_closing);closingNum=0}let e=document.getElementsByClassName("dy-ModalRadius-close-x");if(e.length>0){clearInterval(timer_closing);e[0].click()}closingNum++},500)}}}function getRoomAvatar(){fetch("https://www.douyu.com/betard/"+rid,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{roomAvatar=e.room.avatar.middle}).catch(e=>{console.log("请求失败!",e)})}function initPkg_LiveTool(){initPkg_LiveTool_Dom();initPkg_LiveTool_Module();initPkg_LiveTool_Func();initPkg_LiveTool_HandleFunc()}function initPkg_LiveTool_Dom(){LiveTool_insertModal();LiveTool_insertIcon()}function initPkg_LiveTool_Module(){initPkg_LiveTool_Vote();initPkg_LiveTool_Enter();initPkg_LiveTool_Mute();initPkg_LiveTool_Gift();initPkg_LiveTool_Reply();initPkg_LiveTool_Treasure()}function LiveTool_insertModal(){let e=document.createElement("div");e.className="livetool";let t=document.getElementsByClassName("layout-Player-chat")[0];t.insertBefore(e,t.childNodes[0])}function LiveTool_insertIcon(){let e=document.createElement("div");e.className="livetool-icon";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_LiveTool_Func(){document.getElementsByClassName("livetool-icon")[0].addEventListener("click",function(){let e=document.getElementsByClassName("livetool")[0];if(e.style.display!="block"){e.style.display="block";if(document.getElementsByClassName("bloop")[0].style.display=="block"){document.getElementsByClassName("bloop")[0].style.display="none"}if(document.getElementsByClassName("extool")[0].style.display=="block"){document.getElementsByClassName("extool")[0].style.display="none"}}else{e.style.display="none"}})}function initPkg_LiveTool_HandleFunc(){let e=new Ex_WebSocket_UnLogin(rid,e=>{initPkg_LiveTool_LiveNotice_Handle(e);initPkg_LiveTool_Mute_Handle(e);initPkg_LiveTool_Reply_Handle(e);initPkg_LiveTool_Gift_Handle(e);initPkg_LiveTool_Treasure_Handle(e);initPkg_LiveTool_Enter_Handle(e);initPkg_LiveTool_Vote_Handle(e)})}function getType(e){return getStrMiddle(e,"type@=","/")}function selectOptionByValue(e,t){let n=document.getElementById(e);for(let e=0;e\n 关键词禁言名单\n \n
\n
\n \n \n
\n
\n `;let n=`\n
\n \n \n \n \n
\n \n \n \n
\n
\n `;e.innerHTML=t+n;let o=document.getElementsByClassName("livetool")[0];o.insertBefore(e,o.childNodes[0])}function LiveTool_Mute_insertFunc(){document.getElementById("mute__idlist").addEventListener("click",()=>{if(muteIdListShow.length==0){showMessage("暂无禁言名单","warning");return}console.log("【禁言名单】");for(let e=0;e{if(muteIdListShow.length==0){showMessage("暂无禁言名单","warning");return}if(confirm("是否解禁名单上所有的id?")!=true){return}for(let e=0;e{let e=document.getElementById("mute__switch").checked;if(e==true){isMuteOn=true}else{isMuteOn=false}saveData_isMute()});document.getElementById("mute__title").addEventListener("click",()=>{let e=document.getElementsByClassName("mute__panel")[0];if(e.style.display!="block"){e.style.display="block";if(document.getElementsByClassName("reply__panel")[0].style.display=="block"){document.getElementsByClassName("reply__panel")[0].style.display="none"}if(document.getElementsByClassName("enter__panel")[0].style.display=="block"){document.getElementsByClassName("enter__panel")[0].style.display="none"}if(document.getElementsByClassName("gift__panel")[0].style.display=="block"){document.getElementsByClassName("gift__panel")[0].style.display="none"}if(document.getElementsByClassName("vote__panel")[0].style.display=="block"){document.getElementsByClassName("vote__panel")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("mute__select").onclick=function(){if(this.options.length==0){return}let e=this.options[this.selectedIndex].text;let t=muteWordList[e].count;let n=muteWordList[e].time;document.getElementById("mute__word").value=e;document.getElementById("mute__count").value=t;selectOptionByValue("mute__time",n)};document.getElementById("mute__add").addEventListener("click",()=>{let e=document.getElementById("mute__time");let t=document.getElementById("mute__select");let n=document.getElementById("mute__word").value;let o=document.getElementById("mute__count").value;let i=e.options[e.selectedIndex].value;if(n==""){return}muteWordList[n]={count:o,time:i};t.options.add(new Option(n,""));saveData_Mute()});document.getElementById("mute__del").addEventListener("click",()=>{let e=document.getElementById("mute__select");let t=e.options[e.selectedIndex].text;delete muteWordList[t];e.options.remove(e.selectedIndex);saveData_Mute()})}function saveData_Mute(){let e=muteWordList;localStorage.setItem("ExSave_Mute",JSON.stringify(e))}function saveData_isMute(){let e=[];let t=localStorage.getItem("ExSave_isMute");if(t!=null){let n=JSON.parse(t);if("rooms"in n==true){e=n.rooms}}let n=e.indexOf(rid);if(isMuteOn==true){if(n==-1){e.push(rid)}}else{e.splice(n,1)}let o={rooms:e};localStorage.setItem("ExSave_isMute",JSON.stringify(o))}async function initPkg_Mute_Set(){let e=localStorage.getItem("ExSave_Mute");if(e!=null){let t=JSON.parse(e);muteWordList=t;let n=document.getElementById("mute__select");for(let e in t){if(t.hasOwnProperty(e)){n.options.add(new Option(e,""))}}}e=localStorage.getItem("ExSave_isMute");if(e!=null){let t=JSON.parse(e);let n=[];if("rooms"in t==true){n=t.rooms}if(n.indexOf(rid)==-1){isMuteOn=false}else{isMuteOn=true}document.getElementById("mute__switch").checked=isMuteOn}else{isMuteOn=false;document.getElementById("mute__switch").checked=isMuteOn}}async function initPkg_LiveTool_Mute_Handle(e){if(isMuteOn==false){return}if(getType(e)=="chatmsg"){let t=getStrMiddle(e,"uid@=","/");if(t==my_uid){return}let n=getStrMiddle(e,"nn@=","/");let o=getStrMiddle(e,"txt@=","/");let i=false;for(let e in muteWordList){if(e==""){continue}if(e.indexOf("re(")!=-1){let t=getStrMiddle(e,"re(",")=");let n=e.split("=");if(n.length>1){let e=n[1];let a=new RegExp(t,"g");let l=a.exec(o);if(l.length>0){if(l[0]==e){i=true}else{i=false}}}}else{if(String(o).indexOf(e)==-1){i=false}else{i=true}}if(i==true){let i=muteWordList[e].count;let a=muteWordList[e].time;if(muteIdList.hasOwnProperty(n)){let e=Number(muteIdList[n].count)+1;if(e>=i){let e=await addMuteUser(rid,n,a);showMessageWindow("禁言信息","【"+n+"】已被禁言"+a+"分钟"+"\n弹幕:"+o,()=>{});let i={id:n,uid:t,barrage:o,time:a,count:1,ts:String(dateFormat("yyyy年MM月dd日hh时mm分ss秒 ",new Date))};muteIdListShow.push(i);muteIdList[n].count=0}else{muteIdList[n].count=String(e)}}else{let e=1;if(e>=i){let e=await addMuteUser(rid,n,a);showMessageWindow("禁言信息","【"+n+"】已被禁言"+a+"分钟"+"\n弹幕:"+o,()=>{});let i={id:n,uid:t,barrage:o,time:a,count:1,ts:String(dateFormat("yyyy年MM月dd日hh时mm分ss秒 ",new Date))};muteIdListShow.push(i)}else{muteIdList[n]={uid:t,count:1}}}break}}}}function addMuteUser(e,t,n){return new Promise(o=>{fetch("https://www.douyu.com/room/roomSetting/addMuteUser",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"ban_nickname="+t+"&room_id="+e+"&ban_time="+n+"&reason=7"}).then(e=>{return e.json()}).then(e=>{o(e)})})}function deleteMuteUser(e,t){return new Promise(n=>{fetch("https://www.douyu.com/room/roomSetting/deleteMuteUser",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"room_id="+e+"&uid="+t}).then(e=>{return e.json()}).then(e=>{n(e)})})}function getRoomAdminStatus(){return new Promise(e=>{fetch("https://www.douyu.com/japi/firepower/apinc/roomAdmin/getStatus?rid="+rid,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(t=>{let n=false;if(t.error=="0"){if(t.data.has=="1"){n=true}else{n=false}}else{n=false}e(n)}).catch(e=>{console.log("请求失败!",e)})})}let isReplyOn=false;let replyWordList={};function initPkg_LiveTool_Reply(){LiveTool_Reply_insertDom();LiveTool_Reply_insertFunc();initPkg_Reply_Set()}function LiveTool_Reply_insertDom(){let e=document.createElement("div");e.className="livetool__cell";let t=`\n
\n 关键词回复\n
\n
\n
\n \n \n
\n
\n `;let n=`\n
\n \n \n \n
\n \n \n
\n
\n `;e.innerHTML=t+n;let o=document.getElementsByClassName("livetool")[0];o.insertBefore(e,o.childNodes[0])}function LiveTool_Reply_insertFunc(){document.getElementById("reply__switch").addEventListener("click",()=>{let e=document.getElementById("reply__switch").checked;if(e==true){isReplyOn=true}else{isReplyOn=false}saveData_isReply()});document.getElementById("reply__title").addEventListener("click",()=>{let e=document.getElementsByClassName("reply__panel")[0];if(e.style.display!="block"){e.style.display="block";if(rid!=="5189167"){if(document.getElementsByClassName("mute__panel")[0].style.display=="block"){document.getElementsByClassName("mute__panel")[0].style.display="none"}}if(document.getElementsByClassName("enter__panel")[0].style.display=="block"){document.getElementsByClassName("enter__panel")[0].style.display="none"}if(document.getElementsByClassName("gift__panel")[0].style.display=="block"){document.getElementsByClassName("gift__panel")[0].style.display="none"}if(document.getElementsByClassName("vote__panel")[0].style.display=="block"){document.getElementsByClassName("vote__panel")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("reply__select").onclick=function(){if(this.options.length==0){return}let e=this.options[this.selectedIndex].text;let t=replyWordList[e].reply;document.getElementById("reply__word").value=e;document.getElementById("reply__reply").value=t};document.getElementById("reply__add").addEventListener("click",()=>{let e=document.getElementById("reply__select");let t=document.getElementById("reply__word").value;let n=document.getElementById("reply__reply").value;if(t==""){return}replyWordList[t]={reply:n};e.options.add(new Option(t,""));saveData_Reply()});document.getElementById("reply__del").addEventListener("click",()=>{let e=document.getElementById("reply__select");let t=e.options[e.selectedIndex].text;delete replyWordList[t];e.options.remove(e.selectedIndex);saveData_Reply()})}function saveData_Reply(){let e=replyWordList;localStorage.setItem("ExSave_Reply",JSON.stringify(e))}function saveData_isReply(){let e=[];let t=localStorage.getItem("ExSave_isReply");if(t!=null){let n=JSON.parse(t);if("rooms"in n==true){e=n.rooms}}let n=e.indexOf(rid);if(isReplyOn==true){if(n==-1){e.push(rid)}}else{e.splice(n,1)}let o={rooms:e};localStorage.setItem("ExSave_isReply",JSON.stringify(o))}function initPkg_Reply_Set(){let e=localStorage.getItem("ExSave_Reply");if(e!=null){let t=JSON.parse(e);replyWordList=t;let n=document.getElementById("reply__select");for(let e in t){if(t.hasOwnProperty(e)){n.options.add(new Option(e,""))}}}e=localStorage.getItem("ExSave_isReply");if(e!=null){let t=JSON.parse(e);let n=[];if("rooms"in t==true){n=t.rooms}if(n.indexOf(rid)==-1){isReplyOn=false}else{isReplyOn=true}document.getElementById("reply__switch").checked=isReplyOn}else{isReplyOn=false;document.getElementById("reply__switch").checked=isReplyOn}}function initPkg_LiveTool_Reply_Handle(e){if(isReplyOn==false){return}if(getType(e)=="chatmsg"){let t=getStrMiddle(e,"uid@=","/");if(t==my_uid){return}let n=getStrMiddle(e,"nn@=","/");let o=getStrMiddle(e,"txt@=","/");let i=false;for(let e in replyWordList){if(e==""){continue}if(e.indexOf("re(")!=-1){let t=getStrMiddle(e,"re(",")=");let n=e.split("=");if(n.length>1){let e=n[1];let a=new RegExp(t,"g");let l=a.exec(o);if(l.length>0){if(l[0]==e){i=true}else{i=false}}}}else{if(String(o).indexOf(e)!=-1){i=true}else{i=false}}if(i==true){let t=replyWordList[e].reply;t=String(t).replace(//g,n);t=String(t).replace(//g,o);sendBarrage(t);break}}}}var treasureNum=0;function initPkg_LiveTool_Treasure(){LiveTool_Treasure_insertModal()}function LiveTool_Treasure_insertModal(){let e=document.createElement("div");e.className="livetool__Treasure";e.id="Ex_Geetest";let t=document.getElementsByClassName("Barrage-main")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_LiveTool_Treasure_Handle(e){if(isGetTreasure==false){return}if(getType(e)=="tsboxb"){let t=getStrMiddle(e,"ot@=","/");let n=getStrMiddle(e,"rpid@=","/");let o=getStrMiddle(e,"rid@=","/");let i=getCookieValue("dy_did");let a=Number(t)-Math.floor(Date.now()/1e3);a=a*1e3+getTreasureDelay();treasureNum++;let l=document.createElement("div");let s="Ex_Geetest_no"+String(treasureNum);l.id=s;let r=document.getElementById("Ex_Geetest");r.appendChild(l);setTimeout(()=>{getTreasure(o,n,i,s)},a)}}function getTreasure(e,t,n,o){GM_xmlhttpRequest({method:"POST",url:"https://pcapi.douyucdn.cn/h5nc/member/getRedPacket?token="+dyToken,data:"room_id="+e+"&package_room_id="+e+"&device_id="+n+"&packerid="+t+"&version=1",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(i){let a=i.response;if(a.data.code=="-1"&&a.data.validate!="0"){let i=JSON.parse(a.data.geetest.validate_str);let l=i.success;let s=i.challenge;let r=i.gt;let d=getTreasureSkey();if(d!=""){let o=window.location.href;getTreasure_Auto(d,r,s,o,n,t,e);return}let c=i=>{let a=document.getElementById(o);i.appendTo("#"+o);i.onSuccess(()=>{let o=i.getValidate();let l=o.geetest_challenge;let s=o.geetest_seccode;let r=o.geetest_validate;let d="room_id="+e+"&package_room_id="+e+"&device_id="+n+"&packerid="+t+"&version=1";d=d+"&geetest_challenge="+l+"&geetest_validate="+r+"&geetest_seccode="+encodeURIComponent(s);GM_xmlhttpRequest({method:"POST",url:"https://pcapi.douyucdn.cn/h5nc/member/getRedPacket?token="+dyToken,data:d,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;let n="";if(t.data.prop_id==""){n="鱼丸x"+t.data.silver}else{n=t.data.prop_name+"x"+t.data.prop_count}if(n!=""){showMessage("【宝箱】获得"+n,"success")}if(a!=null){a.remove()}}})})};if(unsafeWindow.initGeetest!=undefined){unsafeWindow.initGeetest({gt:r,challenge:s,offline:!l,product:"float"},c)}else{showMessage("自动抢宝箱初始化失败","error")}}else if(a.data.msg!="领取失败"&&a.data.msg!="验证码不正确"){let e="";if(a.data.prop_id==""){e="鱼丸x"+a.data.silver}else{e=a.data.prop_name+"x"+a.data.prop_count}if(e!=""){showMessage("【宝箱】获得"+e,"success")}}else{showMessage("【宝箱】领取失败","error")}}})}function getTreasure_Verify(e,t,n,o){let i="room_id="+roomid+"&package_room_id="+roomid+"&device_id="+deviceid+"&packerid="+rpid+"&version=1";i+="&geetest_challenge="+e+"&geetest_validate="+t+"&geetest_seccode="+encodeURIComponent(n);GM_xmlhttpRequest({method:"POST",url:"https://pcapi.douyucdn.cn/h5nc/member/getRedPacket?token="+dyToken,data:i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(document.getElementById(o)!=null){document.getElementById(o).remove()}}})}function getTreasure_Auto(e,t,n,o,i,a,l){let s="geetest";let r="wtype="+s+"&secretkey="+e+">="+t+"&referer="+o+"&challenge="+n+"&supporttype=3";GM_xmlhttpRequest({method:"POST",url:"http://api.ddocr.com/api/gateway.jsonp",data:r,timeout:6e4,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.status=="-1"){showMessage("【宝箱】自动识别失败","error");return}let n="room_id="+l+"&package_room_id="+l+"&device_id="+i+"&packerid="+a+"&version=1";n=n+"&geetest_challenge="+t.data.challenge+"&geetest_validate="+t.data.validate+"&geetest_seccode="+t.data.validate+"%7Cjordan";GM_xmlhttpRequest({method:"POST",url:"https://pcapi.douyucdn.cn/h5nc/member/getRedPacket?token="+dyToken,data:n,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.data.code=="-1"){showMessage("【宝箱】验证码不正确","error");return}let n="";if(t.data.prop_id==""){n="鱼丸x"+t.data.silver}else{n=t.data.prop_name+"x"+t.data.prop_count}if(n!=""){showMessage("【宝箱】获得"+n,"success")}}})}})}let isVoteOn=false;let voteList={};let voteNameList={};let voteWordList={};let voteTotalNum=0;let timer_Vote;let isRepeat=false;function initPkg_LiveTool_Vote(){LiveTool_Vote_insertDom();LiveTool_Vote_insertDom_VotePanel();LiveTool_Vote_insertFunc();initPkg_Vote_Set()}function LiveTool_Vote_insertDom(){let e=document.createElement("div");e.className="livetool__cell";let t=`\n
\n 弹幕投票面板\n
\n
\n \n
\n \n \n
\n
\n `;let n=`\n
\n \n \n \n \n
\n \n \n
\n
\n `;e.innerHTML=t+n;let o=document.getElementsByClassName("livetool")[0];o.insertBefore(e,o.childNodes[0])}function LiveTool_Vote_insertFunc(){document.getElementById("vote__switch").addEventListener("click",()=>{let e=document.getElementById("vote__switch").checked;let t=document.getElementById("vote__select");let n=t.options[t.selectedIndex].text;let o=voteList[n].options;let i=voteList[n].time;if(e==true){let e=String(o).split(" ");for(let t=0;t{voteNameList={};voteWordList={};isVoteOn=false;document.getElementById("vote__repeat").disabled=false;document.getElementById("vote__switch").checked=false},i*1e3);document.getElementsByClassName("vote__result")[0].style.display="block"}else{clearTimeout(timer_Vote);voteNameList={};voteWordList={};isVoteOn=false;document.getElementById("vote__repeat").disabled=false}});document.getElementById("vote__title").addEventListener("click",()=>{let e=document.getElementsByClassName("vote__panel")[0];if(e.style.display!="block"){e.style.display="block";if(rid!=="5189167"){if(document.getElementsByClassName("mute__panel")[0].style.display=="block"){document.getElementsByClassName("mute__panel")[0].style.display="none"}}if(document.getElementsByClassName("enter__panel")[0].style.display=="block"){document.getElementsByClassName("enter__panel")[0].style.display="none"}if(document.getElementsByClassName("gift__panel")[0].style.display=="block"){document.getElementsByClassName("gift__panel")[0].style.display="none"}if(document.getElementsByClassName("reply__panel")[0].style.display=="block"){document.getElementsByClassName("reply__panel")[0].style.display="none"}}else{e.style.display="none"}});document.getElementById("vote__select").onclick=function(){if(this.options.length==0){return}let e=this.options[this.selectedIndex].text;let t=voteList[e].options;let n=voteList[e].time;document.getElementById("vote__theme").value=e;document.getElementById("vote__options").value=t;document.getElementById("vote__time").value=n};document.getElementById("vote__add").addEventListener("click",()=>{let e=document.getElementById("vote__select");let t=document.getElementById("vote__theme").value;let n=document.getElementById("vote__options").value;let o=document.getElementById("vote__time").value;if(t==""||n==""||o==""){return}voteList[t]={options:n,time:o};e.options.add(new Option(t,""));saveDate_Vote()});document.getElementById("vote__del").addEventListener("click",()=>{let e=document.getElementById("vote__select");let t=e.options[e.selectedIndex].text;delete voteList[t];e.options.remove(e.selectedIndex);saveDate_Vote()});document.getElementById("vote__show-result").addEventListener("click",()=>{let e=document.getElementsByClassName("vote__result")[0];if(e.style.display!="block"){e.style.display="block"}else{e.style.display="none"}})}function initPkg_Vote_Set(){document.getElementById("vote__switch").checked=isReplyOn;let e=localStorage.getItem("ExSave_Vote");if(e!=null){let t=JSON.parse(e);voteList=t;let n=document.getElementById("vote__select");for(let e in t){if(t.hasOwnProperty(e)){n.options.add(new Option(e,""))}}}}function initPkg_LiveTool_Vote_Handle(e){if(isVoteOn==false){return}if(getType(e)=="chatmsg"){let t=getStrMiddle(e,"uid@=","/");let n=getStrMiddle(e,"txt@=","/");if(isRepeat){if(Object(voteWordList).hasOwnProperty(n)){voteWordList[n].num++;voteTotalNum++;changeOptionsData()}}else{if(Object(voteNameList).hasOwnProperty(t)==false){if(Object(voteWordList).hasOwnProperty(n)){voteNameList[t]=0;voteWordList[n].num++;voteTotalNum++;changeOptionsData()}}}}}function saveDate_Vote(){let e=voteList;localStorage.setItem("ExSave_Vote",JSON.stringify(e))}function LiveTool_Vote_insertDom_VotePanel(){let e=document.createElement("div");e.className="vote__result";let t=`\n
投票主题
\n
X
\n
\n `;e.innerHTML=t;let n=document.getElementsByClassName("layout-Player-main")[0];n.insertBefore(e,n.childNodes[0]);let o=document.getElementsByClassName("vote__result")[0];o.onmousedown=function(e){e.stopPropagation();let t=e.clientX-o.offsetLeft;let n=e.clientY-o.offsetTop;let i;let a;document.onmousemove=function(e){e.stopPropagation();i=e.clientX-t;a=e.clientY-n;o.style.left=i+"px";o.style.top=a+"px"};document.onmouseup=function(e){e.stopPropagation();document.onmousemove=null;document.onmouseup=null}};document.getElementById("vote__result-close").addEventListener("click",()=>{document.getElementsByClassName("vote__result")[0].style.display="none"})}function initVoteOptionsPanel(e,t){document.getElementById("vote__result-theme").innerText=e;document.getElementById("vote__result-options").innerHTML="";setVoteOptionsDom(t)}function setVoteOptionsDom(e){let t=e.split(" ");let n=document.getElementById("vote__result-options");for(let e=0;e${t[e]}\n
\n
\n
\n
\n `;n.appendChild(o)}}function changeOptionsData(){for(const e in voteWordList){let t=voteWordList[e];let n=document.getElementsByClassName("vote__option-num")[t.index];let o=document.getElementsByClassName("vote__progress-bar")[t.index];let i=String(Number(Number(t.num/voteTotalNum)*100).toFixed(1))+"%";n.innerText=`${t.num}(${i})`;o.style.width=i}}function initPkg_Menu(){GM_registerMenuCommand(`检查更新`,()=>{Update_checkVersion(true)})}function initPkg_MiniProgram(){initPkg_MiniProgram_Dom();initPkg_MiniProgram_Func()}function initPkg_MiniProgram_Dom(){MiniProgram_insertIcon();MiniProgram_insertModal()}function MiniProgram_insertIcon(){let e=document.createElement("div");e.className="MiniProgram";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function MiniProgram_insertModal(){let e=document.createElement("div");e.className="miniprogram__panel";e.innerHTML=`\n\t\t
\n\t\t\t
DouyuEx移动端上线啦
微信扫码或搜索DouyuEx
↓ 即刻体验 ↓
\n\t\t\t\n\t\t
\n\t\t
\n `;let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_MiniProgram_Func(){document.getElementsByClassName("MiniProgram")[0].addEventListener("click",function(){let e=document.getElementsByClassName("miniprogram__panel")[0];if(e.style.display!="block"){e.style.display="block"}else{e.style.display="none"}})}let svg_night='';let svg_day='';let currentMode=0;function initPkg_Night(){initPkg_Night_Dom();initPkg_Night_Func();initPkg_Night_Set();watchBottomIframe()}function initPkg_Night_Dom(){Night_insertIcon()}function Night_insertIcon(){let e=document.createElement("div");e.style="position: absolute;right: -75px;top: 18px;cursor: pointer;";e.id="ex-night";e.innerHTML=svg_day;e.title="切换夜间模式";let t=document.getElementsByClassName("Header-right")[0];t.appendChild(e)}function saveData_Mode(){let e={mode:currentMode};localStorage.setItem("ExSave_Mode",JSON.stringify(e))}function initPkg_Night_Set_Fast(){let e=localStorage.getItem("ExSave_Mode");if(e!=null){let t=JSON.parse(e);if("mode"in t==false){t.mode=0}if(t.mode==1){setNightMode()}}}function initPkg_Night_Set(){let e=localStorage.getItem("ExSave_Mode");let t=document.getElementById("ex-night");if(e!=null){let n=JSON.parse(e);if("mode"in n==false){n.mode=0}if(n.mode==1){currentMode=1;t.innerHTML=svg_night;t.title="切换日间模式"}}}function initPkg_Night_Func(){document.getElementById("ex-night").addEventListener("click",function(){let e=document.getElementById("ex-night");if(currentMode==0){currentMode=1;e.innerHTML=svg_night;e.title="切换日间模式";setNightMode();saveData_Mode();setNightModeIframe()}else{currentMode=0;e.innerHTML=svg_day;e.title="切换夜间模式";cancelNightMode();saveData_Mode();cancelNightModeIframe()}})}function setNightMode(){let e=`\n .layout-Player-barrage,.Barrage--paddedBarrage,.Barrage-firstCharge,.Barrage-notice--replyBarrage{background-color:rgba(37,38,42,1) !important;}\n .Barrage-userEnter{background-color:rgba(37,38,42,1) !important;color:rgba(187,187,187,1) !important;}\n /*.Barrage-content,.Barrage-text{color:rgba(187,187,187,1) !important;}*/\n .Barrage-content,.Barrage-text{color:rgba(187,187,187,1);}\n .Barrage-notice--noble{background-color:rgba(37,38,42,1) !important;border:rgba(37,38,42,1) solid 1px !important;}\n .layout-Player-title{background-color:rgba(35,36,39,1) !important;border:rgba(35,36,39,1) solid 1px !important;}\n .Title-header{color:rgba(191,191,191,1) !important;}\n .Title-anchorText{color:rgba(107,176,125,1) !important;}\n .Title-row-text,.Title-anchorName{color:rgba(153,153,153,1) !important;}\n #js-player-toolbar{background:rgb(37,38,42) !important;border:1px solid rgb(37,38,42) !important;}\n .PlayerToolbar-wealthNum,.Header-wrap .Header-menu-link>a,.public-DropMenu-link,.Header-icon{color:rgb(191,191,191) !important;}\n .layout-Main{background-color:rgba(35,36,39,1) !important;}\n .ChatRank-rankWraper{background:rgba(47,48,53,1) !important;border:rgba(47,48,53,1) solid 1px !important;}\n .bg-icon{display:none;}\n .ChatRankWeek-headerContent,.NobleRank,.NobleRankTips{background-color:rgba(47,48,53,1) !important;}\n #js-player-asideMain{border:1px solid rgba(37,38,42,1) !important;background-color:rgb(47,48,53) !important;}\n .Chat,.ChatSend-txt{background:rgba(47,48,53,1) !important;color:rgb(187,187,187) !important;border-radius:0px !important;}\n .ChatTabContainer-titleWraper--tabLi{background:rgb(29,32,35) !important;border:1px solid rgb(47,48,53) !important;}\n .ChatTabContainer-titleWraper--tabLi.is-active,.ChatBarrageCollect-tip,.FansRankInfo{background:rgb(47,48,53) !important;}\n .FansRankInfo-txt{color:rgb(121,127,137) !important;}\n .Barrage{border:1px solid rgba(35,36,39,1) !important;}\n .layout-Player-chat{border-top:1px solid rgba(47,48,53,1) !important;}\n .layout-Player-announce{background-color:rgb(29,32,35) !important;border:1px solid rgb(29,32,35) !important;}\n .FansRankBottom,.AnchorFriend-footer{border-top:1px solid rgb(47,48,53) !important;}\n .Title-official{background:rgb(35,36,39) !important;}\n .Header-wrap{background:rgb(45,46,54) !important;border-bottom:1px solid rgb(45,46,54) !important;}\n .layout-Menu{background:rgb(47,48,53) !important;border-color:rgb(35,36,39) !important;}\n .GuessMainPanel{background:rgba(47,48,53,0.9) !important;border:1px solid rgb(47,48,53) !important;}\n .danmuAuthor-3d7b4a{color:rgb(234,234,234) !important;}\n .danmudiv-32f498{background:rgba(47,49,53,0.9) !important;}\n .danmuContent-25f266{background:rgba(35,36,39,0.9) !important;}\n .word-89c053{background:rgba(35,36,39,0.9) !important;color:rgb(187,187,187) !important;}\n .FansMedalPanel-Panel{color:black !important;}\n .AnchorLike-ItemBox,.AnchorFriendPane-content,.SociatyLabelPop-content{border:1px solid rgb(35,36,39) !important;}\n .AnchorFriendCard-info>h3,.GiftExpandPanel-descName,.GiftInfoPanel-name,.FansMedalInfo-titleL,.SociatyAnchorCard-info>h3{color:rgb(204,204,204) !important;}\n .GuessReturnYwFdSlider{background:rgba(47,48,53,0.7); !important;border-left:1px solid rgb(35,36,39) !important;}\n .GuessGuideList-itemBox,.GuessGuideList-moreGuess{background-color:rgba(47,48,53) !important;color:rgb(204,204,204) !important;}\n .AnchorFriend-footer a{background-color:rgb(47,48,53) !important;color:rgb(204,204,204) !important;}\n .AnchorFriendPane-title{border-bottom:1px solid rgb(47,48,53) !important;background-color:rgb(35,36,39) !important;}\n .AnchorLike-friendList .AnchorFriendPane-title h3,.Title svg{color:rgb(153,153,153) !important;}\n .GiftExpandPanel{background-color:rgb(35,36,39) !important;border:1px solid rgb(35,36,39) !important;}\n .GiftInfoPanel-cont{background-color:rgb(35,36,39) !important;border:1px solid rgb(35,36,39) !important;}\n .BatchGiveForm-num{background-color:rgb(35,36,39) !important;}\n .BatchGiveForm-input{background-color:rgb(35,36,39) !important;color:rgb(149,149,149) !important;}\n .BatchGiveForm-btn,.Backpack-prop.is-blank,.GuessMainPanel-sliderItem{background-color:rgb(47,48,53) !important;}\n .Backpack{background-color:rgb(35,36,39) !important;border:1px solid rgb(35,36,39) !important;}\n .Backpack-name,.NormalCard-btn,.NormalCard-close,.NobleCard-close,.ReportButton-41fa9e,.HideButton-d22988,.txtHidden-486e56,.BackpackInfoPanel-name,.NormalCard-name{color:rgb(187,187,187) !important;}\n .Backpack-propPage,.BatchProp-content{background-color:rgb(35,36,39) !important;color:rgb(149,149,149)!important;}\n .BackpackInfoPanel-content{background-color:rgb(35,36,39) !important;border:1px solid rgb(35,36,39) !important;}\n .BatchProp-customIpt,.BatchGiveForm-num,.GiftInfoPanel-intro{color:rgb(149,149,149) !important;}\n .GuessReturnYwFdSlider-numIptWrap,.GuessReturnYwFdSlider-numIpt{background-color:rgb(47,48,53) !important;color:rgb(149,149,149) !important;}\n .GuessReturnYwFdSlider-giftName{color:rgb(160,160,160) !important;}\n .NormalCard-common,.GuessRankPanel{background-color:rgb(47,48,53) !important;border:1px solid rgb(47,48,53) !important;}\n .FansMedalPanel-OwnerInfo,.FansMedalPanel-list{background-color:rgb(47,48,53) !important;color:rgb(187,187,187) !important;}\n .FansMedalList-item:hover{background-color:rgb(37,38,42) !important;}\n .AnchorFriend-content,.SociatyAnchor-content{background-color:rgb(35,36,39) !important;border-top:1px solid rgb(47,48,53) !important;}\n .SociatyLabelPop-title{border-bottom:1px solid rgb(121,127,137) !important;background-color:rgb(35,36,39) !important;color:rgb(153,153,153) !important;}\n .Barrage-nickName{color:rgb(255,119,0) !important;}\n .wm-general-wrapper{background:rgb(35,36,39) !important;}\n .ChatRank-rankWraper .ChatRankTab-title.is-active{color:rgb(255,119,0)!important;}\n .ChatRank-rankWraper .ChatRankTab-title{color:rgb(131,140,154)!important;background:rgb(29,32,35)!important;border:1px solid rgb(47,48,53)!important;}\n .MatchTeamRankList-topAvatar{background:rgb(47,48,53)!important;}\n .MatchTeamRankList-topName{color:rgb(131,140,154)!important;background-color:rgb(47,48,53)!important;}\n .MatchTeamRankTitle-content{background:rgb(47,48,53)!important;color:rgb(131,140,154)!important;}\n .MatchTeamRankBottom{background:rgb(47,48,53) !important;}\n .MatchTeamRankBottom-lable{color:rgb(131,140,154);}\n .MatchTeamRankBottom-desc{color:rgb(121,127,137);}\n .Barrage-text>a,.Barrage-firstCharge{color:rgb(187,187,187)!important;}\n .GuessMainPanelHeader-slogon{color:rgb(204,204,204)!important;}\n .Barrage-hitYwGame--text{color:rgb(187,187,187)!important;}\n .AnchorFriendPane-title h3{color:rgb(153,153,153)!important;}\n .Barrage-nickName.is-self{color:rgb(255,0,51)!important;}\n .barragePanel__funcPanel{background:rgba(47,49,53,0.9) !important;}\n .layui-text{color:rgb(187,187,187) !important;}\n .GuessReturnYwFdSlider-ywNum{color:rgb(237,90,101) !important;}\n .VideoBottomTabs span{color:rgb(204,204,204)}\n #point__value{color:rgb(191,191,191) !important;}\n #red_envelope_text,#red_envelope_query{color:rgb(191,191,191) !important;}\n .layout-Container{background-color:rgb(35,36,39) !important;}\n .FansRankBottom-invisible,.ChatRankWeek-invisibleContent{background:rgb(47,48,53) !important;}\n .Barrage-roomVip--super{border-top: 1px solid rgb(37,38,42)!important;border-bottom: 1px solid rgb(37,38,42)!important;background: rgb(37,38,42)!important;}\n .Barrage-userEnter--vip{background: rgb(37,38,42)!important;}\n .ChatRankWeek-nobleInvisible{border-top:1px solid rgb(121,127,137) !important;}\n #refresh-video2-svg{fill:#ffffff !important}\n .VideoRecommendItem a{border-bottom: 3px solid rgb(35,36,39) !important;}\n .AnchorFriendPane-title a:after{display:none !important;}\n\n .MedalOwnerInfo-box{border-bottom: 1px solid rgb(79 81 88)!important;}\n .FansMedalList-item.is-NoWear{border-top: 1px solid rgb(79 81 88)!important;}\n `;StyleHook_set("Ex_Style_NightMode",e)}function cancelNightMode(){StyleHook_remove("Ex_Style_NightMode")}function watchBottomIframe(){let e=new DomHook(".BottomGroup",true,e=>{if(currentMode==0){return}if(e.length==1){setNightModeIframe()}})}function setNightModeIframe(){let e=document.getElementsByClassName("BottomGroup")[0].getElementsByTagName("iframe")[0];if(e==undefined){return}StyleHook_setIframe(e.contentWindow.document,"Ex_Style_NightModeIframe",`\n body,#groupListBox,.mainbg,.wb_card-wbCardDetail-1wzCV,.video-imgWrap-3Mf6v{background: rgb(35,36,39) !important;}\n .wb_card-wbCardWrap-22KrE,.wb_card-topListItemBox-1ui_g{border-bottom: 1px solid rgb(47,48,53) !important;}\n .wb_card-wbInfo-19JiQ a,.wb_card-wbText-2fk2Y{color: rgb(204,204,204) !important;}\n .wb_handle-wbRowLine-3OXI6 li,.wb_card-groupnameAndGrouplevel-38MGW{background: rgb(47,48,53) !important;}\n .index-dyPage-260IV a{background-color: rgb(47,48,53)!important;border: 1px solid rgb(47,48,53)!important;}\n .index-topTypeStyle-2ksW4{background-color: rgb(47,48,53)!important;color: rgb(204,204,204) !important;}\n .index-dyPage-260IV span{background-color: rgb(47,48,53)!important;}\n\n .index-editorArea-3XhrM input[data-input=title]{background-color: rgb(47,48,53)!important;color:rgb(204,204,204)!important;border: 1px solid rgb(47,48,53)!important;}\n .index-dyPageGoNumber-LGN4a{background-color: rgb(47,48,53)!important;color:rgb(204,204,204)!important;}\n span.index-dyPageActive-op79B{color:rgb(204,204,204)!important;}\n\n .editor-editorPluginsWrapper-HGPzc{background-color: rgb(47,48,53)!important;border-bottom: 1px solid rgb(47,48,53)!important;border-top: 1px solid rgb(47,48,53)!important;}\n .style-voteicon-3aTqD{color:rgb(204,204,204)!important;}\n .editor-editorWrapper-2fChb{border: 1px solid rgb(47,48,53)!important;}\n .editor-editorPluginsWrapper-HGPzc [data-role="menu"]:hover{background-color: rgb(47,48,53)!important;cursor: pointer!important;}\n .editor-editorContentRoot-3PCjH{color: rgb(204,204,204) !important;}\n .editor-editorNotLoginMask-1hCr-{background-color: rgb(47,48,53)!important;color: rgb(204,204,204) !important;}\n\n .style-newvoteTopwrapper-3PgJY{background: rgb(47,48,53)!important;}\n .style-newvoteHead-j0bH1{color: rgb(204,204,204) !important;}\n .style-newvoteHeadAttendView-1EgXK, .style-newvoteHeadAttendView-1EgXK:focus{background: rgb(47,48,53)!important;}\n .style-optionWrapper-2FhfD{background: rgb(35,36,39) !important;cursor: pointer!important;}\n .style-newvotestyleTitle-32flx{color: rgb(204,204,204) !important;}\n `)}function cancelNightModeIframe(){StyleHook_removeIframe(document.getElementsByClassName("BottomGroup")[0].getElementsByTagName("iframe")[0].contentWindow.document,"Ex_Style_NightModeIframe")}function initPkg_Point(){initPkg_Point_insertDom();initPkg_Point_Func();initPkg_Point_Constructor();initPkg_Point_Module()}function initPkg_Point_Module(){initPkg_Point_PointPanel()}function initPkg_Point_insertDom(){let e=document.createElement("div");e.id="ex-point";e.innerHTML=`\n 💗 积分\n \n `;let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Point_Func(){document.getElementById("ex-point").addEventListener("click",()=>{let e=document.getElementsByClassName("point__panel")[0];if(e.style.display!="block"){e.style.display="block"}else{e.style.display="none"}})}async function initPkg_Point_Constructor(){let e=await getUserPoint(dyToken);let t=document.getElementById("point__value");if(e.error=="0"){t.className="";t.innerText=e.data[0].point;document.getElementById("ex-point").title=`更新时间:${e.data[0].update_time}`}else if(e.error=="2"){alert(e.msg)}else{t.className="";t.innerText="0"}}async function updateUserPoint(){let e=await getUserPoint(dyToken);let t=document.getElementById("point__value");if(e.error=="0"){t.className="";t.innerText=e.data[0].point;document.getElementById("ex-point").title=`更新时间:${e.data[0].update_time}`;showMessage("【积分系统】积分更新完毕","success")}else if(e.error=="2"){alert(e.msg)}else{t.className="";t.innerText="0"}}function getUserPoint(e){return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/query_by_uid",data:"token="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let n=e.response;t(n)}})})}function getItemList(e){return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/query_item",data:"token="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let n=e.response;t(n)}})})}function exchangeItem(e,t,n,o){return new Promise(i=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/exchange",data:"token="+e+"&item_id="+t+"&id="+n+"&info="+o,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;i(t)}})})}function getExchangeRecord(e,t){return new Promise(n=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/query_exchange",data:"token="+e+"&offset="+t,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;n(t)}})})}function getPointList(e){return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/point_list",data:"token="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let n=e.response;t(n)}})})}function initPkg_Point_PointExchange(){initPkg_Point_PointExchange_insertDom();initPkg_Point_PointExchange_insertFunc()}function initPkg_Point_PointExchange_insertDom(){renderExchangePanel()}function initPkg_Point_PointExchange_insertFunc(){}async function renderExchangePanel(){if(document.getElementById("ex-exchange")!==null){return}let e=await getItemList(dyToken);if(e.error!="0"){showMessage("【积分系统】获取物品列表失败:"+e.msg,"error");return}if(e.data==null){showMessage("【积分系统】暂无可兑换的物品","error");return}let t=document.createElement("div");t.id="ex-exchange";let n=`
X
\n
`;for(let t=0;t\n \n ${e.data[t].name}\n ${e.data[t].description}\n 剩余 ${e.data[t].num} 件\n 💗${e.data[t].price}\n
兑换
\n
\n `}n=n+"
";t.innerHTML=n;let o=document.getElementsByClassName("PlayerToolbar-Wealth")[0];o.insertBefore(t,o.childNodes[0]);bindExchangePanel(e)}function bindExchangePanel(e){let t=document.getElementsByClassName("item__exchange");for(let n=0;n{exchangeItemEvent(e.data[n].id,e.data[n].num,e.data[n].price)})}document.getElementsByClassName("exchange__close")[0].onclick=(()=>{let e=document.getElementById("ex-exchange");if(e!==null){e.remove()}})}async function exchangeItemEvent(e,t,n){if(t<=0){showMessage("【积分系统】兑换失败:物品数量不足","error");return}let o=document.getElementById("point__value").innerText;if(o-n<0){showMessage("【积分系统】兑换失败:积分不足","error");return}showPrompt("请填写备注信息(联系方式/收货地址)",async t=>{if(t==""){showMessage("【积分系统】兑换失败:未填写备注信息","error");return}let n=await getUserName();let o=await exchangeItem(dyToken,e,n,t);if(o.error=="0"){showMessage("【积分系统】"+o.msg,"success");if(o.data.length>0){document.getElementById("point__value").innerText=o.data[0].point;document.getElementById("ex-point").title=`更新时间:${o.data[0].update_time}`}}else{showMessage("【积分系统】"+o.msg,"error")}},()=>{return})}function initPkg_Point_PointList(){initPkg_Point_PointList_insertDom()}function initPkg_Point_PointList_insertDom(){renderPointList()}function initPkg_Point_PointList_insertFunc(){document.getElementsByClassName("pointlist__close")[0].onclick=(()=>{let e=document.getElementById("ex-pointlist");if(e!==null){e.remove()}})}async function renderPointList(){if(document.getElementById("ex-pointlist")!==null){return}let e=await getPointList(dyToken);if(e.error!="0"){showMessage("【积分系统】获取积分榜失败:"+e.msg,"error");return}if(e.data==null){showMessage("【积分系统】积分榜暂无数据","error");return}let t=document.createElement("div");t.id="ex-pointlist";let n=`
X
\n
\n \n \n \n \n \n `;for(let t=0;t\n \n \n \n \n `}n=n+"
排名昵称积分
${t+1}${e.data[t].id}${e.data[t].point}
";t.innerHTML=n;let o=document.getElementsByClassName("PlayerToolbar-Wealth")[0];o.insertBefore(t,o.childNodes[0]);initPkg_Point_PointList_insertFunc()}function initPkg_Point_PointPanel(){initPkg_Point_PointPanel_insertDom();initPkg_Point_PointPanel_insertFunc()}function initPkg_Point_PointPanel_insertDom(){let e=document.createElement("div");e.className="point__panel";e.innerHTML=`\n
\n
更新积分
\n
积分榜
\n\t\t\t\t
兑换物品
\n\t\t\t\t
兑换记录
\n\t\t\t\t
积分规则
\n\t\t\t
\n\t\t\t
\n `;let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Point_PointPanel_insertFunc(){document.getElementById("panel__update").addEventListener("click",()=>{closePointPanel();updateUserPoint()});document.getElementById("panel__pointlist").addEventListener("click",()=>{closePointPanel();initPkg_Point_PointList()});document.getElementById("panel__exchange").addEventListener("click",async()=>{closePointPanel();initPkg_Point_PointExchange()});document.getElementById("panel__record").addEventListener("click",async()=>{closePointPanel();initPkg_Point_PointRecord()});document.getElementById("panel__rules").addEventListener("click",async()=>{closePointPanel();openPage("https://qianjiachun.github.io/DouyuEx/rules",true)})}function closePointPanel(){document.getElementsByClassName("point__panel")[0].style.display="none"}let currentOffset=0;let maxOffset=99999;function initPkg_Point_PointRecord(){currentOffset=0;initPkg_Point_PointRecord_insertDom();initPkg_Point_PointRecord_insertFunc()}function initPkg_Point_PointRecord_insertDom(){renderRecordWrap();renderRecord(currentOffset)}function initPkg_Point_PointRecord_insertFunc(){document.getElementsByClassName("record__close")[0].onclick=(()=>{let e=document.getElementById("ex-record");if(e!==null){e.remove()}});document.getElementsByClassName("record__prev")[0].onclick=(()=>{if(currentOffset<10){showMessage("【积分系统】兑换系统已到首页","error");return}currentOffset=currentOffset-10;renderRecord(currentOffset)});document.getElementsByClassName("record__next")[0].onclick=(()=>{if(currentOffset>=maxOffset){showMessage("【积分系统】兑换系统已到尾页","error");return}currentOffset=currentOffset+10;renderRecord(currentOffset)})}function renderRecordWrap(){if(document.getElementById("ex-record")!==null){return}let e=document.createElement("div");e.id="ex-record";let t=`\n
X
\n
\n
\n
上一页
\n
下一页
\n
\n `;e.innerHTML=t;let n=document.getElementsByClassName("PlayerToolbar-Wealth")[0];n.insertBefore(e,n.childNodes[0])}async function renderRecord(e){let t=document.getElementsByClassName("records__wrap");if(t.length<=0){return}t[0].innerHTML="";let n=await getExchangeRecord(dyToken,e);if(n.error!="0"){showMessage("【积分系统】"+n.msg,"error");return}if(n.data==null){maxOffset=currentOffset;showMessage("【积分系统】无兑换记录","error");return}let o="";for(let e=0;e\n
\n
(${n.data[e].status=="1"?"已发货":"未发货"})${n.data[e].item_name}
\n
${n.data[e].update_time}
\n
\n
\n
💗${n.data[e].price}
\n
\n \n `}t[0].innerHTML=o;bindRecord(n)}function bindRecord(e){let t=document.getElementsByClassName("record__wrap");for(let n=0;n{PostbirdAlertBox.alert({title:"备注信息",content:e.data[n].info,okBtn:"确定",contentColor:"rgb(51,51,51)"})})}}var videoPlayerArr=[];function initPkg_PopupPlayer(){initPkg_PopupPlayer_Dom();initPkg_PopupPlayer_Func()}function initPkg_PopupPlayer_Dom(){PopupPlayer_insertIcon();PopupPlayer_insertPrompt()}function PopupPlayer_insertIcon(){let e=document.createElement("div");e.className="popup-player";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function PopupPlayer_insertPrompt(){let e=document.createElement("div");let t="";e.className="postbird-box-container";e.id="popup-player__prompt";t+='
';t+='
';t+='
';t+='请输入直播间地址:';t+="
";t+='
';t+='';t+='';t+='';t+="
";t+='
';e.innerHTML=t;let n=document.getElementsByClassName("layout-Main")[0];n.insertBefore(e,n.childNodes[0])}function initPkg_PopupPlayer_Func(){document.getElementsByClassName("popup-player")[0].addEventListener("click",function(){document.getElementById("popup-player__prompt").style.display="block"});document.getElementById("popup-player__cancel").addEventListener("click",function(){document.getElementById("popup-player__prompt").style.display="none"});document.getElementById("popup-player__ok").addEventListener("click",function(){let e=document.getElementById("popup-player__url").value;if(e!=""){let t=document.getElementById("popup-player__noiframe").checked;if(t==true){if(e.indexOf("douyu.com")!=-1){getRealRid_Douyu(e,e=>{createNewVideo(videoPlayerArr.length,e,"Douyu")})}else if(e.indexOf("bilibili.com")!=-1){getRealRid_Bilibili(e,e=>{createNewVideo(videoPlayerArr.length,e,"Bilibili")})}else if(e.indexOf("huya.com")!=-1){createNewVideo(videoPlayerArr.length,e,"Huya")}}else{createNewVideo_iframe(videoPlayerArr.length,e)}}else{showMessage("请输入地址","error")}document.getElementById("popup-player__prompt").style.display="none"});document.getElementById("popup-player__prompt").addEventListener("keydown",function(t){let n=window.event||e;let o=n.keyCode||n.which||n.charCode;if(o==13){document.getElementById("popup-player__ok").click()}})}function createNewVideo(e,t,n){switch(n){case"Douyu":createNewVideo_Douyu(e,t);break;case"Bilibili":createNewVideo_Bilibili(e,t);break;case"Huya":let o=String(t).split("/");createNewVideo_Huya(e,t,o[o.length-1]);break;default:createNewVideo_Douyu(e,t);break}}function setElementVideo(e,t){if(flvjs.isSupported()){var n=document.getElementById("exVideoPlayer"+String(e));var o=flvjs.createPlayer({type:"flv",url:t},{fixAudioTimestampGap:false});if(e>videoPlayerArr.length-1){videoPlayerArr.push(o)}else{videoPlayerArr[e]=o}o.attachMediaElement(n);o.load();o.play()}}function setElementResize(e){let t=document.getElementById("exVideoDiv"+String(e));let n=document.getElementById("exVideoScale"+String(e));n.onmousedown=function(e){e.stopPropagation();e.preventDefault();let n={w:t.offsetWidth,h:t.offsetHeight,x:e.clientX,y:e.clientY};let o;let i;document.onmousemove=function(e){e.stopPropagation();e.preventDefault();o=Math.max(300,e.clientX-n.x+n.w);i=Math.max(150,e.clientY-n.y+n.h);o=o>=document.offsetWidth-t.offsetLeft?document.offsetWidth-t.offsetLeft:o;i=i>=document.offsetHeight-t.offsetTop?document.offsetHeight-t.offsetTop:i;t.style.width=o+"px";t.style.height=i+"px"};document.onmouseup=function(e){e.stopPropagation();e.preventDefault();document.onmousemove=null;document.onmouseup=null}}}function setElementDrag(e){let t=document.getElementById("exVideoDiv"+String(e));t.onmousedown=function(e){e.stopPropagation();let n=e.clientX-t.offsetLeft;let o=e.clientY-t.offsetTop;let i;let a;document.onmousemove=function(e){e.stopPropagation();i=e.clientX-n;a=e.clientY-o;t.style.left=i+"px";t.style.top=a+"px"};document.onmouseup=function(e){e.stopPropagation();document.onmousemove=null;document.onmouseup=null}}}function createNewVideo_Douyu(e,t){getRealLive_Douyu(t,true,true,"1",n=>{if(n!=""||n!=null){if(n=="None"){showMessage("房间未开播或其他错误","error");return}let o=String(n).split("/live");let i="";if(o.length>0){i=o[0]}let a=document.createElement("div");let l="";a.id="exVideoDiv"+String(e);a.rid=t;a.className="exVideoDiv";l+="
"+"斗鱼 - "+t+"";l+="";l+="";l+="无视频?";l+="
X
";l+="
";l+="
";a.innerHTML=l;let s=document.getElementsByClassName("layout-Main")[0];s.insertBefore(a,s.childNodes[0]);setElementDrag(e);setElementResize(e);setElementFunc_Douyu(e,t);setElementVideo(e,n)}})}function setElementFunc_Douyu(e,t){let n=document.getElementById("exVideoDiv"+String(e));let o=document.getElementById("exVideoPlayer"+String(e));let i=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));o.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";i.style.display="block"}else{a.style.display="none";i.style.display="none"}for(let t=0;t{videoPlayerArr[e].destroy();setElementVideo(e,t)})};s.onchange=function(){getRealLive_Douyu(t,true,true,l.value,t=>{videoPlayerArr[e].destroy();setElementVideo(e,t)})};r.onclick=function(){n.remove()};let d=document.getElementById("exVideoRID"+String(e));d.onclick=function(){getRealLive_Douyu(t,true,true,l.value,e=>{GM_setClipboard(String(e).replace("https","http"));showMessage("复制成功","success")})}}function createNewAudio_Douyu(e,t){getRealLive_Douyu(t,false,true,"1",n=>{console.log(n);if(n!=""||n!=null){if(n=="None"){showMessage("房间未开播或其他错误","error");return}let o=String(n).split("/live");let i="";if(o.length>0){i=o[0]}let a=document.createElement("div");let l="";a.id="exVideoDiv"+String(e);a.rid=t;a.className="exVideoDiv";l+="
"+"斗鱼 - "+t+"";l+="";l+="";l+="无视频?";l+="
X
";l+="
";l+="
";a.innerHTML=l;let s=document.getElementsByClassName("layout-Main")[0];s.insertBefore(a,s.childNodes[0]);setElementDrag(e);setElementResize(e);setElementFunc_Douyu(e,t);setElementVideo(e,n)}})}function createNewVideo_Bilibili(e,t){getRealLive_Bilibili(t,"1","1",n=>{if(n!=""||n!=null){let o=document.createElement("div");let i="";o.id="exVideoDiv"+String(e);o.rid=t;o.className="exVideoDiv";i+="
"+"Bilibili - "+t+"";i+="";i+="";i+="
X
";i+="
";i+="
";o.innerHTML=i;let a=document.getElementsByClassName("layout-Main")[0];a.insertBefore(o,a.childNodes[0]);setElementDrag(e);setElementResize(e);setElementFunc_Bilibili(e,t);setElementVideo(e,n)}})}function setElementFunc_Bilibili(e,t){let n=document.getElementById("exVideoDiv"+String(e));let o=document.getElementById("exVideoPlayer"+String(e));let i=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));o.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";i.style.display="block"}else{a.style.display="none";i.style.display="none"}for(let t=0;t{videoPlayerArr[e].destroy();setElementVideo(e,t)})};s.onchange=function(){getRealLive_Bilibili(t,l.value,s.value,t=>{videoPlayerArr[e].destroy();setElementVideo(e,t)})};r.onclick=function(){n.remove()};let d=document.getElementById("exVideoRID"+String(e));d.onclick=function(){getRealLive_Bilibili(t,l.value,s.value,e=>{GM_setClipboard(e);showMessage("复制成功","success")})}}function createNewVideo_Huya(e,t,n){getRealLive_Huya(t,"1",(o,i)=>{if(o!=""||o!=null){if(i!=""){showMessage(i,"error");return}let a=document.createElement("div");let l="";a.id="exVideoDiv"+String(e);a.rid=t;a.className="exVideoDiv";l+="
"+"Huya - "+n+"";l+="";l+="
X
";l+="
";l+="
";a.innerHTML=l;let s=document.getElementsByClassName("layout-Main")[0];s.insertBefore(a,s.childNodes[0]);setElementDrag(e);setElementResize(e);setElementFunc_Huya(e,t);setElementVideo(e,o)}})}function setElementFunc_Huya(e,t){let n=document.getElementById("exVideoDiv"+String(e));let o=document.getElementById("exVideoPlayer"+String(e));let i=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));o.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";i.style.display="block"}else{a.style.display="none";i.style.display="none"}for(let t=0;t{if(n!=""){showMessage(n,"error");return}videoPlayerArr[e].destroy();setElementVideo(e,t)})};s.onclick=function(){n.remove()};let r=document.getElementById("exVideoRID"+String(e));r.onclick=function(){getRealLive_Huya(t,l.value,(e,t)=>{if(t!=""){showMessage(t,"error");return}GM_setClipboard(e);showMessage("复制成功","success")})}}function createNewVideo_iframe(e,t){if(String(t).indexOf("douyu.com")==-1){showMessage("有弹幕模式仅支持斗鱼直播","error");return}let n=String(t).split("/");let o=n[n.length-1];let i=document.createElement("div");let a="";i.id="exVideoDiv"+String(e);i.rid=o;i.className="exVideoDiv";a+="
"+"斗鱼 - "+o+"";a+="
X
";a+="
";a+="";a+="
";i.innerHTML=a;let l=document.getElementsByClassName("layout-Main")[0];l.insertBefore(i,l.childNodes[0]);setElementDrag(e);setElementResize(e);if(e>videoPlayerArr.length-1){videoPlayerArr.push("iframe")}else{videoPlayerArr[e]="iframe"}setElementFunc_iframe(e)}function setElementFunc_iframe(e){let t=document.getElementById("exVideoDiv"+String(e));let n=document.getElementById("exVideoClose"+String(e));n.onclick=function(){t.remove()};t.onclick=function(t){t.stopPropagation();t.preventDefault();for(let t=0;t{return e.json()}).then(e=>{real_info.showtime=e.data.show_time;real_info.isShow=e.data.show_status;getRealViewer();setInterval(getRealViewer,3e4)}).catch(e=>{console.log("请求失败!",e)})}function initPkg_RealAudience_StyleHook(){StyleHook_set("Ex_Style_RealAudience",`\n .VideoEntry{display:none !important;}\n\t.layout-Player-rank{top:34px !important;}\n `)}function initPkg_RealAudience_Dom(){let e='';let t='';let n='';document.getElementsByClassName("VideoEntry")[0].style.display="none";let o="";let i=document.createElement("div");i.className="real-audience";o+="
";o+="
"+e+'****
';o+="
"+t+'****
';o+="
"+n+'****
';o+="
";o+=''+"已播:"+"****"+"";i.innerHTML=o;let a=document.getElementsByClassName("layout-Player-announce")[0];a.insertBefore(i,a.childNodes[0])}function initPkg_RealAudience_Func(){document.getElementsByClassName("real-audience")[0].addEventListener("click",function(){openPage(`http://www.toubang.tv/anchor/1_${rid}.html`,true)})}function getRealViewer(){if(document.querySelector(".MatchSystemChatRoomEntry")!=null){document.querySelector(".MatchSystemChatRoomEntry").style.display="none"}GM_xmlhttpRequest({method:"GET",url:"http://wx.toubang.tv/api/anchor/get/info?pt=1&rid="+rid+"&dt=0&date=0",responseType:"json",onload:function(e){let t=e.response;let n=0;if(real_info.isShow==2){n=0}else{if(real_info.showtime==1015){n=0}else{n=Math.floor(Date.now()/1e3)-Number(real_info.showtime)}}real_info.view=t.data.avgInteractNum||0;real_info.danmu_person_count=t.data.avgMsgUserNum||0;real_info.gift_person_count=t.data.avgGiftUserNum||0;real_info.money_yc=Number(t.data.giftWorth/100||0).toFixed(2);real_info.money_total=Number(t.data.giftAllWorth/100||0).toFixed(2);document.getElementById("real-audience__total").innerText=real_info.view;document.getElementById("real-audience__t").title="总人数:"+real_info.view+" 弹幕人数:"+real_info.danmu_person_count+" 送礼人数:"+real_info.gift_person_count;document.getElementById("real-audience__barrage").innerText=real_info.danmu_person_count;document.getElementById("real-audience__money_yc").innerText=real_info.money_yc;document.getElementById("real-audience__money").title="总礼物价值:"+real_info.money_total+" 鱼翅礼物:"+real_info.money_yc;document.getElementById("real-audience__time").innerText="已播:"+formatSeconds(n);document.getElementById("real-audience__time").title="开播时间:"+String(dateFormat("yyyy年MM月dd日hh时mm分ss秒 ",new Date(Number(real_info.showtime+"000"))))}})}function setAvatarVideo(){let e=document.querySelectorAll(".VideoEntry-tabItem>a")[0];if(e==undefined){return}let t=e.href+"?type=video";let n=e.href+"?type=liveReplay";setAvatarVideo_Dom();setAvatarVideo_Func(t,n);document.getElementsByClassName("Title-anchorPic-bottom")[0].style.display="none";document.getElementsByClassName("Title-anchorPic-bottom")[0].style.height="44px";document.getElementsByClassName("Title-anchorPicBack")[0].addEventListener("mouseenter",()=>{document.getElementsByClassName("Title-anchorPic-bottom")[0].style.display="block"});document.getElementsByClassName("Title-anchorPicBack")[0].addEventListener("mouseleave",()=>{document.getElementsByClassName("Title-anchorPic-bottom")[0].style.display="none"})}function setAvatarVideo_Dom(){let e=document.createElement("div");e.id="Ex_VideoReview";e.className="Title-anchorPic-bottomItem";e.innerHTML="回看";let t=document.createElement("i");t.style="top: 28px";let n=document.createElement("div");n.id="Ex_VideoSubmit";n.className="Title-anchorPic-bottomItem";n.innerHTML="投稿";let o=document.getElementsByClassName("Title-anchorPic-bottom")[0];o.insertBefore(e,o.childNodes[0]);o.insertBefore(t,o.childNodes[0]);o.insertBefore(n,o.childNodes[0])}function setAvatarVideo_Func(e,t){document.getElementById("Ex_VideoSubmit").addEventListener("click",()=>{openPage(e,true)});document.getElementById("Ex_VideoReview").addEventListener("click",()=>{openPage(t,true)})}function initPkg_Refresh(){initPkg_Refresh_BarrageFrame();initPkg_Refresh_Video();initPkg_Refresh_Barrage()}function saveData_Refresh(){let e={barrageFrame:{status:refresh_BarrageFrame_getStatus()},video:{status:refresh_Video_getStatus()},barrage:{status:refresh_Barrage_getStatus()}};localStorage.setItem("ExSave_Refresh",JSON.stringify(e))}let current_barrage_status=0;function initPkg_Refresh_Barrage(){initPkg_Refresh_Barrage_Dom();initPkg_Refresh_Barrage_Func();initPkg_Refresh_Barrage_Set()}function initPkg_Refresh_Barrage_Dom(){Refresh_Barrage_insertIcon()}function Refresh_Barrage_insertIcon(){let e=document.createElement("a");e.className="refresh-barrage";e.id="refresh-barrage";e.innerHTML='前缀';let t=document.getElementsByClassName("Barrage-toolbar")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Refresh_Barrage_Func(){document.getElementById("refresh-barrage").addEventListener("click",function(){if(current_barrage_status==0){current_barrage_status=1;setRefreshBarrage()}else{current_barrage_status=0;cancelRefreshBarrage()}saveData_Refresh()})}function refresh_Barrage_getStatus(){if(current_barrage_status==1){return true}else{return false}}function initPkg_Refresh_Barrage_Set(){let e=localStorage.getItem("ExSave_Refresh");if(e!=null){let t=JSON.parse(e);if("barrage"in t==false){t.barrage={status:false}}if(t.barrage.status==true){current_barrage_status=1;setRefreshBarrage()}}}function setRefreshBarrage(){let e=`\n .Barrage-listItem .Barrage-icon,.Barrage-listItem .FansMedal.is-made,.Barrage-listItem .RoomLevel,.Barrage-listItem .Motor,.Barrage-listItem .ChatAchievement,.Barrage-listItem .Barrage-hiIcon,.Barrage-listItem .Medal,.Barrage-listItem .MatchSystemTeamMedal{display:none !important;}\n /*.Barrage-listItem .UserLevel{display:none !important;}*/\n `;StyleHook_set("Ex_Style_RefreshBarrage",e)}function cancelRefreshBarrage(){StyleHook_remove("Ex_Style_RefreshBarrage")}function initPkg_Refresh_BarrageFrame(){initPkg_Refresh_BarrageFrame_Dom();initPkg_Refresh_BarrageFrame_Func();initPkg_Refresh_BarrageFrame_Set()}function initPkg_Refresh_BarrageFrame_Dom(){Refresh_BarrageFrame_insertIcon()}function Refresh_BarrageFrame_insertIcon(){let e=document.createElement("a");e.className="Barrage-toolbarLock";e.id="refresh-barrage-frame";e.innerHTML='拉高';let t=document.getElementsByClassName("Barrage-toolbar")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Refresh_BarrageFrame_Func(){document.getElementById("refresh-barrage-frame").addEventListener("click",function(){let e=document.getElementsByClassName("layout-Player-rank")[0];let t=document.getElementById("js-player-barrage");let n=document.getElementById("js-room-activity");if(e.style.display=="none"){e.style.display="block";t.style="";n.style.display="block";document.getElementById("refresh-barrage-frame__text").innerText="拉高"}else{let o=document.getElementsByClassName("layout-Player-announce")[0].offsetHeight;e.style.display="none";n.style.display="none";t.style="top:"+o+"px";document.getElementById("refresh-barrage-frame__text").innerText="恢复"}saveData_Refresh()})}function refresh_BarrageFrame_getStatus(){let e=document.getElementsByClassName("layout-Player-rank")[0];if(e.style.display=="none"){return true}else{return false}}function initPkg_Refresh_BarrageFrame_Set(){let e=localStorage.getItem("ExSave_Refresh");if(e!=null){let t=JSON.parse(e);if("barrageFrame"in t==false){t.barrageFrame={status:false}}if(t.barrageFrame.status==true){let e=document.getElementsByClassName("layout-Player-rank")[0];let t=document.getElementById("js-player-barrage");let n=document.getElementById("js-room-activity");let o=document.getElementsByClassName("layout-Player-announce")[0].offsetHeight;e.style.display="none";n.style.display="none";t.style="top:"+o+"px";document.getElementById("refresh-barrage-frame__text").innerText="恢复"}}}let video_num=0;function initPkg_Refresh_Video(){let e=setInterval(()=>{if(document.getElementsByClassName("right-e7ea5d").length>0){clearInterval(e);initPkg_Refresh_Video_Dom();initPkg_Refresh_Video_Func();initPkg_Refresh_Video_Set()}video_num++;if(video_num>=15){clearInterval(e)}},1500)}function initPkg_Refresh_Video_Dom(){Refresh_Video_insertIcon()}function Refresh_Video_insertIcon(){let e=document.createElement("div");e.id="refresh-video";e.title="视频区简洁模式";e.innerHTML='';let t=document.getElementsByClassName("right-e7ea5d")[0];t.insertBefore(e,t.childNodes[0]);e=document.createElement("div");e.id="refresh-video2";e.title="视频区简洁模式";e.innerHTML='';t=document.getElementsByClassName("PlayerToolbar")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Refresh_Video_Func(){document.getElementById("refresh-video").addEventListener("click",function(){let e=document.getElementsByClassName("PlayerToolbar-Content")[0];let t=document.getElementsByClassName("layout-Player-video")[0];let n=document.getElementById("refresh-video2");if(e.style.visibility=="hidden"){e.style.visibility="visible";t.style="";n.style.display="none";refresh_Video_removeStyle()}else{e.style.visibility="hidden";t.style="bottom:0;z-index:25";n.style.display="block";refresh_Video_setStyle()}saveData_Refresh()});document.getElementById("refresh-video2").addEventListener("click",function(){let e=document.getElementsByClassName("PlayerToolbar-Content")[0];let t=document.getElementsByClassName("layout-Player-video")[0];let n=document.getElementById("refresh-video2");if(e.style.visibility=="hidden"){e.style.visibility="visible";t.style="";n.style.display="none";refresh_Video_removeStyle()}else{e.style.visibility="hidden";t.style="bottom:0;z-index:25";n.style.display="block";refresh_Video_setStyle()}saveData_Refresh()})}function refresh_Video_getStatus(){let e=document.getElementsByClassName("PlayerToolbar-Content")[0];if(e.style.visibility=="hidden"){return true}else{return false}}function initPkg_Refresh_Video_Set(){let e=localStorage.getItem("ExSave_Refresh");if(e!=null){let t=JSON.parse(e);if("video"in t==false){t.video={status:false}}if(t.video.status==true){let e=document.getElementsByClassName("PlayerToolbar-Content")[0];let t=document.getElementsByClassName("layout-Player-video")[0];let n=document.getElementById("refresh-video2");e.style.visibility="hidden";t.style="bottom:0;z-index:25";n.style.display="block";refresh_Video_setStyle()}}}function refresh_Video_setStyle(){StyleHook_set("Ex_Style_VideoRefresh",`\n .RandomPKBar,.LiveRoomLoopVideo,.LiveRoomDianzan,.maiMaitView-68e80c,.PkView{display:none !important;}\n `)}function refresh_Video_removeStyle(){StyleHook_remove("Ex_Style_VideoRefresh")}function initPkg_RemoveAD(){let e=setInterval(()=>{let t=document.getElementsByClassName("PlayerToolbar-wealthNum")[0];if(t!=undefined){optimizePageStyle();removeChatLimit();clearInterval(e)}},1e3)}function removeAD(){StyleHook_set("Ex_Style_RemoveAD",`\n .CustomGroupGuide,.FudaiGiftToolBarTips,.UserInfo-tryEnterHiddenLead,.BargainingKit,.AnchorPocketTips,.FishShopTip,.FollowGuide,#js-bottom-right-cloudGame,.CloudGameLink,.RoomText-icon-horn,.RoomText-list,.Search-ad,.RedEnvelopAd,.noHandlerAd-0566b9,.PcDiversion,.DropMenuList-ad,.DropPane-ad,.WXTipsBox,.igl_bg-b0724a,.closure-ab91fb,.VideoAboveVivoAd,.pwd-990896,.css-widgetWrapper-EdVVC,.watermark-442a18,.FollowGuide-FadeOut,.MatchSystemChatRoomEntry-roomTabs,.FansMedalDialog-normal,.GameLauncher,.recommendAD-54569e,.recommendApp-0e23eb,.Title-ad,.Bottom-ad,.SignBarrage,.corner-ad-495ade,.SignBaseComponent-sign-ad,.SuperFansBubble,.is-noLogin,.PlayerToolbar-signCont,#js-widget,.Frawdroom,.HeaderGif-right,.HeaderGif-left,.liveos-workspace{display:none !important;}\n .Barrage-topFloater{z-index:999}\n .danmuAuthor-3d7b4a, .danmuContent-25f266{overflow: initial}\n .BattleShipTips{display:none !important;}\n .LastLiveTime,.recommendView-3e8b62{display:none !important;}\n .TurntableLottery-actTips{display:none !important;}\n .feedback-e27241{display:none !important;}\n .FansMedalEnter-maxFlag{display:none !important;}\n .Header-follow-listBox{max-height:640px !important;}\n\n .GuessGameMiniPanelB-wrapper{display:none !important;}\n\n .ZoomTip{display:none !important;}\n\n /*优化页面*/\n #js-barrage-list-parent{scrollbar-width: none;-ms-overflow-style: none;width:98%;height:100%}\n #js-barrage-list-parent::-webkit-scrollbar{display: none;}\n `)}function removeChatLimit(){let e;e=document.getElementsByClassName("ChatSend-button")[0];if(e!=undefined){e.className="ChatSend-button"}e=document.getElementsByClassName("ChatSend-txt")[0];if(e!=undefined){e.maxLength=e.maxLength+20}}function optimizePageStyle(){let e=document.getElementById("js-barrage-list").parentNode;e.id="js-barrage-list-parent"}function initPkg_Sign(){initPkg_Sign_Dom();initPkg_Sign_Func()}function initPkg_Sign_Func(){let e=new CClick(document.getElementsByClassName("ex-sign")[0]);e.click(()=>{initPkg_Sign_Main(false)});e.longClick(()=>{initPkg_Sign_Main(true)})}function initPkg_Sign_Dom(){Sign_insertIcon()}function Sign_insertIcon(){let e=document.createElement("div");e.className="ex-sign";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Sign_Main(e){initPkg_Sign_Yuba();initPkg_Sign_Client();initPkg_Sign_Motorcade();initPkg_Sign_Room(e);initPkg_Sign_Ad_Sign();initPkg_Sign_TV();initPkg_Sign_Yuba_Like();initPkg_Sign_Act()}function initPkg_Sign_Act(){getAct()}async function getAct(){let e=await getActList();e=JSON.parse(decodeURIComponent(escape(window.atob(e))));if("data"in e==false){return}for(let t=0;t{return e}).then(e=>{console.log("weekly:",e);if(e.data.is_sign=="1"){closePage()}else{fetch("https://msg.douyu.com/v3/msign/add?timestamp="+Math.random().toFixed(17),{method:"POST",mode:"cors",credentials:"include",headers:{"dy-device-id":"-","dy-client":"web","dy-csrf-token":getCookie("post-csrfToken"),"Content-Type":"application/x-www-form-urlencoded"},body:"to_mid="+n+"&expression="+String(Number(e.data.total)+1)}).then(e=>{return e}).then(e=>{if(Math.floor(e.status_code/100)==2){console.log("【车队】签到成功")}else{console.log(e.message)}closePage()}).catch(e=>{console.log("请求失败!",e);closePage()})}}).catch(e=>{console.log("请求失败!",e)})}function motorcadeConnect(){return new Promise(e=>{fetch("https://msg.douyu.com/v3/login/getusersig?t="+String((new Date).getTime())+"×tamp="+Math.random().toFixed(17),{method:"GET",mode:"cors",credentials:"include",headers:{"dy-device-id":"-","dy-client":"web","dy-csrf-token":getCookie("post-csrfToken"),"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{return e}).then(t=>{e(t)}).catch(e=>{console.log("请求失败!",e)})})}function motorcadeConnect2(e,t){let n="https://webim.tim.qq.com/v4/openim/login?identifier="+e+"&usersig="+t+"&contenttype=json&sdkappid=1400029396";return new Promise(e=>{GM_xmlhttpRequest({method:"POST",url:n,data:'{"State":"Online"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},onload:function(t){e(t.response)}})})}function getMotorcadeID(e,t,n){return new Promise(o=>{GM_xmlhttpRequest({method:"POST",url:"https://webim.tim.qq.com/v4/group_open_http_svc/get_joined_group_list?tinyid="+e+"&a2="+t+"&contenttype=json&sdkappid=1400029396",data:'{"Member_Account":"'+n+'"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){if(e.response.GroupIdList.length>0){o(e.response.GroupIdList[0].GroupId)}else{o("")}}})})}function initPkg_Sign_Room(e){signAllRoom(e)}function signAllRoom(e){let t=0;let n=0;let o=0;fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/list?page=1015",{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.json()}).then(i=>{t=Number(i.data.pageCount);for(let i=1;i<=t;i++){fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/list?page="+String(i),{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.json()}).then(t=>{let i=Number(t.data.list.length);for(let a=0;a{console.log("请求失败!",e)})}showMessage("【房间签到】"+i.data.total+"个房间正在签到中...","info")}).catch(e=>{console.log("请求失败!",e)})}function signRoom(e){GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/roomuserlevel/apinc/checkIn?client_sys=android",data:"rid="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded",token:dyToken,aid:"android1"},onload:function(e){}})}function initPkg_Sign_TV(){signTV()}function signTV(){let e=window.btoa(getDyDid());GM_xmlhttpRequest({method:"GET",url:"https://apitv.douyucdn.cn/user/sign/index?token="+dyToken+"&client_sys=android",responseType:"json",headers:{"User-Device":e},onload:function(e){let t=e.response;if(t.error=="0"){showMessage("【电视端】签到成功!获得100鱼丸","success")}else{showMessage("【电视端】"+t.data.msg,"warning")}}})}let signedYuba=0;let totalYuba=0;let doneYuba=0;function initPkg_Sign_Yuba(){signYubaList()}function signYubaFast(){GM_xmlhttpRequest({method:"POST",url:"https://mapi-yuba.douyu.com/wb/v3/fastSign",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded",client:"android",token:dyToken},onload:function(e){if(e.response.message==""&&e.response.data!=0){}else if(e.response.data==0){}else{}}})}function signYuba(e,t){GM_xmlhttpRequest({method:"POST",url:"https://yuba.douyu.com/ybapi/topic/sign",data:"group_id="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded","dy-client":"pc","dy-token":t,Referer:"https://yuba.douyu.com/group/"+e},onload:function(t){doneYuba++;if(t.response.message==""){signedYuba++}else{}getSupplementaryNums(e).then(async t=>{if(t.status_code=="200"){let n=t.data.supplementary_cards;for(let t=0;t0){if(totalYuba-signedYuba==0){showMessage("【鱼吧】"+String(signedYuba)+"个鱼吧签到完成","success")}else{showMessage("【鱼吧】"+String(signedYuba)+"个鱼吧签到完成,"+String(totalYuba-signedYuba)+"个鱼吧已签到","success")}}else{showMessage("【鱼吧】"+String(totalYuba)+"个鱼吧已签到","warning")}signedYuba=null;totalYuba=null;doneYuba=null}}})}async function signYubaList(){let e=[];let t=await getYubaPage(1);e=e.concat(t.list);let n=Number(t.count_page)-1;if(n>=1){for(let o=0;o{GM_xmlhttpRequest({method:"GET",url:"https://yuba.douyu.com/wbapi/web/group/myFollow?page="+String(e)+"&limit=30",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded","dy-client":"pc","dy-token":dyToken},onload:function(e){t(e.response.data)}})})}function getSupplementaryNums(e){return new Promise(t=>{GM_xmlhttpRequest({method:"GET",url:"https://yuba.douyu.com/wbapi/web/signDetail?group_id="+e,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded","dy-client":"pc","dy-token":dyToken},onload:function(e){t(e.response)}})})}function signSupplementary(e){return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"https://mapi-yuba.douyu.com/wb/v3/supplement",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded",client:"android",token:dyToken},data:"group_id="+e,onload:function(e){t(e.response)}})})}function initPkg_Sign_Yuba_Like(){likeYuba()}function likeYuba(){let e="502737841569427537";likeYubaPost(e,"-1").then(()=>{likeYubaPost(e,"1")});showMessage("【鱼吧点赞】已完成","success")}function likeYubaPostComment(e,t,n){let o=`pid=${e}&comment_id=${t}&type=${n}`;return new Promise(e=>{GM_xmlhttpRequest({method:"POST",url:"https://yuba.douyu.com/ybapi/follow/like",data:o,responseType:"json",headers:{"dy-token":dyToken,"dy-client":"pc","Content-Type":"application/x-www-form-urlencoded",Referer:"https://yuba.douyu.com/p/502737841569427537"},onload:function(t){let n=t.response;e(n)}})})}function likeYubaPost(e,t){let n=`pid=${e}&type=${t}`;return new Promise(t=>{GM_xmlhttpRequest({method:"POST",url:"https://yuba.douyu.com/ybapi/follow/like",data:n,responseType:"json",headers:{"dy-token":dyToken,"dy-client":"pc","Content-Type":"application/x-www-form-urlencoded",Referer:"https://yuba.douyu.com/p/"+e},onload:function(e){let n=e.response;t(n)}})})}var _hmt=_hmt||[];function initPkg_Statistics(){let e=document.createElement("script");e.src="https://hm.baidu.com/hm.js?4dc4fb0549a56fe03ba53c022b1ff455";let t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)}var curVersion="2021.04.07.03";var isNeedUpdate=false;var lastestVersion="";function initPkg_Update(){initPkg_Update_Dom();initPkg_Update_Func();if(isNeedUpdate){Update_showTip(true)}}function initPkg_Update_Dom(){Update_insertIcon()}function Update_insertIcon(){let e=document.createElement("div");e.className="ex-update";e.innerHTML='';let t=document.getElementsByClassName("ex-panel__wrap")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_Update_Func(){document.getElementsByClassName("ex-update")[0].addEventListener("click",Update_openUpdatePage)}function checkUpdate_Src(){return new Promise((e,t)=>{fetch("https://www.douyuex.com/src/douyuex_version.txt",{method:"GET",mode:"cors",cache:"no-store",credentials:"omit"}).then(e=>{return e.text()}).then(t=>{if(t!=undefined){if(t!=curVersion){e([true,t])}}e(false)}).catch(e=>{console.error("请求失败",e);t()})})}function checkUpdate_GreasyFork(){return new Promise((e,t)=>{fetch("https://greasyfork.org/zh-CN/scripts/394497",{method:"GET",mode:"cors",cache:"no-store",credentials:"omit"}).then(e=>{return e.text()}).then(t=>{t=(new DOMParser).parseFromString(t,"text/html");let n=t.getElementsByClassName("script-show-version")[1];if(n!=undefined){if(n.innerText!=curVersion){e([true,n.innerText])}}e(false)}).catch(e=>{console.error("请求失败",e);t()})})}async function Update_checkVersion(e=false){let t=[];t=await checkUpdate_Src().catch(async n=>{t=await checkUpdate_GreasyFork().catch(n=>{t=[false,curVersion];isNeedUpdate=t[0];lastestVersion=t[1];if(isNeedUpdate){Update_showMessage()}else{if(e){showMessage(`【版本更新】当前版本${curVersion}已为最新`,"success")}}})});isNeedUpdate=t[0];lastestVersion=t[1];if(isNeedUpdate){Update_showMessage()}else{if(e){showMessage(`【版本更新】当前版本${curVersion}已为最新`,"success")}}}function Update_openUpdatePage(){openPage("https://www.douyuex.com/install/web.html",true)}function Update_showTip(e){let t=document.getElementById("ex-update__tip");if(e==true){if(t.style.display!="block"){t.style.display="block"}}else{t.style.display="none"}}function Update_showMessage(){let e=`【版本更新】最新版本:${lastestVersion},点击官方源或者GreasyFork源更新`;showMessage(e,"error")}function initPkg_VideoTools_Cinema(){initPkg_VideoTools_Cinema_Dom();initPkg_VideoTools_Cinema_Func()}function initPkg_VideoTools_Cinema_Dom(){Cinema_insertIcon()}function Cinema_insertIcon(){let e=document.createElement("div");e.id="ex-cinema";e.innerHTML=`\n
\n
\n
    \n
  • 默认
  • \n
  • 剪裁
  • \n
  • 拉伸
  • \n
\n
\n
\n \n `;let t=document.getElementsByClassName("right-e7ea5d")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_VideoTools_Cinema_Func(){document.getElementById("ex-cinema").addEventListener("mouseover",function(){document.getElementsByClassName("cinema__wrap")[0].style.display="block";document.getElementsByClassName("videospeed__wrap")[0].style.display="none";document.getElementsByClassName("filter__wrap")[0].style.display="none"});document.getElementsByClassName("cinema__wrap")[0].addEventListener("mouseout",function(){document.getElementsByClassName("cinema__wrap")[0].style.display="none"});document.getElementById("cinema__default").addEventListener("click",()=>{StyleHook_remove("Ex_Style_Cinema");document.getElementsByClassName("cinema__wrap")[0].style.display="none"});document.getElementById("cinema__cover").addEventListener("click",()=>{setVideoCinemaMode("cover");document.getElementsByClassName("cinema__wrap")[0].style.display="none"});document.getElementById("cinema__fill").addEventListener("click",()=>{setVideoCinemaMode("fill");document.getElementsByClassName("cinema__wrap")[0].style.display="none"})}function setVideoCinemaMode(e){let t=String(parseInt(liveVideoNode.style.width)/2.39)+"px";StyleHook_remove("Ex_Style_Cinema");let n=`\n .layout-Player-videoEntity video{object-fit:${e} !important;height:${t} !important;}\n `;StyleHook_set("Ex_Style_Cinema",n)}let currentBrightness="";let currentContrast="";let currentSaturate="";let liveVideoParentClassName="";function initPkg_VideoTools_Filter(){liveVideoParentClassName=liveVideoNode.parentNode.className;initPkg_VideoTools_Filter_Dom();initPkg_VideoTools_Filter_Func()}function initPkg_VideoTools_Filter_Dom(){Filter_insertIcon()}function Filter_insertIcon(){let e=document.createElement("div");e.id="ex-filter";e.innerHTML=`\n
\n
\n
\n 明亮度\n
\n
\n
\n
\n
\n
\n 对比度\n
\n
\n
\n
\n
\n
\n 饱和度\n
\n
\n
\n
\n
\n
\n

滤镜

\n \n
\n
    \n
  • 镜像画面
  • \n
  • 重置
  • \n
\n
\n
\n \n `;let t=document.getElementsByClassName("right-e7ea5d")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_VideoTools_Filter_Func(){document.onmouseup=function(){document.onmousemove=null};setScrollFunc(document.getElementById("scroll__bright"),document.getElementById("bar__bright"),document.getElementById("mask__bright"),e=>{currentBrightness=`brightness(${e}%)`;liveVideoNode.style.filter=`${currentBrightness} ${currentContrast} ${currentSaturate}`});setScrollFunc(document.getElementById("scroll__contrast"),document.getElementById("bar__contrast"),document.getElementById("mask__contrast"),e=>{currentContrast=`contrast(${e}%)`;liveVideoNode.style.filter=`${currentBrightness} ${currentContrast} ${currentSaturate}`});setScrollFunc(document.getElementById("scroll__saturate"),document.getElementById("bar__saturate"),document.getElementById("mask__saturate"),e=>{currentSaturate=`saturate(${e}%)`;liveVideoNode.style.filter=`${currentBrightness} ${currentContrast} ${currentSaturate}`});document.getElementById("ex-filter").addEventListener("mouseover",function(){document.getElementsByClassName("filter__wrap")[0].style.display="block";document.getElementsByClassName("videospeed__wrap")[0].style.display="none";document.getElementsByClassName("cinema__wrap")[0].style.display="none"});document.getElementsByClassName("filter__wrap")[0].addEventListener("mouseleave",function(){document.getElementsByClassName("filter__wrap")[0].style.display="none"});document.getElementById("filter__reset").addEventListener("click",()=>{StyleHook_remove("Ex_Style_Filter");document.getElementById("filter__select").selectedIndex=0;liveVideoNode.style.filter="";liveVideoNode.parentNode.style.transform="";document.getElementById("bar__bright").style.left="100px";document.getElementById("bar__contrast").style.left="100px";document.getElementById("bar__saturate").style.left="100px";document.getElementById("mask__bright").style.width="100px";document.getElementById("mask__contrast").style.width="100px";document.getElementById("mask__saturate").style.width="100px"});document.getElementById("filter__mirror").addEventListener("click",()=>{if(liveVideoNode.parentNode.style.transform==""){liveVideoNode.parentNode.style.transform="rotateY(180deg)"}else{liveVideoNode.parentNode.style.transform=""}});document.getElementById("filter__select").onchange=function(){let e=this.options[this.selectedIndex].text;switch(e){case"default":StyleHook_remove("Ex_Style_Filter");break;case"1977":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(110%)brightness(110%)saturate(130%);filter:contrast(110%)brightness(110%)saturate(130%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:screen;background:rgba(243,106,188,0.3);z-index:10}`);break;case"Aden":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(90%)brightness(120%)saturate(85%)hue-rotate(20deg);filter:contrast(90%)brightness(120%)saturate(85%)hue-rotate(20deg)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:darken;background:-webkit-linear-gradient(to right,rgba(66,10,14,0.2)1,rgba(66,10,14,0));background:linear-gradient(to right,rgba(66,10,14,0.2)1,rgba(66,10,14,0));z-index:10}`);break;case"Amaro":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(90%)brightness(110%)saturate(150%)hue-rotate(-10deg);filter:contrast(90%)brightness(110%)saturate(150%)hue-rotate(-10deg)}`);break;case"Brannan":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(140%)sepia(50%);filter:contrast(140%)sepia(50%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:lighten;background:rgba(161,44,199,0.31);z-index:10}`);break;case"Brooklyn":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(90%)brightness(110%);filter:contrast(90%)brightness(110%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:overlay;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(168,223,193,0.4)1,rgba(183,196,200,0.2));background:radial-gradient(50%50%,circle closest-corner,rgba(168,223,193,0.4)1,rgba(183,196,200,0.2));z-index:10}`);break;case"Claredon":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(120%)saturate(125%);filter:contrast(120%)saturate(125%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:overlay;background:rgba(127,187,227,0.2);z-index:10}`);break;case"Earlybird":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(90%)sepia(20%);filter:contrast(90%)sepia(20%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:overlay;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(208,186,142,1)20,rgba(29,2,16,0.2));background:radial-gradient(50%50%,circle closest-corner,rgba(208,186,142,1)20,rgba(29,2,16,0.2));z-index:10}`);break;case"Gingham":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:brightness(105%)hue-rotate(350deg);filter:brightness(105%)hue-rotate(350deg)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:darken;background:-webkit-linear-gradient(to right,rgba(66,10,14,0.2)1,rgba(0,0,0,0));background:linear-gradient(to right,rgba(66,10,14,0.2)1,rgba(0,0,0,0));z-index:10}`);break;case"Hudson":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(90%)brightness(120%)saturate(110%);filter:contrast(90%)brightness(120%)saturate(110%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:multiply;opacity:0.5;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(255,177,166,1)50,rgba(52,33,52,1));background:radial-gradient(50%50%,circle closest-corner,rgba(255,177,166,1)50,rgba(52,33,52,1));z-index:10}`);break;case"Inkwell":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(110%)brightness(110%)sepia(30%)grayscale(100%);filter:contrast(110%)brightness(110%)sepia(30%)grayscale(100%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;background:rgba(0,0,0,0);z-index:10}`);break;case"Lofi":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(150%)saturate(110%);filter:contrast(150%)saturate(110%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:multiply;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(0,0,0,0)70,rgba(34,34,34,1));background:radial-gradient(50%50%,circle closest-corner,rgba(0,0,0,0)70,rgba(34,34,34,1));z-index:10}`);break;case"Maven":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(95%)brightness(95%)saturate(150%)sepia(25%);filter:contrast(95%)brightness(95%)saturate(150%)sepia(25%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:hue;background:rgba(3,230,26,0.2);z-index:10}`);break;case"Perpetua":setVideoFilter(`.${liveVideoParentClassName}{position:relative}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:soft-light;opacity:0.5;background:-webkit-linear-gradient(to bottom,rgba(0,91,154,1)1,rgba(61,193,230,0));background:linear-gradient(to bottom,rgba(0,91,154,1)1,rgba(61,193,230,0));z-index:10}`);break;case"Reyes":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(85%)brightness(110%)saturate(75%)sepia(22%);filter:contrast(85%)brightness(110%)saturate(75%)sepia(22%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:soft-light;opacity:0.5;background:rgba(173,205,239,1);z-index:10}`);break;case"Stinson":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(75%)brightness(115%)saturate(85%);filter:contrast(75%)brightness(115%)saturate(85%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:soft-light;background:rgba(240,149,128,0.2);z-index:10}`);break;case"Toaster":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(150%)brightness(90%);filter:contrast(150%)brightness(90%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:screen;opacity:0.5;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(15,78,128,1)1,rgba(59,0,59,1));background:radial-gradient(50%50%,circle closest-corner,rgba(15,78,128,1)1,rgba(59,0,59,1));z-index:10}`);break;case"Walden":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:brightness(110%)saturate(160%)sepia(30%)hue-rotate(350deg);filter:brightness(110%)saturate(160%)sepia(30%)hue-rotate(350deg)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:screen;opacity:0.3;background:rgba(204,68,0,1);z-index:10}`);break;case"Valencia":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:contrast(108%)brightness(108%)sepia(8%);filter:contrast(108%)brightness(108%)sepia(8%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:exclusion;opacity:0.5;background:rgba(58,3,57,1);z-index:10}`);break;case"Xpro2":setVideoFilter(`.${liveVideoParentClassName}{position:relative;-webkit-filter:sepia(30%);filter:sepia(30%)}.${liveVideoParentClassName}::before{content:"";display:block;height:100%;width:100%;top:0;left:0;position:absolute;pointer-events:none;mix-blend-mode:color-burn;background:-webkit-radial-gradient(50%50%,circle closest-corner,rgba(224,231,230,1)40,rgba(43,42,161,0.6));background:radial-gradient(50%50%,circle closest-corner,rgba(224,231,230,1)40,rgba(43,42,161,0.6));z-index:10}`);break;default:StyleHook_remove("Ex_Style_Filter");break}}}function setVideoFilter(e){StyleHook_remove("Ex_Style_Filter");StyleHook_set("Ex_Style_Filter",e);document.getElementsByClassName("filter__wrap")[0].style.display="none"}function setScrollFunc(e,t,n,o){let i=e;let a=t;let l=n;let s=0;a.onmousedown=function(e){let t=e||window.event;let n=t.clientX-this.offsetLeft;let r=this;document.onmousemove=function(e){let t=e||window.event;s=t.clientX-n;if(s<0)s=0;else if(s>i.offsetWidth-a.offsetWidth)s=i.offsetWidth-a.offsetWidth;l.style.width=s+"px";r.style.left=s+"px";o(parseInt(s/(i.offsetWidth-a.offsetWidth)*255));window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}}}function initPkg_VideoTools_VideoRecall(){initPkg_VideoTools_VideoRecall_Func()}function initPkg_VideoTools_VideoRecall_Func(){document.getElementsByClassName("layout-Player-video")[0].addEventListener("keydown",e=>{if(isInput==true){return}if(e.keyCode==37){liveVideoNode.currentTime+=-3}else if(e.keyCode==39){liveVideoNode.currentTime+=3}})}function initPkg_VideoTools_VideoSpeed(){initPkg_VideoTools_VideoSpeed_Dom();initPkg_VideoTools_VideoSpeed_Func()}function initPkg_VideoTools_VideoSpeed_Dom(){VideoSpeed_insertIcon()}function VideoSpeed_insertIcon(){let e=document.createElement("div");e.id="ex-videospeed";e.innerHTML=`\n
\n
\n
    \n
  • 2.0x
  • \n
  • 1.5x
  • \n
  • 1.25x
  • \n
  • 1.0x
  • \n
  • 0.75x
  • \n
  • 0.5x
  • \n
\n
\n
\n \n `;let t=document.getElementsByClassName("right-e7ea5d")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_VideoTools_VideoSpeed_Func(){document.getElementById("ex-videospeed").addEventListener("mouseover",function(){document.getElementsByClassName("videospeed__wrap")[0].style.display="block";document.getElementsByClassName("cinema__wrap")[0].style.display="none";document.getElementsByClassName("filter__wrap")[0].style.display="none"});document.getElementsByClassName("videospeed__wrap")[0].addEventListener("mouseout",function(){document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__2.0").addEventListener("click",()=>{liveVideoNode.playbackRate=2;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__1.5").addEventListener("click",()=>{liveVideoNode.playbackRate=1.5;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__1.25").addEventListener("click",()=>{liveVideoNode.playbackRate=1.25;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__1.0").addEventListener("click",()=>{liveVideoNode.playbackRate=1;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__0.75").addEventListener("click",()=>{liveVideoNode.playbackRate=.75;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"});document.getElementById("videospeed__0.5").addEventListener("click",()=>{liveVideoNode.playbackRate=.5;document.getElementsByClassName("videospeed__wrap")[0].style.display="none"})}function initPkg_VideoTools_VideoSync(){initPkg_VideoTools_VideoSync_Dom();initPkg_VideoTools_VideoSync_Func()}function initPkg_VideoTools_VideoSync_Dom(){VideoSync_insertIcon()}function VideoSync_insertIcon(){let e=document.createElement("div");e.id="ex-videosync";e.title="同步时间";e.innerHTML=`\n \n `;let t=document.getElementsByClassName("left-d3671e")[0];t.insertBefore(e,t.childNodes[3])}function initPkg_VideoTools_VideoSync_Func(){document.getElementById("ex-videosync").addEventListener("click",()=>{setVideoSync()})}function setVideoSync(){let e=liveVideoNode.buffered;if(e.length==0){return}liveVideoNode.currentTime=e.end(0)}var liveVideoNode;var isInput=false;let videotools_num=0;function initPkg_VideoTools(){let e=setInterval(()=>{if(document.getElementsByClassName("right-e7ea5d").length>0){clearInterval(e);liveVideoNode=document.querySelector(".layout-Player-videoEntity video");initPkg_VideoTools_Module();initPkg_VideoTools_Func()}videotools_num++;if(videotools_num>=15){clearInterval(e)}},1500)}function initPkg_VideoTools_Module(){initPkg_VideoTools_VideoSpeed();initPkg_VideoTools_Cinema();initPkg_VideoTools_VideoSync();initPkg_VideoTools_VideoRecall();initPkg_VideoTools_Filter()}function initPkg_VideoTools_Func(){document.getElementById("js-player-toolbar").addEventListener("mouseover",()=>{document.getElementsByClassName("cinema__wrap")[0].style.display="none";document.getElementsByClassName("videospeed__wrap")[0].style.display="none";document.getElementsByClassName("filter__wrap")[0].style.display="none"});document.getElementById("js-player-asideMain").addEventListener("mouseover",()=>{document.getElementsByClassName("cinema__wrap")[0].style.display="none";document.getElementsByClassName("videospeed__wrap")[0].style.display="none";document.getElementsByClassName("filter__wrap")[0].style.display="none"});document.getElementsByClassName("inputView-2a65aa")[0].addEventListener("focus",()=>{isInput=true});document.getElementsByClassName("inputView-2a65aa")[0].addEventListener("blur",()=>{isInput=false});let e=new DomHook(".app-f0f9c7",false,e=>{if(e.length>0){if(e[0].addedNodes.length>0){isInput=true}else if(e[0].removedNodes.length>0){isInput=false}}})}function doSign(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/hostSnowSign/doSign",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`actAlias=${e}&token=${dyToken}&ctn=${getCCN()}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function signAct(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/signAct/signIn",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"token="+dyToken+"&signAlias="+e}).then(e=>{return e.json()}).then(e=>{t(e)})})}function userStatus(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/actTask/userStatus",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`tasks=${e}&token=${dyToken}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function takeActPrize(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/actTask/takePrize",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`token=${dyToken}&aid=android&taskAlias=${e}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function addFollowRoom(e){return new Promise(t=>{fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/add",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`rid=${e}&ctn=${getCCN()}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function removeFollowRoom(e){return new Promise(t=>{fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/rm",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`rid=${e}&ctn=${getCCN()}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function shareAct(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/common/share",{method:"POST",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`actAlias=${e}&token=${dyToken}`}).then(e=>{return e.json()}).then(e=>{t(e)}).catch(e=>{console.log("请求失败!",e)})})}function getJackpot(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/lottery/jackpot",{method:"POST",headers:{"Content-Type":"application/json;charset=UTF-8"},body:`{"activityId":"${e}","token":"${dyToken}"}`}).then(e=>{return e.json()}).then(e=>{t(e)})})}function getActRemaining(e){return new Promise(t=>{fetch("https://www.douyu.com/japi/carnival/nc/lottery/remaining?activityId="+e,{method:"GET",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/json;charset=UTF-8"}}).then(e=>{return e.json()}).then(e=>{t(e)})})}function getActList(){return new Promise(e=>{fetch("https://www.douyuex.com/src/actList.txt",{method:"GET",mode:"cors",cache:"no-store",credentials:"omit"}).then(e=>{return e.text()}).then(t=>{e(t)}).catch(e=>{console.error("请求失败",e)})})}class CClick{constructor(e){const t=700;const n=250;this.func_click=null;this.func_dbClick=null;this.func_longClick=null;let o=false;let i;let a=0;let l;e.onmousedown=(e=>{if(e.button!==0){return}o=false;i=setTimeout(()=>{o=true;if(this.func_longClick!==null){this.func_longClick(e)}},t)});e.onmouseup=(e=>{if(e.button!==0){return}if(o==false){clearTimeout(i);a++;if(a>=2){clearTimeout(l);a=0;if(this.func_dbClick!==null){this.func_dbClick(e)}return}l=setTimeout(()=>{a=0;if(this.func_click!==null){this.func_click(e)}},n)}})}click(e){this.func_click=e}dbClick(e){this.func_dbClick=e}longClick(e){this.func_longClick=e}}class DomHook{constructor(e,t,n){this.selector=e;this.isSubtree=t;let o=document.querySelector(this.selector);if(o==null){return}let i=new MutationObserver(function(e){n(e)});this.observer=i;this.observer.observe(o,{attributes:true,childList:true,subtree:this.isSubtree})}closeHook(){this.observer.disconnect()}}class DyWacthAd{constructor(e,t,n){this.posid=e;this.token=t;this.rid=n;this._uid=String(t).split("_")[0];this._mid=0;this._infoBack=""}async start(){let e=await this.getInfo(this.posid,this.token,this.rid);if(e==false){return false}this._mid=e.mid;this._infoBack=e.infoBack;let t=await this.getStart(this.posid,this.token,this._uid,this._mid,this._infoBack);return t}async finish(){let e=await this.getFinish(this.posid,this.token,this._uid,this._mid,this._infoBack);return e}getInfo(e,t,n){return new Promise(o=>{GM_xmlhttpRequest({method:"POST",url:"https://rtbapi.douyucdn.cn/japi/sign/app/getinfo?token="+t+"&mdid=phone"+"&client_sys=android",data:"posid="+e+"&roomid="+n+"&cate1=1&cate2=1&chanid=30"+'&device={"nt":"1"}',responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data.length==0){o(false);return}let e=t.data[0].mid;let n=encodeURIComponent(JSON.stringify(t.data));o({mid:e,infoBack:n})}}})})}getStart(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/start?client_sys=android",data:"&uid="+n+"&roomId="+rid+"&posCode="+e+"&token="+t+"&clientType=1&creativeId="+o+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){a(true)}}})})}getFinish(e,t,n,o,i){return new Promise(a=>{GM_xmlhttpRequest({method:"POST",url:"https://apiv2.douyucdn.cn/japi/inspire/api/ad/fishpond/mobile/finish?client_sys=android",data:"uid="+n+"&clientType=1&posCode="+e+"&creativeId="+o+"&roomId="+rid+"&token="+t+"&infoBack="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(t.error=="0"){if(t.data=="1"){a(true)}else{a(false)}}else{a(false)}}})})}}var hexcase=0;var b64pad="";var chrsz=8;function hex_md5(e){return binl2hex(core_md5(str2binl(e),e.length*chrsz))}function b64_md5(e){return binl2b64(core_md5(str2binl(e),e.length*chrsz))}function str_md5(e){return binl2str(core_md5(str2binl(e),e.length*chrsz))}function hex_hmac_md5(e,t){return binl2hex(core_hmac_md5(e,t))}function b64_hmac_md5(e,t){return binl2b64(core_hmac_md5(e,t))}function str_hmac_md5(e,t){return binl2str(core_hmac_md5(e,t))}function md5_vm_test(){return hex_md5("abc")=="900150983cd24fb0d6963f7d28e17f72"}function core_md5(e,t){e[t>>5]|=128<>>9<<4)+14]=t;var n=1732584193;var o=-271733879;var i=-1732584194;var a=271733878;for(var l=0;l16)n=core_md5(n,e.length*chrsz);var o=Array(16),i=Array(16);for(var a=0;a<16;a++){o[a]=n[a]^909522486;i[a]=n[a]^1549556828}var l=core_md5(o.concat(str2binl(t)),512+t.length*chrsz);return core_md5(i.concat(l),512+128)}function safe_add(e,t){var n=(e&65535)+(t&65535);var o=(e>>16)+(t>>16)+(n>>16);return o<<16|n&65535}function bit_rol(e,t){return e<>>32-t}function str2binl(e){var t=Array();var n=(1<>5]|=(e.charCodeAt(o/chrsz)&n)<>5]>>>o%32&n);return t}function binl2hex(e){var t=hexcase?"0123456789ABCDEF":"0123456789abcdef";var n="";for(var o=0;o>2]>>o%4*8+4&15)+t.charAt(e[o>>2]>>o%4*8&15)}return n}function binl2b64(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var n="";for(var o=0;o>2]>>8*(o%4)&255)<<16|(e[o+1>>2]>>8*((o+1)%4)&255)<<8|e[o+2>>2]>>8*((o+2)%4)&255;for(var a=0;a<4;a++){if(o*8+a*6>e.length*32)n+=b64pad;else n+=t.charAt(i>>6*(3-a)&63)}}return n}(function e(t,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define("NoticeJs",[],n);else if(typeof exports==="object")exports["NoticeJs"]=n();else t["NoticeJs"]=n()})(typeof self!=="undefined"?self:this,function(){return function(e){var t={};function n(o){if(t[o]){return t[o].exports}var i=t[o]={i:o,l:false,exports:{}};e[o].call(i.exports,i,i.exports,n);i.l=true;return i.exports}n.m=e;n.c=t;n.d=function(e,t,o){if(!n.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:o})}};n.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="dist/";return n(n.s=2)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var o=t.noticeJsModalClassName="noticejs-modal";var i=t.closeAnimation="noticejs-fadeOut";var a=t.Defaults={title:"",text:"",type:"success",position:"topRight",timeout:30,progressBar:true,closeWith:["button"],animation:null,modal:false,scroll:{maxHeight:300,showOnHover:true},rtl:false,callbacks:{beforeShow:[],onShow:[],afterShow:[],onClose:[],afterClose:[],onClick:[],onHover:[],onTemplate:[]}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.appendNoticeJs=t.addListener=t.CloseItem=t.AddModal=undefined;t.getCallback=s;var o=n(0);var i=a(o);function a(e){if(e&&e.__esModule){return e}else{var t={};if(e!=null){for(var n in e){if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]}}t.default=e;return t}}var l=i.Defaults;function s(e,t){if(e.callbacks.hasOwnProperty(t)){e.callbacks[t].forEach(function(t){if(typeof t==="function"){t.apply(e)}})}}var r=t.AddModal=function e(){if(document.getElementsByClassName(i.noticeJsModalClassName).length<=0){var t=document.createElement("div");t.classList.add(i.noticeJsModalClassName);t.classList.add("noticejs-modal-open");document.body.appendChild(t);setTimeout(function(){t.className=i.noticeJsModalClassName},200)}};var d=t.CloseItem=function e(t){s(l,"onClose");if(l.animation!==null&&l.animation.close!==null){t.className+=" "+l.animation.close}setTimeout(function(){t.remove()},200);if(l.modal===true&&document.querySelectorAll("[noticejs-modal='true']").length>=1){document.querySelector(".noticejs-modal").className+=" noticejs-modal-close";setTimeout(function(){document.querySelector(".noticejs-modal").remove()},500)}var n="."+t.closest(".noticejs").className.replace("noticejs","").trim();setTimeout(function(){if(document.querySelectorAll(n+" .item").length<=0){let e=document.querySelector(n);if(e!=null){e.remove()}}},500)};var c=t.addListener=function e(t){if(l.closeWith.includes("button")){t.querySelector(".close").addEventListener("click",function(){d(t)})}if(l.closeWith.includes("click")){t.style.cursor="pointer";t.addEventListener("click",function(e){if(e.target.className!=="close"){s(l,"onClick");d(t)}})}else{t.addEventListener("click",function(e){if(e.target.className!=="close"){s(l,"onClick")}})}t.addEventListener("mouseover",function(){s(l,"onHover")})};var u=t.appendNoticeJs=function e(t,n,o){var i=".noticejs-"+l.position;var a=document.createElement("div");a.classList.add("item");a.classList.add(l.type);if(l.rtl===true){a.classList.add("noticejs-rtl")}if(t&&t!==""){a.appendChild(t)}a.appendChild(n);if(o&&o!==""){a.appendChild(o)}if(["top","bottom"].includes(l.position)){document.querySelector(i).innerHTML=""}if(l.animation!==null&&l.animation.open!==null){a.className+=" "+l.animation.open}if(l.modal===true){a.setAttribute("noticejs-modal","true");r()}c(a,l.closeWith);s(l,"beforeShow");s(l,"onShow");document.querySelector(i).appendChild(a);s(l,"afterShow");return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var o=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};p(this,e);this.options=Object.assign(s.Defaults,t);this.component=new r.Components;this.on("beforeShow",this.options.callbacks.beforeShow);this.on("onShow",this.options.callbacks.onShow);this.on("afterShow",this.options.callbacks.afterShow);this.on("onClose",this.options.callbacks.onClose);this.on("afterClose",this.options.callbacks.afterClose);this.on("onClick",this.options.callbacks.onClick);this.on("onHover",this.options.callbacks.onHover);return this}o(e,[{key:"show",value:function e(){var t=this.component.createContainer();if(document.querySelector(".noticejs-"+this.options.position)===null){document.body.appendChild(t)}var n=void 0;var o=void 0;var i=void 0;n=this.component.createHeader(this.options.title,this.options.closeWith);o=this.component.createBody(this.options.text);if(this.options.progressBar===true){i=this.component.createProgressBar()}var a=c.appendNoticeJs(n,o,i);return a}},{key:"on",value:function e(t){var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:function(){};if(typeof n==="function"&&this.options.callbacks.hasOwnProperty(t)){this.options.callbacks[t].push(n)}return this}}]);return e}();t.default=g;e.exports=t["default"]},function(e,t){},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Components=undefined;var o=function(){function e(e,t){for(var n=0;n'+'
'+'×'+''+""+this.textTemplate.title+""+""+"
"+'
'+''+this.textTemplate.content+""+"
"+'"+"
"+"";return e},getConfirmTemplate:function(){return'
'+'
'+'
'+'
'+'×'+''+""+this.textTemplate.title+""+""+"
"+'
'+''+this.textTemplate.content+"?"+"
"+'"+"
"+"
"+"
"},getPromptTemplate:function(){return'
'+'
'+'
'+'
'+'×'+''+""+this.textTemplate.title+""+""+"
"+'
'+''+"
"+'"+"
"+"
"+"
"},alert:function(e){this.textTemplate.title=e.title||this.textTemplate.title;this.textTemplate.content=e.content||this.textTemplate.content;this.textTemplate.okBtn=e.okBtn||this.textTemplate.okBtn;this.textTemplate.okBtnColor=e.okBtnColor||this.textTemplate.okBtnColor;this.textTemplate.contentColor=e.contentColor||this.textTemplate.contentColor;var t=document.createElement("div"),n=this;t.className=this.containerClass;t.innerHTML=this.getAlertTemplate();this.box=t;document.body.appendChild(this.box);var o=document.getElementsByClassName("btn-footer-ok");o[o.length-1].focus();o[o.length-1].onclick=function(){if(e.onConfirm){e.onConfirm()}n.removeBox()}},confirm:function(e){this.textTemplate.title=e.title||this.textTemplate.promptTitle;this.textTemplate.promptPlaceholder=e.promptPlaceholder||this.textTemplate.promptPlaceholder;this.textTemplate.okBtn=e.okBtn||this.textTemplate.promptOkBtn;this.textTemplate.okBtnColor=e.okBtnColor||this.textTemplate.okBtnColor;this.textTemplate.cancelBtn=e.cancelBtn||this.textTemplate.cancelBtn;this.textTemplate.cancelBtnColor=e.cancelBtnColor||this.textTemplate.cancelBtnColor;this.textTemplate.content=e.content||this.textTemplate.content;var t=document.createElement("div"),n=this;this.box=t;t.className=this.containerClass;t.innerHTML=this.getConfirmTemplate();document.body.appendChild(t);var o=document.getElementsByClassName("btn-footer-ok");o[o.length-1].focus();o[o.length-1].onclick=function(){if(e.onConfirm){e.onConfirm()}n.removeBox()};var i=document.getElementsByClassName("btn-footer-cancel");i[i.length-1].onclick=function(){if(e.onCancel){e.onCancel()}n.removeBox()}},prompt:function(e){this.textTemplate.title=e.title||this.textTemplate.title;this.textTemplate.content=e.content||this.textTemplate.content;this.textTemplate.contentColor=e.contentColor||this.textTemplate.contentColor;this.textTemplate.okBtn=e.okBtn||this.textTemplate.okBtn;this.textTemplate.okBtnColor=e.okBtnColor||this.textTemplate.okBtnColor;this.textTemplate.cancelBtn=e.cancelBtn||this.textTemplate.cancelBtn;this.textTemplate.cancelBtnColor=e.cancelBtnColor||this.textTemplate.cancelBtnColor;var t=document.createElement("div"),n=this;t.className=this.containerClass;t.innerHTML=this.getPromptTemplate();this.box=t;document.body.appendChild(t);var o=document.getElementsByClassName("postbird-prompt-input");o=o[o.length-1];o.focus();var i=document.getElementsByClassName("btn-footer-ok");var a=o.value;i[i.length-1].focus();i[i.length-1].onclick=function(){if(e.onConfirm){e.onConfirm(o.value)}n.removeBox()};var l=document.getElementsByClassName("btn-footer-cancel");l[l.length-1].onclick=function(){if(e.onCancel){e.onCancel(o.value)}n.removeBox()}},colse:function(){this.removeBox()},removeBox:function(){var e=document.getElementsByClassName(this.containerClass);document.body.removeChild(e[e.length-1])}};function getRealLive_Bilibili(e,t,n,o){let i="80";switch(t){case"1":i="80";break;case"2":i="150";break;case"3":i="250";break;case"4":i="400";break;case"5":i="10000";break;default:i="80";break}GM_xmlhttpRequest({method:"GET",url:"https://api.live.bilibili.com/room/v1/Room/playUrl?cid="+e+"&qn="+i+"&platform=web",responseType:"json",onload:function(e){let t=e.response;let i="";if(t.data.durl!=null){i=t.data.durl[Number(n)].url}else{i=""}o(i)}})}function getRealRid_Bilibili(e,t){GM_xmlhttpRequest({method:"GET",url:e,responseType:"text",onload:function(e){let n=e.response;let o="";o=getStrMiddle(n,'room_id":',",");o=o.trim();if(o==""){o="-1"}t(o)}})}function getRealLive_Douyu(e,t,n,o,i){GM_xmlhttpRequest({method:"GET",url:"https://m.douyu.com/"+e,responseType:"text",onload:function(a){let l=a.response.match(/(function ub9.*)[\s\S](var.*)/i);let s=String(l[0]).replace("ub98484234","ub98484234_ex");eval1(s,"exScript1");let r=Math.round((new Date).getTime()/1e3).toString();RealLive_get_sign_url(e,r,n,o,i,t)}})}function RealLive_get_sign_url(e,t,n,o,i,a){let l=ub98484234_ex(e,getDyDid(),t);let s;if(o=="1015"){s=l+"&ver=219032101&rid="+e+"&rate=1"}else{s=l+"&ver=219032101&rid="+e+"&rate="+o}document.getElementById("exScript1").remove();GM_xmlhttpRequest({method:"POST",url:"https://m.douyu.com/api/room/ratestream",data:s,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;let l="";if(t.code=="0"){let e=t.data.url;if(String(e).indexOf("mix=1")!=-1){l="PKing"}else{let e=/^[0-9a-zA-Z]*/;let n=String(t.data.url).split("/");l=String(n[n.length-1]).match(e)[0]}}else{l="0"}let s="";switch(o){case"1":s="550p";break;case"2":s="1200p";break;case"3":s="2000p";break;case"4":s="4000p";break;default:s="1200p";break}let r="";if(l=="0"){r="None"}else{if(n==true){r=String(t.data.url).replace("m3u8","flv");r=r.replace("http:","https:")}else{if(o=="1015"){r="https://tx2play1.douyucdn.cn/live/"+l+".flv?uuid="}else{r="https://tx2play1.douyucdn.cn/live/"+l+"_"+s+".flv?uuid="}}r=a?r:r+"&only-audio=1"}i(r)}})}function eval1(e,t){let n=document.createElement("script");n.id=t;n.setAttribute("type","text/javascript");n.appendChild(document.createTextNode(e));document.body.appendChild(n)}function getRealRid_Douyu(e,t){fetch(e,{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.text()}).then(e=>{e=(new DOMParser).parseFromString(e,"text/html");let n=e.getElementsByTagName("html")[0].innerHTML;let o="$ROOM.room_id =".length;let i=n.indexOf("$ROOM.room_id =");let a=n.substring(i+o,n.indexOf(";",i+o));a=a.trim();if(isRid(a)==true){t(a)}else{showMessage("获取直播间失败,请检查直播间地址是否正确!","error")}}).catch(e=>{console.log("请求失败!",e)})}function getRealLive_Huya(e,t,n){let o="500";switch(t){case"1":o="500";break;case"2":o="2500";break;case"3":o="4500";break;case"4":o="0";break;default:o="500";break}GM_xmlhttpRequest({method:"GET",headers:{"user-agent":"Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1"},url:e,responseType:"blob",onload:e=>{let t="";let i=e.responseText;let a=/\\s*var liveLineUrl = "(.+)";\s*\<\/script\>/.exec(i);if(a==null){t="房间暂未开播"}else{a=a[1];a=a.replace(/(_\d+)(.m3u8)/,"$2");a="https:"+a;a=a+"&ratio="+o;a=String(a).replace("m3u8","flv")}n(a,t)}})}class STT{escape(e){return e.toString().replace(/@/g,"@A").replace(/\//g,"@S")}unescape(e){return e.toString().replace(/@A/g,"@").replace(/@S/g,"/")}serialize(e){if(util.isObject(e)){return Object.keys(e).map(t=>`${t}@=${this.escape(this.serialize(e[t]))}/`).join("")}else if(Array.isArray(e)){return e.map(e=>`${this.escape(this.serialize(e))}/`).join("")}else if(util.isString(e)||util.isNumber(e)){return e.toString()}}deserialize(e){if(e.includes("//")){return e.split("//").filter(e=>e!=="").map(e=>this.deserialize(e))}if(e.includes("@=")){return e.split("/").filter(e=>e!=="").reduce((e,t)=>{const[n,o]=t.split("@=");e[n]=this.deserialize(this.unescape(o));return e},{})}else if(e.includes("@A=")){return this.deserialize(this.unescape(e))}else{return e.toString()}}}function StyleHook_set(e,t){if(document.getElementById(e)==null){let n=document.createElement("style");n.id=e;n.innerHTML=t;document.body.append(n)}}function StyleHook_remove(e){let t=document.getElementById(e);if(t!==null){document.getElementById(e).remove()}}function StyleHook_setIframe(e,t,n){if(e.getElementById(t)==null){let o=e.createElement("style");o.id=t;o.innerHTML=n;e.body.append(o)}}function StyleHook_removeIframe(e,t){let n=e.getElementById(t);if(n!==null){e.getElementById(t).remove()}}function WebSocket_Packet(e){const t=689;let n=stringToByte(e);let o=new Uint8Array(n.length+4+4+2+1+1+1);let i=new Uint8Array(n.length);for(let e=0;e=65536&&o<=1114111){t.push(o>>18&7|240);t.push(o>>12&63|128);t.push(o>>6&63|128);t.push(o&63|128)}else if(o>=2048&&o<=65535){t.push(o>>12&15|224);t.push(o>>6&63|128);t.push(o&63|128)}else if(o>=128&&o<=2047){t.push(o>>6&31|192);t.push(o&63|128)}else{t.push(o&255)}}return t}function byteToString(e){if(typeof e==="string"){return e}let t="",n=e;for(let e=0;e>8*o+4&15]+n[e>>8*o&15];return t}).join("")}return""}class Ex_WebSocket_UnLogin{constructor(e,t){if("WebSocket"in window){this.timer=0;this.roomid=e;this.ws=new WebSocket("wss://danmuproxy.douyu.com:850"+String(getRandom(2,5)));this.ws.onopen=(()=>{this.ws.send(WebSocket_Packet("type@=loginreq/roomid@="+e));this.ws.send(WebSocket_Packet("type@=joingroup/rid@="+e+"/gid@=-9999/"));this.timer=setInterval(()=>{this.ws.send(WebSocket_Packet("type@=mrkl/"))},4e4)});this.ws.onmessage=(e=>{let n=new FileReader;n.onload=(()=>{let e=String(n.result).split("\0");n=null;for(let n=0;n12){t(e[n])}}});n.readAsText(e.data)});this.ws.onclose=(()=>{showMessage("服务器连接丢失,请尝试刷新页面","error");console.log("服务器连接丢失")})}}close(){clearInterval(this.timer);this.ws.close()}}function initRouter(e){if(String(e).indexOf("passport.douyu.com")!=-1&&String(e).indexOf("exid=chun")!=-1){initRouter_Passport()}else if(String(e).indexOf("msg.douyu.com")!=-1){if(e.indexOf("?exClean")!=-1){initRouter_CleanMsg()}else{initRouter_Motorcade()}}else if(String(e).indexOf("yuba.douyu.com")!=-1){if(String(e).indexOf("?exClean")!=-1){initRouter_CleanYuba()}else{initRouter_Yuba()}}else if(String(e).indexOf("v.douyu.com")!=-1&&String(e).indexOf("?exClean")!=-1){initRouter_CleanVideo()}else if(String(e).indexOf("getFansBadgeList")!=-1){initRouter_FansBadgeList()}else{if(String(e).indexOf("exid=chun")!=-1){initRouter_DouyuRoom_Popup()}else{initRouter_DouyuRoom_Main()}}}function initRouter_Motorcade(){if(getQueryString("exid")=="chun"){signMotorcade_Sign()}}function initRouter_DouyuRoom_Popup(){let e=setInterval(()=>{if(typeof document.querySelector("div.wfs-2a8e83")!="undefined"){document.querySelector("div.wfs-2a8e83").click();document.querySelector("label.layout-Player-asidetoggleButton").click();let t=document.querySelectorAll(".tip-e3420a > ul > li").length;document.querySelectorAll(".tip-e3420a > ul > li")[t-1].click();clearInterval(e)}},1e3)}function initRouter_DouyuRoom_Main(){document.domain="douyu.com";init();let e=setInterval(()=>{if(typeof document.getElementsByClassName("BackpackButton")[0]!="undefined"&&typeof document.getElementsByClassName("Barrage-main")[0]!="undefined"){setTimeout(()=>{initStyles();initPkg();initPkgSpecial();initTimer()},1500);clearInterval(e)}},1e3)}function initPkgSpecial(){if(rid=="5189167"){initPkg_Point()}}function initRouter_Yuba(){document.domain="douyu.com"}function initRouter_Passport(){let e=getStrMiddle(window.location.href,"cmd=","&");let t=getStrMiddle(window.location.href,"uid=","&");let n=getStrMiddle(window.location.href,"domain=","&");if(e!=="clean"){addAccountPassport(t)}switch(e){case"clean":cleanCookie(()=>{window.parent.postMessage("cleanOver",decodeURIComponent(n))});break;case"switch":switchAccountPassport(t,()=>{window.parent.postMessage("switchOver",decodeURIComponent(n))});break;case"delete":deleteAccountPassport(t,()=>{window.parent.postMessage("deleteOver",decodeURIComponent(n))});break;default:break}return}function initRouter_CleanMsg(){let e=getStrMiddle(window.location.href,"domain=","&");cleanCookie(()=>{window.parent.postMessage("msgCleanOver",decodeURIComponent(e))})}function initRouter_CleanYuba(){let e=getStrMiddle(window.location.href,"domain=","&");cleanCookie(()=>{window.parent.postMessage("yubaCleanOver",decodeURIComponent(e))})}function initRouter_CleanVideo(){let e=getStrMiddle(window.location.href,"domain=","&");cleanCookie(()=>{window.parent.postMessage("videoCleanOver",decodeURIComponent(e))})}function initRouter_FansBadgeList(){initPkg_FansBadgeList()}