"use strict"; // ==UserScript== // @name DouyuEx-斗鱼直播间增强插件 // @namespace https://github.com/qianjiachun // @icon https://s2.ax1x.com/2020/01/12/loQI3V.png // @version 2021.06.16.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/* // @match *://cz.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 // @connect doseeing.com // @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(); initPkg_TabSwitch(); } function initPkg_Timer() { initPkg_FishPond_Timer(); } function initTimer() { initPkg_Timer(); exTimer = setInterval(initPkg_Timer, 30000); } function initStyles() { let style = document.createElement("style"); style.appendChild(document.createTextNode(` #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 { background-color: rgba(255,255,255,0.9); width: 100%; height: 200px; position: relative; bottom: 200px; display: none; z-index: 1015;}.bloop__switch { position: absolute; right: 0; bottom: 0;}.bloop__mode { display: 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 { display: inline-block; vertical-align: middle; margin-right: 8px; -moz-user-select:none; /*火狐*/ -webkit-user-select:none; /*webkit浏览器*/ -ms-user-select:none; /*IE10*/ -khtml-user-select:none; /*早期浏览器*/ user-select:none;}.extool { background-color: rgba(255,255,255,0.9); width: 100%; height: 200px; position: relative; bottom: 200px; display: none; z-index: 1015;}.extool__switch { position: absolute; right: 0; bottom: 0;}.extool__bsize,.extool__sendgift { margin-bottom: 5px;}.extool__redpacket_room,.extool__gold { display: inline-block;}.ex_giftAnimation { width: 100%; height: 100%; position: absolute; z-index: 50; pointer-events: none;}.ex-panel { position: absolute; bottom: 35px; right: 38px; background-color: rgba(255,255,255,0.9); display: none; border: 2px rgb(234,173,26) solid; z-index: 1015; user-select: none;}.ex-panel__wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;}.ex-panel__icon { margin: 0 10px; display: block; position: relative; padding: 5px; transition: 0.5s;}.ex-panel__icon:hover { transform: scale(1.15);}.ex-panel__tip { display:none; background:#f00; border-radius:50%; width:8px; height:8px; top:0px; right:0px; position: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 { background-color: rgba(255,255,255,0.9); width: 100%; height: 290px; position: relative; bottom: 290px; display: none; z-index: 1015;}.livetool__cell { position: 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; background-color: #fff; border-bottom: 1px solid rgba(0,0,0,0.2); flex-wrap: wrap; -webkit-flex-wrap: wrap;}.livetool__cell_title { flex: 1; -webkit-box-flex: 1;}.livetool__cell_option { flex: 1; -webkit-box-flex: 1; text-align: right;}.livetool__cell_switch { float: 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;} `)); document.head.appendChild(style); } (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"); // 自己的uid var dyToken = getToken(); function showExPanel() { // 显示功能条 let a = document.getElementsByClassName("ex-panel")[0]; if (a.style.display != "block") { a.style.display = "block"; } else { a.style.display = "none"; } } function sleep(time) { return new Promise((resolve) => setTimeout(resolve, time)); } function formatSeconds(value) { let secondTime = parseInt(value); let minuteTime = 0; let hourTime = 0; if (secondTime > 60) { minuteTime = parseInt(secondTime / 60); secondTime = parseInt(secondTime % 60); if (minuteTime > 60) { hourTime = parseInt(minuteTime / 60); minuteTime = parseInt(minuteTime % 60); } } let result = "" + parseInt(secondTime) + "秒"; if (minuteTime > 0) { result = "" + parseInt(minuteTime) + "分" + result; } if (hourTime > 0) { result = "" + parseInt(hourTime) + "小时" + result; } return result; } function formatSeconds2(value) { var secondTime = parseInt(value); // 秒 var minuteTime = 0; // 分 var hourTime = 0; // 小时 if (secondTime > 60) { minuteTime = parseInt(secondTime / 60); secondTime = parseInt(secondTime % 60); if (minuteTime > 60) { hourTime = parseInt(minuteTime / 60); minuteTime = parseInt(minuteTime % 60); } } var result ="" +(parseInt(secondTime) < 10? "0" + parseInt(secondTime): parseInt(secondTime)); // if (minuteTime > 0) { result ="" + (parseInt(minuteTime) < 10? "0" + parseInt(minuteTime) : parseInt(minuteTime)) + ":" + result; // } // if (hourTime > 0) { result ="" + (parseInt(hourTime) < 10 ? "0" + parseInt(hourTime): parseInt(hourTime)) +":" + result; // } return result; } async function verifyFans(room_id, level) { return true; // 2020年12月22日18:28:18 let ret = false; let doc = await fetch('https://www.douyu.com/member/cp/getFansBadgeList',{ method: 'GET', mode: 'no-cors', cache: 'default', credentials: 'include', }).then(res => { return res.text(); }).catch(err => { console.log("请求失败!", err); }) doc = (new DOMParser()).parseFromString(doc, 'text/html'); let a = doc.getElementsByClassName("fans-badge-list")[0].lastElementChild; let n = a.children.length; for (let i = 0; i < n; i++) { let rid = a.children[i].getAttribute("data-fans-room"); let rlv = a.children[i].getAttribute("data-fans-level"); if (rid == room_id && rlv >= level) { ret = true; break; } else { ret = false; } } return ret; } function getStrMiddle(str, before, after) { let m = str.match(new RegExp(before + '(.*?)' + after)); return m ? m[1] : false; } function getToken() { // let cookie = document.cookie; // let ret = getStrMiddle(cookie, "acf_uid=", ";") + "_" + getStrMiddle(cookie, "acf_biz=", ";") + "_" + getStrMiddle(cookie, "acf_stk=", ";") + "_" + getStrMiddle(cookie, "acf_ct=", ";") + "_" + getStrMiddle(cookie, "acf_ltkid=", ";"); let ret = getCookieValue("acf_uid") + "_" + getCookieValue("acf_biz") + "_" + getCookieValue("acf_stk") + "_" + getCookieValue("acf_ct") + "_" + getCookieValue("acf_ltkid"); return ret; } function getDyDid() { // let cookie = document.cookie; // let ret = getStrMiddle(cookie, "dy_did=", ";"); let ret = getCookieValue("dy_did"); return ret; } function setCookie(cookiename, value){ let exp = new Date(); exp.setTime(exp.getTime() + 3*60*60*1000); document.cookie = cookiename + "="+ escape (value) + "; path=/; expires=" + exp.toGMTString(); } function getCookieValue(name){ let arr,reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)"); if (arr = document.cookie.match(reg)) { return unescape(arr[2]); } else { return null; } } function getCCN() { // let cookie = document.cookie; // let ret = getStrMiddle(cookie, "acf_ccn=", ";"); let ret = getCookieValue("acf_ccn"); if (ret == null) { setCookie("acf_ccn", "1"); ret = "1"; } return ret; } function getCTN() { // let cookie = document.cookie; // let ret = getStrMiddle(cookie, "acf_ccn=", ";"); let ret = getCookieValue("acf_ctn"); if (ret == null) { setCookie("acf_ctn", "1"); ret = "1"; } return ret; } function getCSRF() { let ret = getCookieValue("cvl_csrf_token"); if (ret == null) { setCookie("cvl_csrf_token", "1"); ret = "1"; } return ret; } function getUID() { let ret = getCookieValue("acf_uid"); return ret; } function showMessage(msg, type) { // type: success[green] error[red] warning[orange] info[blue] new NoticeJs({ text: msg, type: type, position: 'bottomRight', }).show(); } function openPage(url, b) { GM_openInTab(url, { active: b }); } 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(name) { let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); if (window.location.hash.indexOf("?") < 0) { return null; } let r = window.location.hash.split("?")[1].match(reg); if (r != null) return decodeURIComponent(r[2]); return null; } function dateFormat(fmt, date) { let o = { "M+": date.getMonth() + 1, "d+": date.getDate(), "h+": date.getHours(), "m+": date.getMinutes(), "s+": date.getSeconds(), "q+": Math.floor((date.getMonth() + 3) / 3), "S": date.getMilliseconds() }; if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length)); for (let k in o) if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length))); return fmt; } function getRandom(min, max) { return Math.floor(Math.random() * (max - min) + min); } function isRid(str) { if (/^[0-9]+$/.test(str)) { return true; } else { return false; } } function getAvailableSheet(index) { let ret = -1; for (let i = index; i < document.styleSheets.length - index; i++) { if (document.styleSheets[i].href == null) { ret = i; break; } else { ret = -1; } } return ret; } function showMessageWindow(title, content, callback){ if(window.Notification && Notification.permission !== "denied") { Notification.requestPermission(function(status) { var notice_ = new Notification(title, { body: content }); notice_.onclick = function() { callback(); } }); } } function getUserName() { return new Promise(resovle => { fetch('https://www.douyu.com/member/cp',{ method: 'GET', mode: 'no-cors', credentials: 'include', }).then(res => { return res.text(); }).then(txt => { txt = (new DOMParser()).parseFromString(txt, 'text/html'); let ret = txt.getElementsByClassName("uname_con")[0].title; resovle(ret); }).catch(err => { console.error('请求失败', err); }) }) } function getTextareaPosition(element) { // 获取textarea光标的位置 let cursorPos = 0; if (document.selection) {//IE let selectRange = document.selection.createRange(); selectRange.moveStart('character', -element.value.length); cursorPos = selectRange.text.length; } else if (element.selectionStart || element.selectionStart == '0') { cursorPos = element.selectionStart; } return cursorPos; } let svg_accountList = `` let cleanOverTimes = 0; // 用于判断是否全部清空并跳转 function initPkg_AccountList() { // GM_deleteValue("Ex_accountList"); // GM_deleteValue("Ex_accountListPassport"); // return; initPkg_AccountList_Dom(); initPkg_AccountList_Func(); } function initPkg_AccountList_Dom() { AccountList_insertIcon(); } function AccountList_insertIcon() { let a = document.createElement("div"); a.style = "position: absolute;right: -14px;top: 32px;cursor: pointer;" a.id = "ex-accountList-icon"; let html = `
${item.anchorName}:
${item.txt}
';
let b = document.getElementsByClassName("ex-panel__wrap")[0];
b.insertBefore(a, b.childNodes[0]);
}
function initPkg_FansContinue_Func() {
document.getElementsByClassName("fans-continue")[0].addEventListener("click", function() {
let sendNum = prompt("每个直播间赠送几根荧光棒?", "1");
if (sendNum == null) {
return;
}
if (sendNum == "") {
return;
}
fetch('https://www.douyu.com/member/cp/getFansBadgeList',{
method: 'GET',
mode: 'no-cors',
cache: 'default',
credentials: 'include',
}).then(res => {
return res.text();
}).then(async (doc) => {
doc = (new DOMParser()).parseFromString(doc, 'text/html');
let a = doc.getElementsByClassName("fans-badge-list")[0].lastElementChild;
let n = a.children.length;
for (let i = 0; i < n; i++) {
let rid = a.children[i].getAttribute("data-fans-room"); // 获取房间号
await sleep(250).then(() => {
sendGift_bag(268, Number(sendNum), rid).then(data => {
if (data.msg == "success") {
showMessage("【续牌】" + rid + "赠送荧光棒成功", "success");
// console.log(rid + "赠送一根荧光棒成功");
} else {
showMessage("【续牌】" + rid + "赠送失败 " + data.msg, "error");
// console.log(rid + "赠送失败");
console.log(rid, data);
}
}).catch(err => {
showMessage("【续牌】" + rid + "赠送失败", "error");
console.log(rid, err);
})
});
}
}).catch(err => {
console.log("请求失败!", err);
})
});
}
function sendGift_bag(gid, count, rid) {
// 送背包里的东西
// gid: 268是荧光棒
// count: 数量
// rid: 房间号
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=' + gid + '&propCount=' + count + '&roomId=' + rid + '&bizExt=%7B%22yzxq%22%3A%7B%7D%7D'
}).then(res => {
return res.json();
})
}
function initPkg_FirePower() {
initPkg_FirePower_Dom();
initPkg_FirePower_Func();
}
function initPkg_FirePower_Dom() {
FirePower_insertIcon();
}
function FirePower_insertIcon() {
let a = document.createElement("div");
a.className = "firepower";
a.innerHTML = '';
let b = document.getElementsByClassName("ex-panel__wrap")[0];
b.insertBefore(a, b.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(result => {
return result.json();
}).then(ret => {
let rid = ret.data;
window.location.href = "https://www.douyu.com/" + rid;
}).catch(err => {
console.log("请求失败!", err);
})
});
}
function initPkg_FishFood() {
initPkg_FishFood_Dom();
initPkg_FishFood_Func();
}
function initPkg_FishFood_Dom() {
FishFood_insertIcon();
}
function FishFood_insertIcon() {
let a = document.createElement("div");
a.className = "fish-food";
a.innerHTML = '';
let b = document.getElementsByClassName("ex-panel__wrap")[0];
b.insertBefore(a, b.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(res => {
// return res.json();
// }).then(async (ret) =>{
// let cnt = Math.floor(Number(ret.data.userActivePoint) / Number(ret.data.onceLotteryActivePoint));
// if (cnt == 0) {
// showMessage("【寻宝】" + "鱼粮不足", "warning");
// return;
// }
// cnt = Number(ret.data.dailyMaxLotteryTimes) - Number(ret.data.usedLotteryCount);
// if (cnt == 0) {
// showMessage("【寻宝】" + "今日寻宝次数已到达上限", "warning");
// return;
// }
// for (let i = 0; i < cnt; i++) {
// await sleep(1500).then(() => {
// 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(res => {
// return res.json();
// }).then(ret => {
// if (ret.data != null) {
// if (Object.keys(ret.data).length != 0) {
// showMessage("【寻宝】" + ret.data.msg, "success");
// }
// } else {
// showMessage("【寻宝】" + ret.msg, "warning");
// }
// // console.log("【寻宝】" + ret.data.msg);
// }).catch(err => {
// console.log("请求失败!", err);
// })
// })
// }
// })
// })
document.getElementsByClassName("fish-food")[0].addEventListener("click", function() {
getFishFoodV2();
fetch("https://www.douyu.com/japi/activepointnc/apinc/lotteryV2", {
method: 'POST',
mode: 'no-cors',
credentials: 'include',
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).then(res => {
return res.json();
}).then(async (ret) =>{
let cnt = Math.floor(Number(ret.data.yuliang) / Number(ret.data.cost));
if (cnt == 0) {
showMessage("【寻宝】" + "鱼粮不足", "warning");
return;
}
cnt = Number(ret.data.leftChance);
if (cnt == 0) {
showMessage("【寻宝】" + "今日寻宝次数已到达上限", "warning");
return;
}
for (let i = 0; i < cnt; i++) {
await sleep(1500).then(() => {
fetch("https://www.douyu.com/japi/activepointnc/apinc/doLotteryV2", {
method: 'POST',
mode: 'no-cors',
credentials: 'include',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'rid=' + rid + '&ctn=' + getCCN()
}).then(res => {
return res.json();
}).then(ret => {
if (ret.data != null) {
if (Object.keys(ret.data).length != 0) {
showMessage("【寻宝】" + ret.data.lotteryRes.data.msg, "success");
}
} else {
showMessage("【寻宝】" + ret.msg, "warning");
}
// console.log("【寻宝】" + ret.data.msg);
}).catch(err => {
console.log("请求失败!", err);
})
})
}
})
})
}
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(res => {
return res.json();
}).then(async (ret) =>{
if (ret.data == null) {
return;
}
let cnt = Number(ret.data.leftChance);
if (cnt == 0) {
showMessage("【高级寻宝】" + "今日寻宝次数已到达上限", "warning");
return;
}
if (Number(ret.data.yuliang) < Number(ret.data.cost)) {
showMessage("【高级寻宝】" + "鱼粮不足", "warning");
return;
}
for (let i = 0; i < cnt; i++) {
await sleep(1500).then(() => {
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(res => {
return res.json();
}).then(ret => {
if (ret.data != null) {
if (Object.keys(ret.data).length != 0) {
showMessage("【高级寻宝】" + ret.data.lotteryRes.data.msg, "success");
}
} else {
showMessage("【高级寻宝】" + ret.msg, "warning");
}
// console.log("【寻宝】" + ret.data.msg);
}).catch(err => {
console.log("请求失败!", err);
})
})
}
})
}
function initPkg_FishPond() {
initPkg_FishPond_Dom();
initPkg_FishPond_Func();
}
function initPkg_FishPond_Timer() {
// 这里挂载每个子模块的时钟周期函数
initPkg_FishPond_Bubble_Timer();
initPkg_FishPond_Box_Timer();
// initPkg_FishPond_Task_Timer();
initPkg_FishPond_RoomSign_Timer();
initPkg_FishPond_Task2_Timer();
}
function initPkg_FishPond_Func() {
}
function initPkg_FishPond_Dom() {
FishPond_insertIcon();
}
function FishPond_insertIcon() {
}
function getAllFishPond() {
initPkg_FishPond_Bubble();
initPkg_FishPond_Box();
// initPkg_FishPond_Task();
// initPkg_FishPond_RoomSign();
// initPkg_FishPond_Task2();
}
function FishPond_showTip(a) {
// let d = document.getElementById("fish-pond__tip");
// if (a == true) {
// if (d.style.display != "block") {
// showMessage("【鱼粮】有鱼粮可以领取啦!", "info");
// d.style.display = "block";
// }
// } else {
// d.style.display = "none";
// }
}
let boxList = [];
function initPkg_FishPond_Box() {
getFishPond_Box();
}
function initPkg_FishPond_Box_Timer() {
getFishPond_BoxList();
}
function getFishPond_Box() {
// 清空boxList内的气泡
if (boxList.length == 0) {
// showMessage("【鱼塘宝箱】暂无可领取的鱼粮", "info");
return;
}
let arr = boxList.concat();
for (let i = 0; i < arr.length; i++) {
GM_xmlhttpRequest({
method: "POST",
url: "https://pcapi.douyucdn.cn/japi/tasksys/ytxb/getPrize",
data: "id=" + arr[i] + "&token=" + dyToken,
responseType: "json",
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
},
onload: function(response) {
showMessage("【鱼塘宝箱】" + response.response.data.msg, "success");
// console.log("【鱼塘宝箱】" , response.response.msg, response.response);
}
});
}
// FishPond_showTip(false);
boxList.length = 0;
}
function getFishPond_BoxList() {
// 获取可领取的鱼粮,如果有,就显示小红点
GM_xmlhttpRequest({
method: "POST",
url: "https://pcapi.douyucdn.cn/japi/tasksys/ytxb/box",
data: 'token=' + dyToken,
responseType: "json",
headers: {
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
},
onload: function(response) {
boxList.length = 0;
for (let i = 0; i < response.response.data.length; i++) {
if (response.response.data[i] != null) {
if (response.response.data[i].status == "2") {
boxList.push(response.response.data[i].id);
getAllFishPond();
}
}
}
}
});
}
let bubbleList = [];
function initPkg_FishPond_Bubble() {
getFishPond_Bubble();
}
function initPkg_FishPond_Bubble_Timer() {
getFishPond_BubbleList();
}
function getFishPond_Bubble() {
// 清空bubbleList内的气泡
if (bubbleList.length == 0) {
// showMessage("【鱼塘气泡】暂无可领取的鱼粮", "info");
return;
}
let bubbleToGet = "";
for (let i = 0; i < bubbleList.length; i++) {
if (i != bubbleList.length - 1) {
bubbleToGet = bubbleToGet + bubbleList[i] + "%2C";
} else {
bubbleToGet = bubbleToGet + bubbleList[i];
}
}
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=' + bubbleToGet + '&rid=' + rid
}).then(res => {
return res.json();
}).then(ret => {
let result = "";
for (let i = 0; i < ret.data.prizeList.length; i++) {
result = result + ret.data.prizeList[i].num + "个" + ret.data.prizeList[i].name + ",";
}
bubbleList.length = 0; // 此处领取完毕,小红点也要去掉
// FishPond_showTip(false);
showMessage("【鱼塘气泡】领取结果:" + result, "success");
// console.log("【鱼塘气泡】领取结果:" + result, ret);
}).catch(err => {
console.log("请求失败!", err);
})
}
function getFishPond_BubbleList() {
// 获取可领取的鱼粮,如果有,就显示小红点
fetch('https://www.douyu.com/japi/tasksys/ytxb/bubble',{
method: 'GET',
mode: 'no-cors',
credentials: 'include'
}).then(res => {
return res.json();
}).then(ret => {
bubbleList.length = 0;
for (let i = 0; i < ret.data.list.length; i++) {
if (ret.data.list[i] != null) {
if (ret.data.list[i].status == "2") {
bubbleList.push(ret.data.list[i].id);
getAllFishPond();
}
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
let roomSignList = [];
function initPkg_FishPond_RoomSign() {
getFishPond_RoomSign();
}
function initPkg_FishPond_RoomSign_Timer() {
getFishPond_RoomSignList();
}
function getFishPond_RoomSign() {
// 清空roomSignList内的气泡
// if (roomSignList.length == 0) {
// // showMessage("【签到宝箱】暂无可领取的鱼粮", "info");
// return;
// }
// let arr = roomSignList.concat();
// for (let i = 0; i < arr.length; i++) {
// 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(res => {
// return res.json();
// }).then(ret => {
// if (ret.error == "0") {
// showMessage("【签到宝箱】领取结果:" + ret.msg, "success");
// }
// }).catch(err => {
// console.log("请求失败!", err);
// })
// }
// // FishPond_showTip(false);
// roomSignList.length = 0;
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(res => {
return res.json();
}).then(ret => {
if (ret.error == "0") {
showMessage("【签到宝箱】领取结果:" + ret.msg, "success");
}
}).catch(err => {
console.log("请求失败!", err);
})
}
function getFishPond_RoomSignList() {
fetch('https://www.douyu.com/japi/roomuserlevel/apinc/levelInfo?rid=' + rid + '&clientType=0',{
method: 'GET',
mode: 'no-cors',
credentials: 'include'
}).then(res => {
return res.json();
}).then(ret => {
if (ret.error == "0" ) {
if (ret.data.treasure.status == "1") {
// roomSignList.push("1");
// getAllFishPond();
getFishPond_RoomSign();
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
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(res => {
return res.json();
}).then(ret => {
if (ret.data !== null) {
for (let i = 0; i < ret.data.length; i++) {
showMessage("【鱼塘任务】领取结果:成功领取" + ret.data[i].name + ret.data[i].num + "个", "success");
}
}
}).catch(err => {
console.log("请求失败!", err);
})
if (taskList.length == 0) {
// showMessage("【鱼塘任务】暂无可领取的鱼粮", "info");
return;
}
let arr = taskList.concat();
for (let i = 0; i < arr.length; i++) {
fetch('https://www.douyu.com/japi/tasksys/ytxb/getPrize',{
method: 'POST',
mode: 'no-cors',
credentials: 'include',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: 'id=' + arr[i] + '&roomId=' + rid
}).then(res => {
return res.json();
}).then(ret => {
// console.log("【鱼塘任务】领取结果:", ret);
showMessage("【鱼塘任务】领取结果:" + ret.data.msg, "success");
}).catch(err => {
console.log("请求失败!", err);
})
}
taskList.length = 0;
// FishPond_showTip(false);
}
function getFishPond_TaskList() {
// 获取可领取的鱼粮,如果有,就显示小红点
taskList.length = 0;
getFishPond_TaskList_Day();
getFishPond_TaskList_Week();
getFishPond_TaskList_Ytzb();
// getFishPond_TaskList_Client();
}
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(res => {
return res.json();
}).then(ret => {
for (let i = 0; i < ret.data.list.length; i++) {
if (ret.data.list[i].status == "2") {
taskList.push(ret.data.list[i].id);
getAllFishPond();
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
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(res => {
return res.json();
}).then(ret => {
for (let i = 0; i < ret.data.list.length; i++) {
if (ret.data.list[i].status == "2") {
taskList.push(ret.data.list[i].id);
getAllFishPond();
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
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(res => {
return res.json();
}).then(ret => {
for (let i = 0; i < ret.data.list.length; i++) {
if (ret.data.list[i].status == "2") {
taskList.push(ret.data.list[i].id);
getAllFishPond();
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
function initPkg_FishPond_Task2() {
getFishPond_Task2();
}
function initPkg_FishPond_Task2_Timer() {
getFishPond_Task2();
}
async function getFishPond_Task2() {
let taskList = await getFishPond_Task2List();
if (taskList.data == null) {
return;
}
getFishPond_Task2Panel(taskList.data.panel);
getFishPond_Task2Bubble(taskList.data.bubble);
}
function getFishPond_Task2List() {
return new Promise(resolve => {
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(res => {
return res.json();
}).then(ret => {
resolve(ret);
}).catch(err => {
console.log("请求失败!", err);
})
})
}
async function getFishPond_Task2Panel(panelList) {
for (let i = 0; i < panelList.length; i++) {
let item = panelList[i];
for (let j = 0; j < item.taskList.length; j++) {
let taskItem = item.taskList[j].task;
if (taskItem.status == 2) {
let id = taskItem.id;
// 领取
await sleep(1500).then(() => {
getFishPond_Task2GetPrize(id);
})
}
}
}
}
function getFishPond_Task2GetPrize(id) {
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=' + id + '&rid=' + rid + '&ctn=' + getCCN()
}).then(res => {
return res.json();
}).then(ret => {
if (ret.error == 0) {
showMessage("【高级鱼塘】" + ret.data.msg, "success");
} else {
showMessage("【高级鱼塘】" + ret.msg, "error");
}
}).catch(err => {
console.log("请求失败!", err);
})
}
async function getFishPond_Task2Bubble(bubbleList) {
for (let i = 0; i < bubbleList.length; i++) {
let item = bubbleList[i];
if (item.status == 2) {
let id = item.id;
await sleep(1500).then(() => {
getFishPond_Task2GetPrize(id);
})
}
}
}
let followListHook;
function initPkg_FollowList() {
let intID = setInterval(() => {
if (typeof(document.getElementsByClassName("DropPane-icon Follow-icon")[0]) != "undefined") {
followListHook = new DomHook(".Header-follow-content", false, handleFollowList)
clearInterval(intID);
}
}, 1000);
}
function handleFollowList(m) {
let active = document.getElementsByClassName("Header-follow-tab is-active")[0].innerText;
if (active == "特别关注") {
return;
}
let panel = document.getElementsByClassName("Header-follow-listWrap");
if (panel.length == 0) {
return;
}
panel[0].style.marginTop = "12px";
document.getElementsByClassName("Header-follow-listBox")[0].style.display = "none";
setNewFollowList(panel[0]);
}
async function setNewFollowList(panel) {
let followList = await getFollowList();
if (followList.error != "0") {
return;
}
const FOLLOWLIST_LIMIT = 10; // 关注列表最多显示个数
let limit = 0;
let html = `${ item.online }${ item.room_name }
${ item.nickname }已播${ formatSeconds(nowTime - Number(item.show_time)) }
${ item.online }${ item.room_name }
${ item.nickname }已播${ formatSeconds(nowTime - Number(item.show_time)) }
| 排名 | 昵称 | 积分 |
|---|---|---|
| ${ i + 1 } | ${ ret.data[i].id } | ${ ret.data[i].point } |
滤镜