"use strict"; // ==UserScript== // @name DouyuEx-斗鱼直播间增强插件 // @namespace https://github.com/qianjiachun // @icon https://s2.ax1x.com/2020/01/12/loQI3V.png // @version 2020.04.24.01 // @description 弹幕自动变色防检测循环发送 一键续牌 查看真实人数/查看主播数据 已播时长 一键签到(直播间/车队/鱼吧/客户端) 一键领取鱼粮(宝箱/气泡/任务) 一键寻宝 送出指定数量的礼物 一键清空背包 屏蔽广告 调节弹幕大小 自动更新 同屏画中画/多直播间小窗观看/可在斗鱼看多个平台直播(b站虎牙) 获取真实直播流地址 自动抢礼物红包 跳转随机火力全开房间 背包信息扩展 简洁模式 夜间模式 // @author 小淳 // @match *://*.douyu.com/0* // @match *://*.douyu.com/1* // @match *://*.douyu.com/2* // @match *://*.douyu.com/3* // @match *://*.douyu.com/4* // @match *://*.douyu.com/5* // @match *://*.douyu.com/6* // @match *://*.douyu.com/7* // @match *://*.douyu.com/8* // @match *://*.douyu.com/9* // @match *://*.douyu.com/topic/* // @match *://msg.douyu.com/* // @require https://cdn.jsdelivr.net/npm/flv.js@1.5.0/dist/flv.min.js // @grant GM_openInTab // @grant GM_xmlhttpRequest // @grant GM_setClipboard // @downloadURL none // ==/UserScript== function initPkg() { initPkg_ExIcon(); initPkg_ExPanel(); initPkg_RemoveAD(); initPkg_RealAudience(); initPkg_CopyRealLive(); initPkg_Refresh(); initPkg_BagInfo(); initPkg_Update(); initPkg_FirePower(); initPkg_PopupPlayer(); initPkg_ExpandTool(); initPkg_Night(); initPkg_BarrageLoop(); initPkg_FansContinue(); initPkg_FishFood(); initPkg_FishPond(); initPkg_Sign(); } function initPkg_Timer() { initPkg_FishPond_Timer(); } function initTimer() { initPkg_Timer(); exTimer = setInterval(initPkg_Timer, 20000); } function initStyles() { let style = document.createElement("style"); style.appendChild(document.createTextNode(` .bag-info { position: absolute; background-color: rgba(0, 0, 0, 0.6); color: white; width: 20px; font-weight: 800; height: 20px; text-align: center; } .bloop { background-color: rgba(255,255,255,0.9); width: 100%; height: 200px; position: relative; bottom: 200px; display: none; } .bloop__switch { position: absolute; right: 0; bottom: 0; } #copy-real-live { cursor: pointer; } .ex-icon { display: inline-block; vertical-align: middle; margin-right: 8px; } .extool { background-color: rgba(255,255,255,0.9); width: 100%; height: 200px; position: relative; bottom: 200px; display: none; } .extool__switch { position: absolute; right: 0; bottom: 0; } .extool__bsize,.extool__sendgift { margin-bottom: 5px; } .ex-panel { width: 550px; height: 50px; position: absolute; bottom: 35px; right: 50px; background-color: rgba(255,255,255,0.9); display: none; border: 2px rgb(234,173,26) solid; } .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; } .ex-panel__tip { display:none; background:#f00; border-radius:50%; width:8px; height:8px; top:0px; right:0px; position:absolute; } .videoDiv { width: 400px; height: 200px; background-color: rgba(255, 255, 255, 0); position: absolute; z-index: 7777; } .videoPlayer { width: 100%; height: 100%; cursor: move; } .videoScale { width: 10px; height: 10px; overflow: hidden; cursor: se-resize; position: absolute; right: 0; bottom: 0; background-color: rgb(231, 57, 57); } .videoInfo { width: 100%; height: 30px; background-color: gray; position: absolute; top: -30px; line-height: 30px; } .videoClose { width: 30px; float: right; color: white; } .videoQn, .videoCDN { margin-left: 5px; } .videoRID { margin: 0px 5px; font-weight: 800; font-size: medium; } #popup-player__prompt { display: none; } .postbird-box-container{width:100%;height:100%;overflow:hidden;position:fixed;top:0;left:0;z-index:9999;display:block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.postbird-box-container.active{display:block}.postbird-box-content{width:400px;max-width:90%;min-height:170px;background-color:#fff;border:solid 1px #dfdfdf;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);margin-top:-100px}.postbird-box-header{width:100%;padding:10px 15px;position:relative;font-size:1.1em;letter-spacing:2px}.postbird-box-close-btn{cursor:pointer;font-weight:700;color:#000;float:right;opacity:.5;font-size:1.3em;margin-top:-3px;display:none}.postbird-box-close-btn:hover{opacity:1}.postbird-box-text{box-sizing: border-box;width:100%;padding:0 10%;text-align:center;line-height:40px;font-size:20px;letter-spacing:1px}.postbird-box-footer{width:100%;position:absolute;bottom:0;padding:0;margin:0;display:flex;display:-webkit-flex;justify-content:space-around;border-top:solid 1px #dfdfdf;align-items:flex-end}.postbird-box-footer .btn-footer{line-height:44px;border:0;cursor:pointer;background-color:#fff;color:#0e90d2;font-size:1.1em;letter-spacing:2px;transition:background-color .5s;-webkit-transition:background-color .5s;-o-transition:background-color .5s;-moz-transition:background-color .5s;outline:0}.postbird-box-footer .btn-footer:hover{background-color:#e5e5e5}.postbird-box-footer .btn-block-footer{width:100%}.postbird-box-footer .btn-left-footer,.postbird-box-footer .btn-right-footer{position:relative;width:100%}.postbird-box-footer .btn-left-footer::after{content:"";position:absolute;right:0;top:0;background-color:#e5e5e5;height:100%;width:1px}.postbird-box-footer .btn-footer-cancel{color:#333}.postbird-prompt-input{width:100%;padding:5px;font-size:16px;border:1px solid #ccc;outline:0} .real-audience { cursor: pointer; } #refresh-video { float: left; width: 24px; height: 24px; margin-right: 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} `)); document.head.appendChild(style); } (function() { if (window.location.host == "msg.douyu.com") { if (getQueryString("exid") == "chun") { signMotorcade_Sign(getQueryString("mid"), getQueryString("total")); } } else { if (String(location.href).indexOf("exid=chun") != -1) { let intID = setInterval(() => { if (typeof(document.querySelector('div.wfs-2a8e83')) != "undefined") { document.querySelector('div.wfs-2a8e83').click(); document.querySelector('label.layout-Player-asidetoggleButton').click(); let l = document.querySelectorAll(".tip-e3420a > ul > li").length; document.querySelectorAll(".tip-e3420a > ul > li")[l - 1].click(); clearInterval(intID); } }, 1000); } else { let intID = setInterval(() => { if (typeof(document.getElementsByClassName("BackpackButton")[0]) != "undefined") { setTimeout(() => { initStyles(); initPkg(); initTimer(); }, 1500) clearInterval(intID); } }, 1000); } } })(); // 全局变量及公共函数 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(); 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); } } var result = "" + parseInt(secondTime) + "秒"; if (minuteTime > 0) { result = "" + parseInt(minuteTime) + "分" + result; } if (hourTime > 0) { result = "" + parseInt(hourTime) + "小时" + result; } return result; } async function verifyFans(room_id, level) { 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){ var 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 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) { var 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 (var 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 initPkg_BagInfo() { initPkg_BagInfo_Func(); } function initPkg_BagInfo_Func() { document.getElementsByClassName("BackpackButton")[0].addEventListener("click", function() { setTimeout(() => { if (document.getElementsByClassName("Backpack JS_Backpack").length > 0) { getBagGifts(rid, (ret) => { let chunkNum = ret.data.list.length; if (chunkNum > 0) { let totalPrice = 0; let totalIntimate = 0; for (let i = 0; i < chunkNum; i++) { let chunk = document.getElementsByClassName("Backpack-prop")[i]; let isValuable = ret.data.list[i].isValuable; // 判断是否是有价值的礼物 let expiry = ret.data.list[i].expiry; // 过期时间 let price = ret.data.list[i].price; // 注意这个要除100才是真实价格,否则是亲密度 let intimate = ret.data.list[i].intimate; // 亲密度 let count = ret.data.list[i].count; // 数量 if (isValuable == "1") { totalPrice = totalPrice + Number(price) * Number(count); } totalIntimate = totalIntimate + Number(intimate) * Number(count); let expiryDiv = document.createElement("div"); expiryDiv.className = "bag-info"; expiryDiv.innerHTML = expiry; chunk.insertBefore(expiryDiv, chunk.childNodes[0]); } document.getElementsByClassName("Backpack-space")[0].innerText = "总价值:" + String(Number(totalPrice / 100).toFixed(2)) + " 总亲密度:" + String(totalIntimate); } }); } }, 300); }); } 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 html = ""; let a = document.createElement("div"); a.className = "bloop"; html += '
'; html += ''; html += '
';
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() {
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, 1, 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() {
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);
})
})
}
})
})
}
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();
}
function initPkg_FishPond_Func() {
document.getElementsByClassName("fish-pond")[0].addEventListener("click", function() {
// 这里挂载每个子模块的函数入口
// 入口即为调用
// 调用的是每个子模块的领取接口
initPkg_FishPond_Bubble();
initPkg_FishPond_Box();
initPkg_FishPond_Task();
})
}
function initPkg_FishPond_Dom() {
FishPond_insertIcon();
}
function FishPond_insertIcon() {
let a = document.createElement("div");
a.className = "fish-pond";
a.innerHTML = '';
let b = document.getElementsByClassName("ex-panel__wrap")[0];
b.insertBefore(a, b.childNodes[0]);
}
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";
}
}
var 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") {
FishPond_showTip(true);
boxList.push(response.response.data[i].id);
}
}
}
}
});
}
var 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.length; i++) {
result = result + ret.data[i].num + "个" + ret.data[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);
FishPond_showTip(true);
}
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
var 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 => {
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") {
FishPond_showTip(true);
taskList.push(ret.data.list[i].id);
}
}
}).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") {
FishPond_showTip(true);
taskList.push(ret.data.list[i].id);
}
}
}).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") {
FishPond_showTip(true);
taskList.push(ret.data.list[i].id);
}
}
}).catch(err => {
console.log("请求失败!", err);
})
}
// function getFishPond_TaskList_Client() {
// console.log("哦嚯嚯",dyToken);
// GM_xmlhttpRequest({
// method: "POST",
// url: "https://pcapi.douyucdn.cn/japi/tasksys/ytxb/userStatusV2",
// data: "cycleType=26&roomId=" + rid + "&tagId=1&token=" + dyToken,
// responseType: "json",
// headers: {
// 'Content-Type': 'application/x-www-form-urlencoded'
// },
// onload: function(response) {
// let ret = response.response;
// console.log("哈哈哈哈:",ret);
// for (let i = 0; i < ret.data.list.length; i++) {
// if (ret.data.list[i].status == "2") {
// FishPond_showTip(true);
// taskList.push(ret.data.list[i].id);
// }
// }
// }
// });
// }
var sheetIndex2 = 0; // 这里的sheetIndex2用的是弹幕大小的全局变量,所以这个模块包一定要在ExpanTool后面加载
let svg_night = '';
let svg_day = '';
let num_css = 0; // 这个变量用于存储一共定义了多少个css
let currentMode = 0; // 0日间模式 1夜间模式
function initPkg_Night() {
sheetIndex2 = getAvailableSheet(sheetIndex + 1);
if (sheetIndex2 == -1) {
return;
}
initPkg_Night_Dom();
initPkg_Night_Func();
initPkg_Night_Set();
}
function initPkg_Night_Dom() {
Night_insertIcon();
}
function Night_insertIcon() {
let a = document.createElement("div");
a.style = "position: absolute;right: -75px;top: 18px;cursor: pointer;"
a.id = "ex-night";
a.innerHTML = svg_day;
a.title = "切换夜间模式";
let b = document.getElementsByClassName("Header-right")[0];
b.appendChild(a);
}
function saveData_Mode() {
// 0日间模式 1夜间模式
let data = {
mode: currentMode
}
localStorage.setItem("ExSave_Mode", JSON.stringify(data));
}
function initPkg_Night_Set() {
let ret = localStorage.getItem("ExSave_Mode");
let a = document.getElementById("ex-night");
if (ret != null) {
let retJson = JSON.parse(ret);
if (retJson.mode == undefined) {
retJson.mode = 0;
}
if (retJson.mode == 1) {
currentMode = 1;
a.innerHTML = svg_night;
a.title = "切换日间模式";
setNightMode();
}
}
}
function initPkg_Night_Func() {
document.getElementById("ex-night").addEventListener("click", function() {
let a = document.getElementById("ex-night");
if (currentMode == 0) {
currentMode = 1;
a.innerHTML = svg_night;
a.title = "切换日间模式";
setNightMode();
} else {
currentMode = 0;
a.innerHTML = svg_day;
a.title = "切换夜间模式";
cancelNightMode();
}
saveData_Mode();
});
}
function setNightMode() {
setBarrageLayoutBackgroundColor("background-color:rgba(37,38,42,1) !important;");
setBarrageUserEnterBackgroundColor("background-color:rgba(37,38,42,1) !important;color:rgba(187,187,187,1) !important;");
setBarrageContentColor("color:rgba(187,187,187,1) !important;");
setBarrageTextColor("color:rgba(187,187,187,1) !important;");
setBarrageNoticeBackgroundColor("background-color:rgba(37,38,42,1) !important;border:rgba(37,38,42,1) solid 1px !important;");
setLayoutPlayerTitleBackgroundColor("background-color:rgba(35,36,39,1) !important;border:rgba(35,36,39,1) solid 1px !important;");
setTitleHeaderColor("color:rgba(191,191,191,1) !important;");
setTitleAnchorTextColor("color:rgba(107,176,125,1) !important;");
setTitleRowTextColor("color:rgba(153,153,153,1) !important;");
setAnchorNameColor("color:rgba(153,153,153,1) !important;");
setLayoutPlayerToolbarBackgroundColor("background:rgb(37,38,42) !important;border:1px solid rgb(37,38,42) !important;");
setWealthNumColor("color:rgb(191,191,191) !important;");
setLayoutMainBackgroundColor("background-color:rgba(35,36,39,1) !important;");
setRankWrapBackgroundColor("background:rgba(47,48,53,1) !important;border:rgba(47,48,53,1) solid 1px !important;");
setBgIconBackgroundDisplay("display:none;");
setChatRankWeekBackgroundColor("background-color:rgba(47,48,53,1) !important;");
setNobleRankBackgroundColor("background-color:rgba(47,48,53,1) !important;");
setAsideMainBorderColor("border:1px solid rgba(37,38,42,1) !important;background-color:rgb(47,48,53) !important;");
setChatBackgroundColor("background:rgba(47,48,53,1) !important;color:rgb(187,187,187) !important;border-radius:0px !important;");
setChatTabBackgroundColor("background:rgb(29,32,35) !important;border:1px solid rgb(47,48,53) !important;");
setChatTabActiveBackgroundColor("background:rgb(47,48,53) !important;");
setFansRankInfoBackgroundColor("background:rgb(37,43,51) !important;");
setFansRankInfoTxtColor("color:rgb(121,127,137) !important;");
setBarrageBorderColor("border:1px solid rgba(35,36,39,1) !important;");
setLayoutPlayerChatBorderColor("border-top:1px solid rgba(47,48,53,1) !important;");
setLayoutPlayerAnnounceBackgroundColor("background-color:rgb(29,32,35) !important;border:1px solid rgb(29,32,35) !important;");
setFansRankBottomBorderColor("border-top:1px solid rgb(121,127,137) !important;");
setChatBarrageCollectTipBackgroundColor("background:rgb(47,48,53) !important;");
setTitleOfficialBackgroundColor("background:rgb(35,36,39) !important;");
setHeaderBackgroundColor("background:rgb(45,46,54) !important;border-bottom:1px solid rgb(45,46,54) !important;");
setHeaderTxtColor("color:rgb(191,191,191) !important");
setSuperMenuBackgroundColor("background:rgb(47,48,53) !important;border:1px solid rgb(35,36,39) !important;");
setGuessMainPanelBackgroundColor("background:rgb(47,48,53) !important;border:1px solid rgb(47,48,53) !important;");
setDanmuAuthorBackgroundColor("color:rgb(234,234,234) !important;");
setDanmuDivBackgroundColor("background:rgba(47,49,53,0.9) !important;");
setDanmuContentBackgroundColor("background:rgba(35,36,39,0.9) !important;");
setDanmuWordBackgroundColor("background:rgba(35,36,39,0.9) !important;color:rgb(187,187,187) !important;");
setFansMedalPanelBackgroundColor("color:black !important;");
setAnchorLikeBorderColor("border:1px solid rgb(35,36,39) !important;");
setAnchorFriendCardColor("color:rgb(204,204,204) !important;");
}
function cancelNightMode() {
let a = document.styleSheets[sheetIndex2];
let idx = a.rules.length - 1;
for (let i = 0; i < num_css; i++) {
a.removeRule(idx);
idx = idx - 1;
}
}
function setBarrageLayoutBackgroundColor(t) {
// background:rgb(37,38,42) !important;
// document.styleSheets[sheetIndex2].removeRule(roleIndex_barrageLayout);
document.styleSheets[sheetIndex2].addRule(".layout-Player-barrage", t);
num_css = num_css + 1;
}
function setBarrageUserEnterBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".Barrage-userEnter", t);
num_css = num_css + 1;
}
function setBarrageContentColor(t) {
// color:rgb(187,187,187) !important;
// document.styleSheets[sheetIndex2].removeRule(roleIndex_barrageContent);
document.styleSheets[sheetIndex2].addRule(".Barrage-content", t);
num_css = num_css + 1;
}
function setBarrageTextColor(t) {
// color:rgb(187,187,187) !important;
// document.styleSheets[sheetIndex2].removeRule(roleIndex_barrageText);
document.styleSheets[sheetIndex2].addRule(".Barrage-text", t);
num_css = num_css + 1;
}
function setBarrageNoticeBackgroundColor(t) {
// color:rgb(187,187,187) !important;
// document.styleSheets[sheetIndex2].removeRule(roleIndex_barrageNotice);
document.styleSheets[sheetIndex2].addRule(".Barrage-notice--noble", t);
num_css = num_css + 1;
}
function setLayoutPlayerTitleBackgroundColor(t) {
// background:rgb(37,38,42) !important;
document.styleSheets[sheetIndex2].addRule(".layout-Player-title", t);
num_css = num_css + 1;
}
function setTitleHeaderColor(t) {
document.styleSheets[sheetIndex2].addRule(".Title-header", t);
num_css = num_css + 1;
// document.getElementsByClassName("Title-header")[0].style.color = t;
}
function setFollowNumColor(t) {
document.styleSheets[sheetIndex2].addRule(".Title-followNum", t);
num_css = num_css + 1;
// document.getElementsByClassName("Title-followNum")[0].style.color = t;
}
function setTitleAnchorTextColor(t) {
document.styleSheets[sheetIndex2].addRule(".Title-anchorText", t);
num_css = num_css + 1;
// document.getElementsByClassName("Title-anchorText")[0].style.color = t;
}
function setAnchorNameColor(t) {
document.styleSheets[sheetIndex2].addRule(".Title-anchorName", t);
num_css = num_css + 1;
// document.getElementsByClassName("Title-anchorName")[0].style.color = t;
}
function setTitleRowTextColor(t) {
// background:rgb(37,38,42) !important;
document.styleSheets[sheetIndex2].addRule(".Title-row-text", t);
num_css = num_css + 1;
}
function setLayoutPlayerToolbarBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule("#js-player-toolbar", t);
num_css = num_css + 1;
// document.getElementById("js-player-toolbar").style.backgroundColor = t;
}
function setWealthNumColor(t) {
document.styleSheets[sheetIndex2].addRule(".PlayerToolbar-wealthNum", t);
num_css = num_css + 1;
}
function setLayoutMainBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".layout-Main", t);
num_css = num_css + 1;
// document.getElementsByClassName("layout-Main")[0].style.backgroundColor = t;
}
function setRankWrapBackgroundColor(t) {
// 47,48,53
document.styleSheets[sheetIndex2].addRule(".ChatRank-rankWraper", t);
num_css = num_css + 1;
}
function setBgIconBackgroundDisplay(t) {
document.styleSheets[sheetIndex2].addRule(".bg-icon", t);
num_css = num_css + 1;
}
function setChatRankWeekBackgroundColor(t) {
// ChatRankWeek-headerContent is-active
document.styleSheets[sheetIndex2].addRule(".ChatRankWeek-headerContent", t);
num_css = num_css + 1;
// document.getElementsByClassName("ChatRankWeek-headerContent")[0].style.backgroundColor = t;
}
function setNobleRankBackgroundColor(t) {
// document.getElementsByClassName("NobleRank")[0].style.backgroundColor = t;
// document.getElementsByClassName("NobleRankTips")[0].style.backgroundColor = t;
document.styleSheets[sheetIndex2].addRule(".NobleRank", t);
num_css = num_css + 1;
document.styleSheets[sheetIndex2].addRule(".NobleRankTips", t);
num_css = num_css + 1;
}
function setAsideMainBorderColor(t) {
document.styleSheets[sheetIndex2].addRule("#js-player-asideMain", t);
num_css = num_css + 1;
// document.getElementById("js-player-asideMain").style.border = t;
}
function setChatBackgroundColor(t) {
// document.getElementsByClassName("Chat")[0].style.background = t;
// document.getElementsByClassName("ChatSend-txt")[0].style.background = t;
document.styleSheets[sheetIndex2].addRule(".Chat", t);
num_css = num_css + 1;
document.styleSheets[sheetIndex2].addRule(".ChatSend-txt", t);
num_css = num_css + 1;
}
function setChatTabBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".ChatTabContainer-titleWraper--tabLi", t);
num_css = num_css + 1;
}
function setChatTabActiveBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".ChatTabContainer-titleWraper--tabLi.is-active", t);
num_css = num_css + 1;
}
function setFansRankInfoBackgroundColor(t) {
// #fff9f3 原
// 37,43,51
document.styleSheets[sheetIndex2].addRule(".FansRankInfo", t);
num_css = num_css + 1;
// document.getElementsByClassName("FansRankInfo")[0].style.background = t;
}
function setFansRankInfoTxtColor(t) {
// #3c3c3c 原
// 121,127,137
document.styleSheets[sheetIndex2].addRule(".FansRankInfo-txt", t);
num_css = num_css + 1;
}
function setBarrageBorderColor(t) {
// .Barrage
document.styleSheets[sheetIndex2].addRule(".Barrage", t);
num_css = num_css + 1;
// document.getElementsByClassName("Barrage")[0].style.border = t;
}
function setLayoutPlayerChatBorderColor(t) {
document.styleSheets[sheetIndex2].addRule(".layout-Player-chat", t);
num_css = num_css + 1;
// document.getElementsByClassName("layout-Player-chat")[0].style.borderTop = t;
}
function setLayoutPlayerAnnounceBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".layout-Player-announce", t);
num_css = num_css + 1;
// document.getElementsByClassName("layout-Player-announce")[0].style.backgroundColor = t;
}
function setFansRankBottomBorderColor(t) {
// 1px solid #e8e8e8; 原版
document.styleSheets[sheetIndex2].addRule(".FansRankBottom", t);
num_css = num_css + 1;
}
function setChatBarrageCollectTipBackgroundColor(t) {
// #ffe9d5原版
document.styleSheets[sheetIndex2].addRule(".ChatBarrageCollect-tip", t);
num_css = num_css + 1;
// document.getElementsByClassName("ChatBarrageCollect-tip")[0].style.background = t;
}
function setTitleOfficialBackgroundColor(t) {
// #fff0e2原版
document.styleSheets[sheetIndex2].addRule(".Title-official", t);
num_css = num_css + 1;
// document.getElementsByClassName("Title-official")[0].style.background = t;
}
function setHeaderBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".Header-wrap", t);
num_css = num_css + 1;
// document.getElementsByClassName("Header-wrap")[0].style.background = t;
}
function setHeaderTxtColor(t) {
// .Header-wrap .Header-menu-link>a
document.styleSheets[sheetIndex2].addRule(".Header-wrap .Header-menu-link>a", t);
document.styleSheets[sheetIndex2].addRule(".public-DropMenu-link", t);
document.styleSheets[sheetIndex2].addRule(".Header-icon", t);
num_css = num_css + 3;
}
function setSuperMenuBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".layout-Menu", t);
num_css = num_css + 1;
}
function setGuessMainPanelBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".GuessMainPanel", t);
num_css = num_css + 1;
}
function setDanmuDivBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".danmudiv-32f498", t);
num_css = num_css + 1;
}
function setDanmuAuthorBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".danmuAuthor-3d7b4a", t);
num_css = num_css + 1;
}
function setDanmuContentBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".danmuContent-25f266", t);
num_css = num_css + 1;
}
function setDanmuWordBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".word-89c053", t);
num_css = num_css + 1;
}
function setFansMedalPanelBackgroundColor(t) {
document.styleSheets[sheetIndex2].addRule(".FansMedalPanel-Panel", t);
num_css = num_css + 1;
}
function setAnchorLikeBorderColor(t) {
document.styleSheets[sheetIndex2].addRule(".AnchorLike-ItemBox", t);
num_css = num_css + 1;
}
function setAnchorFriendCardColor(t) {
document.styleSheets[sheetIndex2].addRule(".AnchorFriendCard-info>h3", t);
num_css = num_css + 1;
}
let videoPlayerArr = [];
function initPkg_PopupPlayer() {
initPkg_PopupPlayer_Dom();
initPkg_PopupPlayer_Func();
}
function initPkg_PopupPlayer_Dom() {
PopupPlayer_insertIcon();
PopupPlayer_insertPrompt();
}
function PopupPlayer_insertIcon() {
let a = document.createElement("div");
a.className = "popup-player";
a.innerHTML = '';
let b = document.getElementsByClassName("ex-panel__wrap")[0];
b.insertBefore(a, b.childNodes[0]);
}
function PopupPlayer_insertPrompt() {
let a = document.createElement("div");
let html = "";
a.className = "postbird-box-container";
a.id = "popup-player__prompt"
html += '