"use strict"; // ==UserScript== // @name DouyuEx-斗鱼直播间增强插件 // @namespace https://github.com/qianjiachun // @icon https://s2.ax1x.com/2020/01/12/loQI3V.png // @version 2021.05.19.01 // @description 弹幕自动变色防检测循环发送 一键续牌 查看真实人数/查看主播数据 已播时长 一键签到(直播间/车队/鱼吧/客户端) 一键领取鱼粮(宝箱/气泡/任务) 一键寻宝 送出指定数量的礼物 一键清空背包 屏蔽广告 调节弹幕大小 自动更新 同屏画中画/多直播间小窗观看/可在斗鱼看多个平台直播(虎牙/b站) 获取真实直播流地址 自动抢礼物红包 背包信息扩展 简洁模式 夜间模式 开播提醒 幻神模式 关键词回复 关键词禁言 自动谢礼物 自动抢宝箱 弹幕右键信息扩展 防止下播自动跳转 影院模式 直播时间流控制 弹幕投票 直播滤镜 直播音频流 账号多开/切换 显示粉丝牌获取日期 月消费数据显示 弹幕时速 相机截图录制gif // @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 // @require https://cdn.jsdelivr.net/npm/gif.js@0.2.0/dist/gif.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();initPkg_Menu();initPkg_FollowList()}function initPkg(){Update_checkVersion();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();initPkg_MonthCost()}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;\tz-index: 1015;}.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;\tz-index: 1015;}.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;}.barrageSpeed { position: absolute; right: 10px; top: -20px; color: rgba(0,0,0,0.5); cursor: default; z-index: 0;}.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;\tz-index: 1015;}.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; */ width: 100px;}#reply__time { width: 35px;}.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;}.month-cost { margin-right: 5px; cursor: default; -moz-user-select:none;/*火狐*/ -webkit-user-select:none;/*webkit浏览器*/ -ms-user-select:none;/*IE10*/ -khtml-user-select:none;/*早期浏览器*/ user-select:none;}.monthcost__icon { position: relative; top: 3px; cursor: pointer; margin-left: 3px;}#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-camera { background: rgba(0,0,0,0.7); position: absolute; right: 20px; bottom: 190px; z-index: 10; width: 60px; height: 60px; cursor: pointer; -webkit-border-radius: 50%; -moz-border-radius: 50%; border-radius: 50%; cursor: pointer; display: none; justify-content: center; align-items: center; border: 2px solid #2d2c2c; box-sizing: border-box;}#ex-camera:hover > svg > path { fill: rgb(252, 199, 84);}#ex-camera:active > svg > path { fill: rgb(253, 60, 60);}#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 i=0;if(t>60){n=parseInt(t/60);t=parseInt(t%60);if(n>60){i=parseInt(n/60);n=parseInt(n%60)}}let o=""+parseInt(t)+"秒";if(n>0){o=""+parseInt(n)+"分"+o}if(i>0){o=""+parseInt(i)+"小时"+o}return o}function formatSeconds2(e){var t=parseInt(e);var n=0;var i=0;if(t>60){n=parseInt(t/60);t=parseInt(t%60);if(n>60){i=parseInt(n/60);n=parseInt(n%60)}}var o=""+(parseInt(t)<10?"0"+parseInt(t):parseInt(t));o=""+(parseInt(n)<10?"0"+parseInt(n):parseInt(n))+":"+o;o=""+(parseInt(i)<10?"0"+parseInt(i):parseInt(i))+":"+o;return o}async function verifyFans(e,t){return true;let n=false;let i=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)});i=(new DOMParser).parseFromString(i,"text/html");let o=i.getElementsByClassName("fans-badge-list")[0].lastElementChild;let a=o.children.length;for(let i=0;i=t){n=true;break}else{n=false}}return n}function getStrMiddle(e,t,n){let i=e.match(new RegExp(t+"(.*?)"+n));return i?i[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 getCSRF(){let e=getCookieValue("cvl_csrf_token");if(e==null){setCookie("cvl_csrf_token","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>=5){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"yubaCleanOver":cleanOverTimes++;if(cleanOverTimes>=5){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"videoCleanOver":cleanOverTimes++;if(cleanOverTimes>=5){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"czCleanOver":cleanOverTimes++;if(cleanOverTimes>=5){cleanOverTimes=0;setTimeout(()=>{window.location.reload()},50)}break;case"switchOver":cleanOverTimes++;if(cleanOverTimes>=5){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(i,()=>{});setPassportCmd("switch",i);setYubaAndMsgAndVideoClean()});n.getElementsByClassName("ex-accountList-item__btn")[0].addEventListener("click",e=>{e.stopPropagation();showMessage("【账号管理】正在删除...","info");deleteAccount(i,()=>{});setPassportCmd("delete",i)})}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 i=t[e];n+=`\n
\n
\n \n
\n
${decodeURIComponent(i.nickname)}
\n
删除
\n
`}n+=`\n
\n \n
\n `;return n}function switchAccount(e,t){let n=JSON.parse(GM_getValue("Ex_accountList"));let i=[];let o=0;GM_cookie("list",{path:"/"},function(e){for(let n=0;n=e.length){let e=0;for(let n=0;n=i.length){t()}})}}})}})}function switchAccountPassport(e,t){let n=JSON.parse(GM_getValue("Ex_accountListPassport"));let i=n[e];let o=0;GM_cookie("list",{path:"/"},function(e){for(let n=0;n=e.length){let e=0;for(let n=0;n=i.length){t()}})}}})}})}function addAccount(){let e=JSON.parse(GM_getValue("Ex_accountList")||"{}");let t={};let n="";GM_cookie("list",{path:"/"},function(i){let o=[];if(i==undefined){document.getElementById("ex-accountList-content").innerHTML="请升级Tampermonkey版本
点我升级,选择Crx4Chrome";return}for(let e=0;e{if(n){for(let i=0;i=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 \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 i=n-t;if(i>0){showMessage(`【消消乐】开始领取鱼丸,剩余${i}次`,"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 i=await getFishBall_Ad_FishPond_finish(e,t,n,o,a);if(i==false){i=await getFishBall_Ad_FishPond_finish(e,t,n,o,a);if(i==false){i=await getFishBall_Ad_FishPond_finish(e,t,n,o,a)}}if(i==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 i=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:i})}}})})}function getFishBall_Ad_FishPond_start(e,t,n,i,o){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="+i+"&infoBack="+o,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,i,o){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="+i+"&roomId="+rid+"&token="+t+"&infoBack="+o,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 i=await getFishBall_Ad_Search_finish(e,t,n,o,a);if(i==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 i=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:i})}}})})}function getFishBall_Ad_Search_start(e,t,n,i,o){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="+i+"&infoBack="+o,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,i,o){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="+i+"&roomId="+rid+"&token="+t+"&infoBack="+o,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 i=await getFishBall_Ad_Yuba_finish(e,t,n,o,a);if(i==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 i=encodeURIComponent(JSON.stringify(t.data));n({mid:e,infoBack:i})}}})})}function getFishBall_Ad_Yuba_start(e,t,n,i,o){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="+i+"&infoBack="+o,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,i,o){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="+i+"&roomId="+rid+"&token="+t+"&infoBack="+o,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 i=0;for(let o=0;o{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 i=0;i0){await sleep(100).then(()=>{sendGift_bag(n,o,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 i="";if(n.length>0){i=n[0].innerText;setUserFansMedal(n[0],i);setMuteButton(e);setSearchBarrageButton(e);setMuteTimeButton(e);setReplyBarrageButton(e);setBarrgePanelFunc(e,i)}}}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 i="";if(n.length>0){i=n[0].innerText;setUserFansMedal(n[0],i);setMuteButton(t);setSearchBarrageButton(t);setMuteTimeButton(t);setReplyBarrageButton(t);setBarrgePanelFunc(t,i)}}}})}function getUserFansMedal(e){let t=false;let n=document.getElementsByClassName("Barrage-listItem");for(let i=n.length-1;i>=0;i--){let o=n[i].lastElementChild;if(o!=null&&o!=undefined&&o.innerHTML.indexOf(e)!=-1){let e=o.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 i=n.length-1;i>=0;i--){let o=n[i].lastElementChild;if(o!=null&&o!=undefined&&o.innerHTML.indexOf(e)!=-1){let e=o.getElementsByClassName("Barrage-icon--roomAdmin");if(e.length>0){t+="【房管】"}let n=o.getElementsByClassName("Barrage-nobleImg");if(n.length>0){t+=`【${n[0].title}】`}let i=o.getElementsByClassName("UserLevel");if(i.length>0){t+=i[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 i=document.createElement("span");i.innerHTML=t;i.title=n;i.id="barragePanel__id";e.insertBefore(i,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 i=JSON.parse(n.data);let o=document.getElementById("barragePanel__searchPanel");if(i.msg=="成功"){if("danmuVoList"in i.data==false){return}for(let e=0;e\n
\n

${t.time}

\n

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

\n
\n `;if(o!=null||o!=undefined){o.appendChild(n)}}let e=document.createElement("li");e.className="layui-timeline-item";e.innerHTML=`\n \n
\n
\n
\n `;if(o!=null||o!=undefined){o.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 i=document.createElement("div");i.className="barragePanel__funcPanel";i.style=`margin-left:${n}`;i.innerHTML=`\n
    \n \n
\n `;e.insertBefore(i,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 i=n.getElementsByClassName("Barrage-nickName")[0];i.setAttribute("class","Barrage-nickName is-self js-nick");let o=n.querySelector(".UserLevel");if(o!=null){o.className="UserLevel UserLevel--150";o.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 r=document.getElementsByClassName("FansMedal-name")[0];let s=document.getElementsByClassName("FansRankList-item FansRankList-item--top")[0];if(r!=undefined&&s!=undefined){if(s.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=r.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",s.getElementsByClassName("FansMedal is-made")[0].getAttribute("style"));let t=document.createElement("span");t.className="FansMedal-name js-fans-dysclick";t.innerHTML=r.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 i=document.getElementsByClassName("Avatar is-circle")[0];if(i!=undefined){i=i.getElementsByTagName("img")[0].getAttribute("src");n.setAttribute("src",i.replace(new RegExp("_middle"),"_small"))}else{}t.insertBefore(n,t.firstElementChild);let o=t.getElementsByClassName("afterpic-8a2e13")[0];o.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 r=document.createElement("img");r.className="super-tail-bffa58";r.setAttribute("src","https://shark2.douyucdn.cn/front-publish/live_player-master/assets/images/h3_fd2e5b.png");t.appendChild(r)}}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 i=document.getElementsByClassName("ex_giftAnimation")[0];i.appendChild(e);let o=new SVGA.Player("#"+n);let a=new SVGA.Parser("#"+n);a.load("https://gfs-op.douyucdn.cn/dygift/2018/11/27/6c6349672e662750ad5c019b240d57f2.svga",e=>{o.setVideoItem(e);o.startAnimation();setTimeout(()=>{o=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 i=0;let o=0;for(let a=0;a{if(n.data!=null){if(n.msg!="鱼翅不足"){i=i+1;o=o+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")}})});document.getElementById("extool__treasure_skey").addEventListener("change",()=>{saveData_Treasure()})}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,o,r)},a)}else{getTreasure(rid,n,o,r)}}})}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 s=i.getElementsByTagName("td")[1];s.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 i=n.children.length;for(let t=0;t{sendGift_bag(268,Number(e),i).then(e=>{if(e.msg=="success"){showMessage("【续牌】"+i+"赠送荧光棒成功","success")}else{showMessage("【续牌】"+i+"赠送失败 "+e.msg,"error");console.log(i,e)}}).catch(e=>{showMessage("【续牌】"+i+"赠送失败","error");console.log(i,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();initPkg_FishPond_PubgBox_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)})}}}function initPkg_FishPond_PubgBox_Timer(){getPubgBox()}function getPubgBox(){fetch("https://www.douyu.com/japi/carnivalApi/nc/crowdTask/baseTask/status?actAlias=20210508EQYDJ",{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.json()}).then(e=>{if(e.error==0&&e.data.third.taskStatus!==1){fetch("https://www.douyu.com/japi/carnival/nc/actTask/takePrize",{method:"POST",mode:"no-cors",cache:"default",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`csrfToken=${getCSRF()}&taskAlias=${e.data.third.taskAlias}&rid=${rid}`}).then(e=>{return e.json()}).then(e=>{if(e.error==0){let t=e.data.sendRes.items[0].prizeName;let n=e.data.sendRes.items[0].prizeNum;showMessage("【PUBG寻宝】获得"+t+"*"+n,"success")}}).catch(e=>{console.log("请求失败!",e)})}}).catch(e=>{console.log("请求失败!",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 i=0;let o=`
长按弹出同屏播放
`;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))}

`;i++}if(i>=n){break}}e.innerHTML+=o;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)});l[e].addEventListener("mousedown",t=>{if(t.button==1){openPage("https://www.douyu.com/"+l[e].getAttribute("rid"),false)}})}}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 barrageSpeed_count=0;function initPkg_LiveTool_BarrageSpeed(){setInterval(()=>{let e=Number(barrageSpeed_count/5*60).toFixed(0);barrageSpeed_count=0;document.getElementsByClassName("ChatSend-txt")[0].placeholder="弹幕时速:"+e+"条/分"},5e3)}function LiveTool_BarrageSpeed_Dom(){let e=document.createElement("div");e.className="barrageSpeed";let t=`\n 弹幕时速:**条/分\n `;e.innerHTML=t;let n=document.getElementsByClassName("Chat")[0];n.insertBefore(e,n.childNodes[0])}function initPkg_LiveTool_BarrageSpeed_Handle(e){if(getType(e)=="chatmsg"){barrageSpeed_count++}}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 i=document.getElementsByClassName("livetool")[0];i.insertBefore(e,i.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(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 i={rooms:e};localStorage.setItem("ExSave_isEnter",JSON.stringify(i))}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 i in enterWordList){if(i==e){t.selectedIndex=n;let i=enterWordList[e].enter;document.getElementById("enter__word").value=e;document.getElementById("enter__level").value=i;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 i=getStrMiddle(e,"level@=","/");let o=document.getElementById("enter__select");let a=o.options[o.selectedIndex].text;let l=enterWordList[a].enter;if(Number(i)/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 i=document.getElementsByClassName("livetool")[0];i.insertBefore(e,i.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(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 i={rooms:e};localStorage.setItem("ExSave_isGift",JSON.stringify(i))}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 i=getStrMiddle(e,"gfid@=","/");let o=getStrMiddle(e,"gfcnt@=","/");for(let e in giftWordList){if(i==e){let t=giftWordList[e].reply;t=String(t).replace(//g,n);t=String(t).replace(//g,o);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();initPkg_LiveTool_BarrageSpeed()}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);initPkg_LiveTool_BarrageSpeed_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 i=document.getElementsByClassName("livetool")[0];i.insertBefore(e,i.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 i=document.getElementById("mute__count").value;let o=e.options[e.selectedIndex].value;if(n==""){return}muteWordList[n]={count:i,time:o};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 i={rooms:e};localStorage.setItem("ExSave_isMute",JSON.stringify(i))}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 i=getStrMiddle(e,"txt@=","/");let o=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(i);if(l.length>0){if(l[0]==e){o=true}else{o=false}}}}else{if(String(i).indexOf(e)==-1){o=false}else{o=true}}if(o==true){let o=muteWordList[e].count;let a=muteWordList[e].time;if(muteIdList.hasOwnProperty(n)){let e=Number(muteIdList[n].count)+1;if(e>=o){let e=await addMuteUser(rid,n,a);showMessageWindow("禁言信息","【"+n+"】已被禁言"+a+"分钟"+"\n弹幕:"+i,()=>{});let o={id:n,uid:t,barrage:i,time:a,count:1,ts:String(dateFormat("yyyy年MM月dd日hh时mm分ss秒 ",new Date))};muteIdListShow.push(o);muteIdList[n].count=0}else{muteIdList[n].count=String(e)}}else{let e=1;if(e>=o){let e=await addMuteUser(rid,n,a);showMessageWindow("禁言信息","【"+n+"】已被禁言"+a+"分钟"+"\n弹幕:"+i,()=>{});let o={id:n,uid:t,barrage:i,time:a,count:1,ts:String(dateFormat("yyyy年MM月dd日hh时mm分ss秒 ",new Date))};muteIdListShow.push(o)}else{muteIdList[n]={uid:t,count:1}}}break}}}}function addMuteUser(e,t,n){return new Promise(i=>{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=>{i(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={};let isReplyCD=false;let replyCd=0;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
\n `;e.innerHTML=t+n;let i=document.getElementsByClassName("livetool")[0];i.insertBefore(e,i.childNodes[0])}function LiveTool_Reply_insertFunc(){document.getElementById("reply__switch").addEventListener("click",()=>{replyCd=String(document.getElementById("reply__time").value)||0;let e=document.getElementById("reply__switch").checked;if(e==true){isReplyOn=true}else{isReplyOn=false}saveData_isReply();saveData_ReplyCd()});document.getElementById("reply__title").addEventListener("click",()=>{let e=document.getElementsByClassName("reply__panel")[0];if(e.style.display!="block"){e.style.display="block";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_ReplyCd(){let e=document.getElementById("reply__time").value;localStorage.setItem("ExSave_ReplyCd",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 i={rooms:e};localStorage.setItem("ExSave_isReply",JSON.stringify(i))}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}e=localStorage.getItem("ExSave_ReplyCd");if(e!=null){document.getElementById("reply__time").value=e}}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 i=getStrMiddle(e,"txt@=","/");let o=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(i);if(l.length>0){if(l[0]==e){o=true}else{o=false}}}}else{if(String(i).indexOf(e)!=-1){o=true}else{o=false}}if(o==true){let t=replyWordList[e].reply;t=String(t).replace(//g,n);t=String(t).replace(//g,i);if(isReplyCD==false){sendBarrage(t);if(replyCd>0){isReplyCD=true;setTimeout(()=>{isReplyCD=false},replyCd*1e3)}}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 i=getStrMiddle(e,"rid@=","/");let o=getCookieValue("dy_did");let a=Number(t)-Math.floor(Date.now()/1e3);a=a*1e3+getTreasureDelay();treasureNum++;let l=document.createElement("div");let r="Ex_Geetest_no"+String(treasureNum);l.id=r;let s=document.getElementById("Ex_Geetest");s.appendChild(l);setTimeout(()=>{getTreasure(i,n,o,r)},a)}}function getTreasure(e,t,n,i){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(o){let a=o.response;if(a.data.code=="-1"&&a.data.validate!="0"){let o=JSON.parse(a.data.geetest.validate_str);let l=o.success;let r=o.challenge;let s=o.gt;let d=getTreasureSkey();if(d!=""){let i=window.location.href;getTreasure_Auto(d,s,r,i,n,t,e);return}let c=o=>{let a=document.getElementById(i);o.appendTo("#"+i);o.onSuccess(()=>{let i=o.getValidate();let l=i.geetest_challenge;let r=i.geetest_seccode;let s=i.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="+s+"&geetest_seccode="+encodeURIComponent(r);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:s,challenge:r,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,i){let o="room_id="+roomid+"&package_room_id="+roomid+"&device_id="+deviceid+"&packerid="+rpid+"&version=1";o+="&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:o,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;if(document.getElementById(i)!=null){document.getElementById(i).remove()}}})}function getTreasure_Auto(e,t,n,i,o,a,l){let r="geetest";let s="wtype="+r+"&secretkey="+e+">="+t+"&referer="+i+"&challenge="+n+"&supporttype=3";GM_xmlhttpRequest({method:"POST",url:"http://api.ddocr.com/api/gateway.jsonp",data:s,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="+o+"&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 i=document.getElementsByClassName("livetool")[0];i.insertBefore(e,i.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 i=voteList[n].options;let o=voteList[n].time;if(e==true){let e=String(i).split(" ");for(let t=0;t{voteNameList={};voteWordList={};isVoteOn=false;document.getElementById("vote__repeat").disabled=false;document.getElementById("vote__switch").checked=false},o*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(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 i=document.getElementById("vote__time").value;if(t==""||n==""||i==""){return}voteList[t]={options:n,time:i};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 i=document.getElementsByClassName("vote__result")[0];i.onmousedown=function(e){e.stopPropagation();let t=e.clientX-i.offsetLeft;let n=e.clientY-i.offsetTop;let o;let a;document.onmousemove=function(e){e.stopPropagation();o=e.clientX-t;a=e.clientY-n;i.style.left=o+"px";i.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(i)}}function changeOptionsData(){for(const e in voteWordList){let t=voteWordList[e];let n=document.getElementsByClassName("vote__option-num")[t.index];let i=document.getElementsByClassName("vote__progress-bar")[t.index];let o=String(Number(Number(t.num/voteTotalNum)*100).toFixed(1))+"%";n.innerText=`${t.num}(${o})`;i.style.width=o}}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 totalMonthCost=0;let typeNum=0;let typeCount=0;let svg_see=``;let svg_unsee=``;let seeStatus=1;function initPkg_MonthCost(){initPkg_MonthCost_Dom();initPkg_MonthCost_Func();seeStatus=MonthCost_getSeeStatus();if(seeStatus==1){document.getElementsByClassName("monthcost__icon")[0].innerHTML=svg_see;MonthCost_updateCost()}else{document.getElementsByClassName("monthcost__icon")[0].innerHTML=svg_unsee}}function initPkg_MonthCost_Dom(){MonthCost_insertIcon()}function MonthCost_insertIcon(){let e=document.createElement("span");e.className="month-cost";e.innerHTML=`\n\t本月已消费 *** 元\n\t\n\t`;e.title="数据每日更新,根据个人中心消费数据统计";let t=document.getElementsByClassName("PlayerToolbar-Wealth")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_MonthCost_Func(){document.getElementsByClassName("monthcost__icon")[0].addEventListener("click",()=>{if(seeStatus==1){seeStatus=0;document.getElementById("monthcost__money").innerText="***";document.getElementsByClassName("monthcost__icon")[0].innerHTML=svg_unsee}else{seeStatus=1;document.getElementsByClassName("monthcost__icon")[0].innerHTML=svg_see;MonthCost_updateCost()}MonthCost_saveSeeStatus()})}function MonthCost_saveSeeStatus(){localStorage.setItem("ExSave_MonthCost_SeeStatus",seeStatus)}function MonthCost_getSeeStatus(){let e=localStorage.getItem("ExSave_MonthCost_SeeStatus");if(e==null){e=1}return e}function MonthCost_queryData(e){return new Promise(t=>{fetch(e,{method:"GET",mode:"no-cors",credentials:"include"}).then(e=>{return e.json()}).then(e=>{t(e)})})}async function getMonthCost(){totalMonthCost=0;let e=await MonthCost_queryData("https://www.douyu.com/member/cp/getYcConsumeTypeList");typeNum=e.data.length-1;if(e.code==0){for(let t=1;t=typeNum){MonthCost_saveData();document.getElementById("monthcost__money").innerText=String(totalMonthCost/100)}}function getMonthTimeRange(){let e=new Date;let t=e.getMonth();let n=e.getFullYear();let i=new Date(n,t,1);return[Math.round(new Date(i).getTime()/1e3).toString(),Math.round(e.getTime()/1e3).toString()]}function MonthCost_saveData(){let e={monthCost:totalMonthCost,updateTime:(new Date).getTime()};let t=localStorage.getItem("ExSave_MonthCost");if(t!==null){t=JSON.parse(t)}else{t={}}t[my_uid]=e;localStorage.setItem("ExSave_MonthCost",JSON.stringify(t))}function MonthCost_getData(){let e=localStorage.getItem("ExSave_MonthCost");if(e!==null){e=JSON.parse(e)}else{e={}}return e}function MonthCost_updateCost(){let e=1;let t=0;let n=(new Date).getDate();let i=MonthCost_getData();if(my_uid in i){let o=i[my_uid];e=Math.abs(n-new Date(o.updateTime).getDate());t=o.monthCost}if(e>=1){getMonthCost()}else{document.getElementById("monthcost__money").innerText=String(t/100)}}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\n /*弹幕时速*/\n .barrageSpeed{color: rgba(255,255,255,0.5) !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 \n .editor-3MzrC{background: rgb(47,48,53)!important;border-top: 1px solid rgb(47,48,53)!important;border-bottom: 1px solid rgb(47,48,53)!important;}\n .editor-2y1wx{border: 1px solid rgb(47,48,53)!important;color:rgb(204,204,204)!important;}\n\n .VideoRecommendItem-liveTitle,.Bottom-tab--header{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,i){return new Promise(o=>{GM_xmlhttpRequest({method:"POST",url:"http://122.51.5.63:27999/douyu/point/5189167/exchange",data:"token="+e+"&item_id="+t+"&id="+n+"&info="+i,responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded"},onload:function(e){let t=e.response;o(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 i=document.getElementsByClassName("PlayerToolbar-Wealth")[0];i.insertBefore(t,i.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 i=document.getElementById("point__value").innerText;if(i-n<0){showMessage("【积分系统】兑换失败:积分不足","error");return}showPrompt("请填写备注信息(联系方式/收货地址)",async t=>{if(t==""){showMessage("【积分系统】兑换失败:未填写备注信息","error");return}let n=await getUserName();let i=await exchangeItem(dyToken,e,n,t);if(i.error=="0"){showMessage("【积分系统】"+i.msg,"success");if(i.data.length>0){document.getElementById("point__value").innerText=i.data[0].point;document.getElementById("ex-point").title=`更新时间:${i.data[0].update_time}`}}else{showMessage("【积分系统】"+i.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 i=document.getElementsByClassName("PlayerToolbar-Wealth")[0];i.insertBefore(t,i.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 i="";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=i;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 i=n.keyCode||n.which||n.charCode;if(i==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 i=String(t).split("/");createNewVideo_Huya(e,t,i[i.length-1]);break;default:createNewVideo_Douyu(e,t);break}}function setElementVideo(e,t){if(flvjs.isSupported()){var n=document.getElementById("exVideoPlayer"+String(e));var i=flvjs.createPlayer({type:"flv",url:t},{fixAudioTimestampGap:false});if(e>videoPlayerArr.length-1){videoPlayerArr.push(i)}else{videoPlayerArr[e]=i}i.attachMediaElement(n);i.load();i.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 i;let o;document.onmousemove=function(e){e.stopPropagation();e.preventDefault();i=Math.max(300,e.clientX-n.x+n.w);o=Math.max(150,e.clientY-n.y+n.h);i=i>=document.offsetWidth-t.offsetLeft?document.offsetWidth-t.offsetLeft:i;o=o>=document.offsetHeight-t.offsetTop?document.offsetHeight-t.offsetTop:o;t.style.width=i+"px";t.style.height=o+"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 i=e.clientY-t.offsetTop;let o;let a;document.onmousemove=function(e){e.stopPropagation();o=e.clientX-n;a=e.clientY-i;t.style.left=o+"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 i=String(n).split("/live");let o="";if(i.length>0){o=i[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 r=document.getElementsByClassName("layout-Main")[0];r.insertBefore(a,r.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 i=document.getElementById("exVideoPlayer"+String(e));let o=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));i.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";o.style.display="block"}else{a.style.display="none";o.style.display="none"}for(let t=0;t{videoPlayerArr[e].destroy();setElementVideo(e,t)})};r.onchange=function(){getRealLive_Douyu(t,true,true,l.value,t=>{videoPlayerArr[e].destroy();setElementVideo(e,t)})};s.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 i=String(n).split("/live");let o="";if(i.length>0){o=i[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 r=document.getElementsByClassName("layout-Main")[0];r.insertBefore(a,r.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 i=document.createElement("div");let o="";i.id="exVideoDiv"+String(e);i.rid=t;i.className="exVideoDiv";o+="
"+"Bilibili - "+t+"";o+="";o+="";o+="
X
";o+="
";o+="
";i.innerHTML=o;let a=document.getElementsByClassName("layout-Main")[0];a.insertBefore(i,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 i=document.getElementById("exVideoPlayer"+String(e));let o=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));i.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";o.style.display="block"}else{a.style.display="none";o.style.display="none"}for(let t=0;t{videoPlayerArr[e].destroy();setElementVideo(e,t)})};r.onchange=function(){getRealLive_Bilibili(t,l.value,r.value,t=>{videoPlayerArr[e].destroy();setElementVideo(e,t)})};s.onclick=function(){n.remove()};let d=document.getElementById("exVideoRID"+String(e));d.onclick=function(){getRealLive_Bilibili(t,l.value,r.value,e=>{GM_setClipboard(e);showMessage("复制成功","success")})}}function createNewVideo_Huya(e,t,n){getRealLive_Huya(t,"1",(i,o)=>{if(i!=""||i!=null){if(o!=""){showMessage(o,"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 r=document.getElementsByClassName("layout-Main")[0];r.insertBefore(a,r.childNodes[0]);setElementDrag(e);setElementResize(e);setElementFunc_Huya(e,t);setElementVideo(e,i)}})}function setElementFunc_Huya(e,t){let n=document.getElementById("exVideoDiv"+String(e));let i=document.getElementById("exVideoPlayer"+String(e));let o=document.getElementById("exVideoInfo"+String(e));let a=document.getElementById("exVideoScale"+String(e));i.onclick=function(t){t.stopPropagation();t.preventDefault();if(a.style.display!="block"){a.style.display="block";o.style.display="block"}else{a.style.display="none";o.style.display="none"}for(let t=0;t{if(n!=""){showMessage(n,"error");return}videoPlayerArr[e].destroy();setElementVideo(e,t)})};r.onclick=function(){n.remove()};let s=document.getElementById("exVideoRID"+String(e));s.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 i=n[n.length-1];let o=document.createElement("div");let a="";o.id="exVideoDiv"+String(e);o.rid=i;o.className="exVideoDiv";a+="
"+"斗鱼 - "+i+"";a+="
X
";a+="
";a+="";a+="
";o.innerHTML=a;let l=document.getElementsByClassName("layout-Main")[0];l.insertBefore(o,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 i="";let o=document.createElement("div");o.className="real-audience";i+="
";i+="
"+e+'****
';i+="
"+t+'****
';i+="
"+n+'****
';i+="
";i+=''+"已播:"+"****"+"";o.innerHTML=i;let a=document.getElementsByClassName("layout-Player-announce")[0];a.insertBefore(o,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 i=document.getElementsByClassName("Title-anchorPic-bottom")[0];i.insertBefore(e,i.childNodes[0]);i.insertBefore(t,i.childNodes[0]);i.insertBefore(n,i.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-honor,.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 i=document.getElementsByClassName("layout-Player-announce")[0].offsetHeight;e.style.display="none";n.style.display="none";t.style="top:"+i+"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 i=document.getElementsByClassName("layout-Player-announce")[0].offsetHeight;e.style.display="none";n.style.display="none";t.style="top:"+i+"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 .XinghaiAd,.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 .PlayerToolbar-couponInfo{display:none !important;}\n /*太空探险tips*/\n .AroundStarsActTips-actTips,.AroundStarsMoonBoxTips,.AroundStarsPlanetTips{display:none !important;}\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 /*陪玩*/\n .InteractPlayWithEnter-enterTips1{display:none !important;}\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(i=>{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){i(e.response.GroupIdList[0].GroupId)}else{i("")}}})})}function initPkg_Sign_Room(e){signAllRoom(e)}function signAllRoom(e){let t=0;let n=0;let i=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(o=>{t=Number(o.data.pageCount);for(let o=1;o<=t;o++){fetch("https://www.douyu.com/wgapi/livenc/liveweb/follow/list?page="+String(o),{method:"GET",mode:"no-cors",cache:"default",credentials:"include"}).then(e=>{return e.json()}).then(t=>{let o=Number(t.data.list.length);for(let a=0;a{console.log("请求失败!",e)})}showMessage("【房间签到】"+o.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 i=0;i{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 i=`pid=${e}&comment_id=${t}&type=${n}`;return new Promise(e=>{GM_xmlhttpRequest({method:"POST",url:"https://yuba.douyu.com/ybapi/follow/like",data:i,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.05.19.01";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();if(isNeedUpdate){Update_showTip(true)}}else{if(e){showMessage(`【版本更新】当前版本${curVersion}已为最新`,"success")}}})});isNeedUpdate=t[0];lastestVersion=t[1];if(isNeedUpdate){Update_showMessage();if(isNeedUpdate){Update_showTip(true)}}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(t){if(e){if(t.style.display!="block"){t.style.display="block"}}else{t.style.display="none"}}}function Update_showMessage(){let e=`【版本更新】最新版本:${lastestVersion},点击官方源或者GreasyFork源更新`;showMessage(e,"error")}let videoStartTime=0;let videoTime_domhook_videoChange=null;let videoTime_domhook_showtime=null;let videoTime_timeout=0;function initPkg_VideoTime(){let e=setInterval(()=>{VideoTime_setData();let t=document.getElementsByTagName("demand-video")[0].shadowRoot.getElementById("__video");let n=document.getElementsByTagName("demand-video")[0].shadowRoot.getElementById("demandcontroller-bar").shadowRoot.querySelector("demand-video-controller-progress").shadowRoot.querySelector("demand-video-controller-preview");if(t!==undefined&&t!==null){clearInterval(e);videoTime_domhook_videoChange=new MutationObserver(function(e){VideoTime_setData()});videoTime_domhook_videoChange.observe(t,{attributes:true,childList:true,subtree:false});videoTime_domhook_showtime=new MutationObserver(function(e){for(let t=0;t"+formatSeconds2(e));break}else if(n.attributeName=="isshow"){clearTimeout(videoTime_timeout);let e=Number(VideoTime_getShowTime());videoTime_timeout=setTimeout(()=>{VideoTime_setShowTime(String(dateFormat("yyyy-MM-dd hh:mm:ss",new Date(Number(videoStartTime+e*1e3))))+"
"+formatSeconds2(e))},0);break}}});videoTime_domhook_showtime.observe(n,{attributes:true,childList:true,subtree:false})}},1e3)}function VideoTime_setData(){let e=String(window.location.pathname).split("/");let t=e[e.length-1];fetch("https://v.douyu.com/video/video/getVideoUrl?vid="+t,{method:"GET",mode:"no-cors",credentials:"include",headers:{"Content-Type":"application/x-www-form-urlencoded"}}).then(e=>{return e.json()}).then(e=>{let t=e.data.viewthumb[0].url;let n=getStrMiddle(t,"--","/");videoStartTime=new Date(n.replace(/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/,"$1-$2-$3 $4:$5:$6")).getTime()}).catch(e=>{console.log("请求失败!",e)})}function VideoTime_getShowTime(){let e=document.getElementsByTagName("demand-video")[0].shadowRoot.getElementById("demandcontroller-bar").shadowRoot.querySelector("demand-video-controller-progress").shadowRoot.querySelector("demand-video-controller-preview").getAttribute("showtime");return Number(e).toFixed(0)}function VideoTime_setShowTime(e){let t=document.getElementsByTagName("demand-video")[0].shadowRoot.getElementById("demandcontroller-bar").shadowRoot.querySelector("demand-video-controller-progress").shadowRoot.querySelector("demand-video-controller-preview").shadowRoot.querySelector(".Preview-Time");if(t){t.style.position="relative";t.style.bottom="60px";t.style.backgroundColor="rgba(0,0,0,0.4)";t.innerHTML=e}}var gifworkerStr=`(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPavarte&&this.globalPavarte.slice?this.globalPavarte:null;this.getImagePixels();this.analyzePixels();if(this.globalPavarte===true)this.globalPavarte=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePavarte();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPavarte)this.writePavarte();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPavarte=function(pavarte){this.globalPavarte=pavarte};GIFEncoder.prototype.getGlobalPavarte=function(){return this.globalPavarte&&this.globalPavarte.slice&&this.globalPavarte.slice(0)||this.globalPavarte};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j=0&&x1+x=0&&y1+y>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPavarte){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePavarte=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<0)cur_accum|=code<=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<>betashift;var betagamma=intbias<>3;var radiusbiasshift=6;var radiusbias=1<>3);var i,v;for(i=0;i>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(jlo){a=radpower[m++];if(jlo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i>intbiasshift-netbiasshift);if(biasdist>betashift;freq[i]-=betafreq;bias[i]+=betafreq<>1;for(j=previouscol+1;j>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i=0){if(i=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j\n `;let t=document.getElementsByClassName("player-dialog")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_VideoTools_Camera_Func(){let e=document.getElementsByClassName("layout-Player-video")[0];let t=document.getElementsByClassName("room-Player-Box")[0];let n=document.getElementById("ex-camera");let i=null;let o=0;let a=0;let l;let r=0;e.addEventListener("mouseenter",()=>{n.style.display="flex";r=setTimeout(()=>{n.style.display="none"},2e3)});t.addEventListener("mousemove",()=>{n.style.display="flex";clearTimeout(r);r=setTimeout(()=>{n.style.display="none"},2e3)});n.addEventListener("mouseenter",()=>{n.style.display="flex";clearTimeout(r)});e.addEventListener("mouseleave",()=>{n.style.display="none"});n.addEventListener("mousedown",e=>{a=(new Date).getTime();camera_canvas_img.getContext("2d").drawImage(liveVideoNode,0,0,camera_canvas_img.width,camera_canvas_img.height);l=camera_canvas_img.toDataURL("image/png");i=new GIF({workers:5,quality:3,width:camera_width,height:camera_height,workerScript:gifworkerBlob});cameraAddFrame(liveVideoNode,camera_canvas,i,camera_fps);o=setInterval(()=>{cameraAddFrame(liveVideoNode,camera_canvas,i,camera_fps)},camera_fps)});n.addEventListener("mouseup",e=>{let t=(new Date).getTime();clearInterval(o);if(t-a>=800){showMessage("【录制】正在生成gif...","info");i.on("finished",e=>{let t=document.createElement("a");t.href=URL.createObjectURL(e);t.download=`【${camera_anchorName}】${dateFormat("yyyy-MM-dd hh-mm-ss",new Date)}`;document.body.appendChild(t);let n=document.createEvent("MouseEvents");n.initEvent("click",false,false);t.dispatchEvent(n);document.body.removeChild(t)});i.render()}else{let e=document.createElement("a");e.download=`【${camera_anchorName}】${dateFormat("yyyy-MM-dd hh-mm-ss",new Date)}`;e.href=l;document.body.appendChild(e);let t=document.createEvent("MouseEvents");t.initEvent("click",false,false);e.dispatchEvent(t);document.body.removeChild(e)}})}function initPkg_VideoTools_Camera_Video(){let e=setInterval(()=>{liveVideoNode=document.getElementsByTagName("demand-video")[0].shadowRoot.getElementById("__video");if(liveVideoNode!==undefined&&liveVideoNode!==null&&liveVideoNode.videoWidth){clearInterval(e);camera_anchorName=document.getElementsByTagName("demand-video-anchor")[0].shadowRoot.querySelector(".anchor-name").innerText;camera_width=liveVideoNode.videoWidth*.25;camera_height=liveVideoNode.videoHeight*.25;camera_canvas=document.createElement("canvas");camera_canvas.width=camera_width;camera_canvas.height=camera_height;camera_canvas_img=document.createElement("canvas");camera_canvas_img.width=liveVideoNode.videoWidth;camera_canvas_img.height=liveVideoNode.videoHeight;initPkg_VideoTools_Camera_Video_Dom();initPkg_VideoTools_Camera_Video_Func()}},1e3)}function initPkg_VideoTools_Camera_Video_Dom(){Camera_Video_insertIcon()}function Camera_Video_insertIcon(){let e=document.createElement("div");e.id="ex-camera";e.title="单击截图 长按录制gif";e.innerHTML=`\n \n `;let t=document.getElementsByClassName("Video")[0];t.insertBefore(e,t.childNodes[0])}function initPkg_VideoTools_Camera_Video_Func(){let e=document.getElementsByTagName("demand-video")[0];let t=document.getElementById("ex-camera");let n=null;let i=0;let o=0;let a;let l=0;e.addEventListener("mouseenter",()=>{t.style.display="flex";l=setTimeout(()=>{t.style.display="none"},2e3)});e.addEventListener("mousemove",()=>{t.style.display="flex";clearTimeout(l);l=setTimeout(()=>{t.style.display="none"},2e3)});t.addEventListener("mouseenter",()=>{t.style.display="flex";clearTimeout(l)});e.addEventListener("mouseleave",()=>{t.style.display="none"});t.addEventListener("mousedown",e=>{o=(new Date).getTime();camera_canvas_img.getContext("2d").drawImage(liveVideoNode,0,0,camera_canvas_img.width,camera_canvas_img.height);a=camera_canvas_img.toDataURL("image/png");n=new GIF({workers:5,quality:3,width:camera_width,height:camera_height,workerScript:gifworkerBlob});cameraAddFrame(liveVideoNode,camera_canvas,n,camera_fps);i=setInterval(()=>{cameraAddFrame(liveVideoNode,camera_canvas,n,camera_fps)},camera_fps)});t.addEventListener("mouseup",e=>{let t=(new Date).getTime();clearInterval(i);if(t-o>=800){showMessage("【录制】正在生成gif...","info");n.on("finished",e=>{let t=document.createElement("a");t.href=URL.createObjectURL(e);t.download=`【${camera_anchorName}】${dateFormat("yyyy-MM-dd hh-mm-ss",new Date)}`;document.body.appendChild(t);let n=document.createEvent("MouseEvents");n.initEvent("click",false,false);t.dispatchEvent(n);document.body.removeChild(t)});n.render()}else{let e=document.createElement("a");e.download=`【${camera_anchorName}】${dateFormat("yyyy-MM-dd hh-mm-ss",new Date)}`;e.href=a;document.body.appendChild(e);let t=document.createEvent("MouseEvents");t.initEvent("click",false,false);e.dispatchEvent(t);document.body.removeChild(e)}})}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,i){let o=e;let a=t;let l=n;let r=0;a.onmousedown=function(e){let t=e||window.event;let n=t.clientX-this.offsetLeft;let s=this;document.onmousemove=function(e){let t=e||window.event;r=t.clientX-n;if(r<0)r=0;else if(r>o.offsetWidth-a.offsetWidth)r=o.offsetWidth-a.offsetWidth;l.style.width=r+"px";s.style.left=r+"px";i(parseInt(r/(o.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();initPkg_VideoTools_Camera()}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 i=false;let o;let a=0;let l;e.onmousedown=(e=>{if(e.button!==0){return}i=false;o=setTimeout(()=>{i=true;if(this.func_longClick!==null){this.func_longClick(e)}},t)});e.onmouseup=(e=>{if(e.button!==0){return}if(i==false){clearTimeout(o);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 i=document.querySelector(this.selector);if(i==null){return}let o=new MutationObserver(function(e){n(e)});this.observer=o;this.observer.observe(i,{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(i=>{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){i(false);return}let e=t.data[0].mid;let n=encodeURIComponent(JSON.stringify(t.data));i({mid:e,infoBack:n})}}})})}getStart(e,t,n,i,o){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="+i+"&infoBack="+o,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,i,o){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="+i+"&roomId="+rid+"&token="+t+"&infoBack="+o,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 i=-271733879;var o=-1732584194;var a=271733878;for(var l=0;l16)n=core_md5(n,e.length*chrsz);var i=Array(16),o=Array(16);for(var a=0;a<16;a++){i[a]=n[a]^909522486;o[a]=n[a]^1549556828}var l=core_md5(i.concat(str2binl(t)),512+t.length*chrsz);return core_md5(o.concat(l),512+128)}function safe_add(e,t){var n=(e&65535)+(t&65535);var i=(e>>16)+(t>>16)+(n>>16);return i<<16|n&65535}function bit_rol(e,t){return e<>>32-t}function str2binl(e){var t=Array();var n=(1<>5]|=(e.charCodeAt(i/chrsz)&n)<>5]>>>i%32&n);return t}function binl2hex(e){var t=hexcase?"0123456789ABCDEF":"0123456789abcdef";var n="";for(var i=0;i>2]>>i%4*8+4&15)+t.charAt(e[i>>2]>>i%4*8&15)}return n}function binl2b64(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";var n="";for(var i=0;i>2]>>8*(i%4)&255)<<16|(e[i+1>>2]>>8*((i+1)%4)&255)<<8|e[i+2>>2]>>8*((i+2)%4)&255;for(var a=0;a<4;a++){if(i*8+a*6>e.length*32)n+=b64pad;else n+=t.charAt(o>>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(i){if(t[i]){return t[i].exports}var o=t[i]={i:i,l:false,exports:{}};e[i].call(o.exports,o,o.exports,n);o.l=true;return o.exports}n.m=e;n.c=t;n.d=function(e,t,i){if(!n.o(e,t)){Object.defineProperty(e,t,{configurable:false,enumerable:true,get:i})}};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 i=t.noticeJsModalClassName="noticejs-modal";var o=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=r;var i=n(0);var o=a(i);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=o.Defaults;function r(e,t){if(e.callbacks.hasOwnProperty(t)){e.callbacks[t].forEach(function(t){if(typeof t==="function"){t.apply(e)}})}}var s=t.AddModal=function e(){if(document.getElementsByClassName(o.noticeJsModalClassName).length<=0){var t=document.createElement("div");t.classList.add(o.noticeJsModalClassName);t.classList.add("noticejs-modal-open");document.body.appendChild(t);setTimeout(function(){t.className=o.noticeJsModalClassName},200)}};var d=t.CloseItem=function e(t){r(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"){r(l,"onClick");d(t)}})}else{t.addEventListener("click",function(e){if(e.target.className!=="close"){r(l,"onClick")}})}t.addEventListener("mouseover",function(){r(l,"onHover")})};var u=t.appendNoticeJs=function e(t,n,i){var o=".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(i&&i!==""){a.appendChild(i)}if(["top","bottom"].includes(l.position)){document.querySelector(o).innerHTML=""}if(l.animation!==null&&l.animation.open!==null){a.className+=" "+l.animation.open}if(l.modal===true){a.setAttribute("noticejs-modal","true");s()}c(a,l.closeWith);r(l,"beforeShow");r(l,"onShow");document.querySelector(o).appendChild(a);r(l,"afterShow");return a}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var i=function(){function e(e,t){for(var n=0;n0&&arguments[0]!==undefined?arguments[0]:{};p(this,e);this.options=Object.assign(r.Defaults,t);this.component=new s.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}i(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 i=void 0;var o=void 0;n=this.component.createHeader(this.options.title,this.options.closeWith);i=this.component.createBody(this.options.text);if(this.options.progressBar===true){o=this.component.createProgressBar()}var a=c.appendNoticeJs(n,i,o);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 i=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 i=document.getElementsByClassName("btn-footer-ok");i[i.length-1].focus();i[i.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 i=document.getElementsByClassName("btn-footer-ok");i[i.length-1].focus();i[i.length-1].onclick=function(){if(e.onConfirm){e.onConfirm()}n.removeBox()};var o=document.getElementsByClassName("btn-footer-cancel");o[o.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 i=document.getElementsByClassName("postbird-prompt-input");i=i[i.length-1];i.focus();var o=document.getElementsByClassName("btn-footer-ok");var a=i.value;o[o.length-1].focus();o[o.length-1].onclick=function(){if(e.onConfirm){e.onConfirm(i.value)}n.removeBox()};var l=document.getElementsByClassName("btn-footer-cancel");l[l.length-1].onclick=function(){if(e.onCancel){e.onCancel(i.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,i){let o="80";switch(t){case"1":o="80";break;case"2":o="150";break;case"3":o="250";break;case"4":o="400";break;case"5":o="10000";break;default:o="80";break}GM_xmlhttpRequest({method:"GET",url:"https://api.live.bilibili.com/room/v1/Room/playUrl?cid="+e+"&qn="+o+"&platform=web",responseType:"json",onload:function(e){let t=e.response;let o="";if(t.data.durl!=null){o=t.data.durl[Number(n)].url}else{o=""}i(o)}})}function getRealRid_Bilibili(e,t){GM_xmlhttpRequest({method:"GET",url:e,responseType:"text",onload:function(e){let n=e.response;let i="";i=getStrMiddle(n,'room_id":',",");i=i.trim();if(i==""){i="-1"}t(i)}})}function getRealLive_Douyu(e,t,n,i,o){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 r=String(l[0]).replace("ub98484234","ub98484234_ex");eval1(r,"exScript1");let s=Math.round((new Date).getTime()/1e3).toString();RealLive_get_sign_url(e,s,n,i,o,t)}})}function RealLive_get_sign_url(e,t,n,i,o,a){let l=ub98484234_ex(e,getDyDid(),t);let r;if(i=="1015"){r=l+"&ver=219032101&rid="+e+"&rate=1"}else{r=l+"&ver=219032101&rid="+e+"&rate="+i}document.getElementById("exScript1").remove();GM_xmlhttpRequest({method:"POST",url:"https://m.douyu.com/api/room/ratestream",data:r,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 r="";switch(i){case"1":r="550p";break;case"2":r="1200p";break;case"3":r="2000p";break;case"4":r="4000p";break;default:r="1200p";break}let s="";if(l=="0"){s="None"}else{if(n==true){s=String(t.data.url).replace("m3u8","flv");s=s.replace("http:","https:")}else{if(i=="1015"){s="https://tx2play1.douyucdn.cn/live/"+l+".flv?uuid="}else{s="https://tx2play1.douyucdn.cn/live/"+l+"_"+r+".flv?uuid="}}s=a?s:s+"&only-audio=1"}o(s)}})}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 i="$ROOM.room_id =".length;let o=n.indexOf("$ROOM.room_id =");let a=n.substring(o+i,n.indexOf(";",o+i));a=a.trim();if(isRid(a)==true){t(a)}else{showMessage("获取直播间失败,请检查直播间地址是否正确!","error")}}).catch(e=>{console.log("请求失败!",e)})}function getRealLive_Huya(e,t,n){let i="500";switch(t){case"1":i="500";break;case"2":i="2500";break;case"3":i="4500";break;case"4":i="0";break;default:i="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 o=e.responseText;let a=/\\s*var liveLineUrl = "(.+)";\s*\<\/script\>/.exec(o);if(a==null){t="房间暂未开播"}else{a=a[1];a=a.replace(/(_\d+)(.m3u8)/,"$2");a="https:"+a;a=a+"&ratio="+i;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,i]=t.split("@=");e[n]=this.deserialize(this.unescape(i));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 i=e.createElement("style");i.id=t;i.innerHTML=n;e.body.append(i)}}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 i=new Uint8Array(n.length+4+4+2+1+1+1);let o=new Uint8Array(n.length);for(let e=0;e=65536&&i<=1114111){t.push(i>>18&7|240);t.push(i>>12&63|128);t.push(i>>6&63|128);t.push(i&63|128)}else if(i>=2048&&i<=65535){t.push(i>>12&15|224);t.push(i>>6&63|128);t.push(i&63|128)}else if(i>=128&&i<=2047){t.push(i>>6&31|192);t.push(i&63|128)}else{t.push(i&255)}}return t}function byteToString(e){if(typeof e==="string"){return e}let t="",n=e;for(let e=0;e>8*i+4&15]+n[e>>8*i&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){if(String(e).indexOf("?exClean")!=-1){initRouter_CleanVideo()}else if(String(e).indexOf("show/")!=-1){initRouter_Video()}}else if(String(e).indexOf("cz.douyu.com")!=-1){if(String(e).indexOf("?exClean")!=-1){initRouter_CleanCz()}}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_CleanCz(){let e=getStrMiddle(window.location.href,"domain=","&");cleanCookie(()=>{window.parent.postMessage("czCleanOver",decodeURIComponent(e))})}function initRouter_Video(){initStyles();initPkg_VideoTime();initPkg_VideoTools_Camera_Video()}function initRouter_FansBadgeList(){initPkg_FansBadgeList()}