Greasy Fork is available in English.

简单斗鱼(贵族弹幕样式&&聊天区域铭牌)

一个兴趣使然的脚本,本来只是屏蔽火箭横幅的脚本,到后来。。。 【✅功能按钮】 默认最高画质、弹幕悬停、竞猜显示、抽奖显示、背景显示、礼物栏简化、聊天框简化、禁言消息显示、聊天框用户铭牌显示、显示房间数据(👨‍👩‍👧‍👦人数、💸消费、⏱️时长)、默认网页全屏、夜间模式。 【✅默认设置】左侧展开默认收起、弹幕简化(贵族弹幕)、聊天框消息简化(大部分系统消息)【✅屏蔽】屏蔽内容过多,这里就不展开了....

Installer ce script?
Script suggéré par l'auteur

Vous pourriez également aimer 微博一键下载(9宫格&&视频).

Installer ce script
  1. // ==UserScript==
  2. // @name 简单斗鱼(贵族弹幕样式&&聊天区域铭牌)
  3. // @namespace https://github.com/wah0713/douyuRemoveAds
  4. // @version 2.4.10
  5. // @description 一个兴趣使然的脚本,本来只是屏蔽火箭横幅的脚本,到后来。。。 【✅功能按钮】 默认最高画质、弹幕悬停、竞猜显示、抽奖显示、背景显示、礼物栏简化、聊天框简化、禁言消息显示、聊天框用户铭牌显示、显示房间数据(👨‍👩‍👧‍👦人数、💸消费、⏱️时长)、默认网页全屏、夜间模式。 【✅默认设置】左侧展开默认收起、弹幕简化(贵族弹幕)、聊天框消息简化(大部分系统消息)【✅屏蔽】屏蔽内容过多,这里就不展开了....
  6. // @supportURL https://github.com/wah0713/douyuRemoveAds/issues
  7. // @author wah0713
  8. // @compatible chrome
  9. // @license MIT
  10. // @icon https://www.douyu.com/favicon.ico
  11. // @require https://code.jquery.com/jquery-1.12.4.min.js
  12. // @match *://*.douyu.com/*
  13. // @match *://douyu.com/*
  14. // @connect doseeing.com
  15. // @noframes true
  16. // @run-at document-idle
  17. // @grant GM_setValue
  18. // @grant GM_getValue
  19. // @grant GM_addStyle
  20. // @grant GM_xmlhttpRequest
  21. // @grant unsafeWindow
  22. // ==/UserScript==
  23.  
  24. (function () {
  25. if (!/^\/\d+$/.test(window.location.pathname) && window.location.pathname.indexOf('topic') === -1) return false
  26.  
  27. // 版本号
  28. const version = '2.4.4'
  29. // 更新说明
  30. const updateNotes = version + `:<br>
  31. 1PK条是否显示__本功能由【backuponeday】提出<br>
  32. 2、屏蔽一些广告 <br>
  33. `
  34. // 房间id
  35. const rid = getRoomId()
  36. // layoutMain的初始MarginTop
  37. let originalLayoutMainMarginTop = null
  38. // layoutMain的初始OffsetTop
  39. let originalayoutMainOffsetTop = null
  40. let sign = 0
  41. // Background-holder的原始paddingTop值
  42. let InitiaGuessGameHeight = 0
  43. // 计时器
  44. let showRoomDataInterval = null
  45.  
  46. // 只执行一次
  47. const once = {
  48. backgroundIsShow: true,
  49. InitiaGuessGameHeight: true,
  50. }
  51.  
  52. function getRoomId() {
  53. try {
  54. return $('html').html().match(/(?<=\$ROOM\.room_id \= )\d+/)[0]
  55. } catch (error) {
  56. return unsafeWindow.rid || unsafeWindow.apm_room_id || null
  57. }
  58. }
  59. $('body').append(`<div id='wah0713-alert'><i></i><span></span></div>`)
  60.  
  61. /**
  62. * 提示框
  63. * @param {string} message 内容
  64. * @param {string} type 类型
  65. * @param {number} time 延迟时间
  66. * @param {dom} dom 控制的dom
  67. */
  68. function myAlert(params) {
  69. if (params.type === 'warning') {
  70. $('#wah0713-alert').removeClass().addClass('warning').children('i').text('x')
  71.  
  72. $('#wah0713-alert >span').html(params.message)
  73.  
  74. $('#wah0713-alert').show()
  75. setTimeout(() => {
  76. $('#wah0713-alert').hide()
  77. }, params.time * 1000)
  78.  
  79. } else if (params.type === 'info') {
  80.  
  81. $('#wah0713-alert').removeClass().addClass('info').children('i').text('i')
  82.  
  83. params.dom.off("mouseleave").mouseleave(() => {
  84. $('#wah0713-alert').hide()
  85. })
  86. params.dom.off("mouseenter").mouseenter(() => {
  87. $('#wah0713-alert >span').html(params.message)
  88. params.callBack && params.callBack()
  89. $('#wah0713-alert').show()
  90. })
  91. }
  92. }
  93.  
  94. // 右侧自定义按钮模块
  95. $('body').append(`
  96. <div id="wah0713">
  97. <div class="gear" style="display: none;"><img src="https://s11.ax1x.com/2023/03/11/ppuTXKf.png">
  98. <div class="redDot"></div>
  99. </div>
  100. </div>
  101. `)
  102. $('#wah0713').off("mouseenter").mouseenter(() => {
  103. $('#wah0713 .gear').fadeOut("slow")
  104. myAlert({
  105. message: updateNotes,
  106. type: 'info',
  107. dom: $('#wah0713 >.tip'),
  108. callBack: () => {
  109. // 提示用户更新内容
  110. GM_setValue('version', version)
  111. $('#wah0713').removeClass('hasUpdate')
  112. }
  113. })
  114. }).off("mouseleave").mouseleave(() => {
  115. $('#wah0713 .gear').fadeIn("slow")
  116. })
  117.  
  118. setTimeout(() => {
  119. $('#wah0713 .gear').fadeIn("slow")
  120. }, 3 * 1000);
  121.  
  122. // 版本号和提示语
  123. $("#wah0713").append(`<p class='tip'>${version}版本(更新内容详情)</p>`)
  124. /**
  125. * 封装按钮显示事件
  126. * @param {string} localStorageName 按钮本地存储名
  127. * @param {string} displayName 按钮显示名
  128. */
  129. function btnListFun(localStorageName, displayName, description) {
  130. $("#wah0713").append(`<button class='${localStorageName}' title='${description}'>${displayName}(close)</button>`)
  131.  
  132. function btnInit() {
  133. if (!config[localStorageName]) {
  134. $(`#wah0713 .${localStorageName}`).addClass('close').text(`${displayName}(close)`)
  135. } else {
  136. $(`#wah0713 .${localStorageName}`).removeClass('close').text(`${displayName}(open)`)
  137. }
  138. }
  139. btnInit()
  140. $(`#wah0713 .${localStorageName}`).off("click").click(() => {
  141. const value = !config[localStorageName]
  142. config[localStorageName] = value
  143. GM_setValue(localStorageName, value)
  144. btnInit()
  145. if (typeof (once[localStorageName]) !== 'undefined') {
  146. once[localStorageName] = true
  147. }
  148. })
  149. }
  150.  
  151. // 用户默认配置
  152. const defaultConfig = {
  153. adjustClarity: {
  154. name: '默认最高画质',
  155. description: '开启当前房间最高画质,可能会闪一次屏__本功能由【noob-one】提出',
  156. value: false,
  157. firstDelayTime: 10 * 1000,
  158. action: (value) => {
  159. if (!value) return false
  160.  
  161. if ($('.adjustClarity')[0].style.display !== 'none' && value) {
  162. let ul = $('.c5-6a3710[value="画质 "]~ul')
  163. let firstChild = $('.c5-6a3710[value="画质 "]~ul li:first-child')
  164. if (ul && !firstChild.hasClass('selected-3a8039')) {
  165. firstChild.click()
  166. }
  167. ul = null
  168. firstChild = null
  169. }
  170.  
  171. }
  172. },
  173. isWebFullScreen: {
  174. name: '默认网页全屏',
  175. description: '进入页面时选择网页全屏__本功能由【shadow XX】提出',
  176. value: false,
  177. action: async (value) => {
  178. if (value) {
  179. // 双击事件
  180. $('._1GyzL9trVIbYlAVmuA9KJ1')[0].dispatchEvent(new CustomEvent('dblclick'))
  181. }
  182. }
  183. },
  184. ishideDanmu: {
  185. name: '默认关闭弹幕',
  186. description: '进入页面时选择关闭弹幕__本功能由【elexenon】提出',
  187. value: false,
  188. firstDelayTime: 10 * 1000,
  189. action: async (value) => {
  190. const isShow = $('.hidedanmu-5d54e2').hasClass('removed-9d4c42')
  191. $('.shidedanmu-5d54e2').hasClass('.removed-9d4c42')
  192. if (value && isShow) {
  193. // 隐藏
  194. $('.showdanmu-42b0ac').click()
  195. } else if (!value && !isShow) {
  196. // 显示
  197. $('.hidedanmu-5d54e2').click()
  198. }
  199. }
  200. },
  201. danmuMove: {
  202. name: '弹幕悬停',
  203. description: '播放器内弹幕被选中时悬停__本功能由【noob-one】提出',
  204. value: false,
  205. },
  206. guessIsShow: {
  207. name: '竞猜显示',
  208. description: '竞猜是否显示__本功能由【noob-one】提出',
  209. value: false,
  210. },
  211. hidePk: {
  212. name: 'PK条显示',
  213. description: 'PK条是否显示__本功能由【backuponeday】提出',
  214. value: true,
  215. action: async (value) => {
  216. if (value) {
  217. $('html').removeClass('hidePk');
  218. } else {
  219. $('html').addClass('hidePk');
  220. }
  221. }
  222. },
  223. lotteryIsShow: {
  224. name: '抽奖显示',
  225. description: '抽奖是否显示__本功能由【lv88ff】提出',
  226. value: false,
  227. },
  228. isShowHighEnergyBarrageContainer: {
  229. name: '高能弹幕显示',
  230. description: '高能弹幕是否显示__本功能由【随机的名字】提出',
  231. value: false,
  232. },
  233. backgroundIsShow: {
  234. name: '背景显示',
  235. description: '背景是否显示__本功能由【dongliang zhang】提出',
  236. value: false,
  237. },
  238. playerBottomSimplification: {
  239. name: '礼物栏简化',
  240. description: '播放器下方礼物栏简化__本功能由【evenora】提出',
  241. value: true,
  242. },
  243. chatBoxCleaning: {
  244. name: '聊天框简化',
  245. description: '聊天框头部去除主播公告、贡献周榜、贵宾、粉丝团和主播通知__本功能由【dongliang zhang】提出',
  246. value: true,
  247. },
  248. forbiddenMessage: {
  249. name: '禁言消息显示',
  250. description: '聊天框内用户被禁言消息是否显示__本功能由【lv88ff】提出',
  251. value: false,
  252. },
  253. isShowNickName: {
  254. name: '用户铭牌显示',
  255. description: '聊天框用户铭牌是否显示__本功能由【W.ast】和【BerryBarry11】提出',
  256. value: false,
  257. action: async (value) => {
  258. const $barrageList = await walk(() => findDom('.Barrage-list'))
  259. if (!value) {
  260. $barrageList.addClass('trim')
  261. } else {
  262. $barrageList.removeClass('trim')
  263. }
  264. }
  265. },
  266. isShowRoomData: {
  267. name: '显示房间数据',
  268. description: '显示房间数据(时间范围今天00:00到今晚24:00),12分钟刷新数据一次__本功能由【BerryBarry11】提出',
  269. value: true,
  270. firstDelayTime: 10 * 1000,
  271. action: (value) => {
  272. clearInterval(showRoomDataInterval)
  273. if (value) {
  274. showRoomData()
  275. showRoomDataInterval = setInterval(showRoomData, 12 * 60 * 1000)
  276. } else {
  277. hideRoomData()
  278. }
  279. }
  280. },
  281. isblackMode: {
  282. name: '夜间模式',
  283. description: '夜间模式__本功能由【超新星燃烧小行星带】提出',
  284. value: false,
  285. action: (value) => {
  286. if (value) {
  287. $('html').addClass('black')
  288. } else {
  289. $('html').removeClass('black')
  290. }
  291. }
  292. },
  293. // isAutoSendBarrage: {
  294. // name: '自动发弹幕',
  295. // description: '自动发弹幕__本功能由【wulawaya】提出',
  296. // value: false,
  297. // action: (value) => {
  298. // if (value) {
  299. // autoSendBarrageTimer = autoSendBarrage({
  300. // sendStr: '1',
  301. // checkStr: '你',
  302. // repetitions: 1,
  303. // time: 5, // min
  304. // checkNum: 30
  305. // })
  306. // } else {
  307. // clearTimeout(autoSendBarrageTimer)
  308. // }
  309. // }
  310. // },
  311. }
  312.  
  313. let autoSendBarrageTimer
  314. let autoSendBarrageTime
  315. // [{}]
  316. var autoSendBarrage = ({
  317. sendStr,
  318. checkStr = '',
  319. repetitions = 5,
  320. time = 5, // min
  321. checkNum = 30
  322. }) => {
  323. if (!sendStr) return false
  324.  
  325. let $content = $('.Barrage-list .Barrage-listItem .Barrage-content')
  326. let num = 0
  327.  
  328. $($content.toArray().reverse()).each(function (index, item) {
  329. if (index >= checkNum) {
  330. return false
  331. }
  332. const text = $(item).text().trim()
  333. if (text.includes(checkStr.trim())) {
  334. num++
  335. }
  336. });
  337.  
  338. console.log(`num`, num)
  339. if (num >= repetitions) {
  340. danmuSend(sendStr)
  341. autoSendBarrageTime = new Date().getTime()
  342. }
  343. }
  344.  
  345. function danmuSend(str) {
  346. $('.ChatSend-txt').val(str)
  347. $('.ChatSend-button').click()
  348. }
  349.  
  350. const config = new Proxy({}, {
  351. set: function (target, propKey, value, receiver) {
  352. const {
  353. firstDelayTime,
  354. action
  355. } = defaultConfig[propKey]
  356.  
  357. if (firstDelayTime && action) {
  358. // 首次延迟
  359. requestAnimationFrame(() => {
  360. $(`button.${propKey}`).attr("disabled", true)
  361. setTimeout(() => {
  362. action(value)
  363. defaultConfig[propKey].firstDelayTime = 0
  364. $(`button.${propKey}`).attr("disabled", false)
  365. }, firstDelayTime)
  366. })
  367. } else if (action) {
  368. action(value)
  369. }
  370. return Reflect.set(target, propKey, value, receiver);
  371. }
  372. })
  373.  
  374. for (let key in defaultConfig) {
  375. const {
  376. name,
  377. description,
  378. value
  379. } = defaultConfig[key]
  380. config[key] = GM_getValue(key, value)
  381. // 按钮事件
  382. btnListFun(key, name, description)
  383. }
  384.  
  385. // 左侧展开默认收起
  386. if ($(".Aside-main--shrink").width() > 100) {
  387. $(".Aside-toggle").click()
  388. }
  389.  
  390. // 提示用户更新
  391. const [large1, medium1] = version.split('.').map(Number)
  392. const [large2, medium2] = GM_getValue('version', '0.0.0').split('.').map(Number)
  393. // todo
  394. if (GM_getValue('2.04', false) || medium1 === medium2 && large1 === large2) {
  395. $('#wah0713').removeClass('hasUpdate')
  396. } else {
  397. $('#wah0713').addClass('hasUpdate')
  398. }
  399.  
  400. let body = $('body')[0]
  401. const MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver
  402.  
  403. const observer = new MutationObserver(function () {
  404.  
  405. // 获取初始竞猜高度
  406. if (once.InitiaGuessGameHeight && $('.Bottom-guessGame-placeholder').length) {
  407. InitiaGuessGameHeight = $('.Bottom-guessGame-placeholder').height()
  408. once.InitiaGuessGameHeight = false
  409. }
  410.  
  411. // 自定义按钮显示条件
  412. if ($('.UnLogin').length) {
  413. $('.adjustClarity').hide()
  414. $('.danmuMove').hide()
  415. } else {
  416. $('.adjustClarity').show()
  417. $('.danmuMove').show()
  418. }
  419.  
  420. // 抽奖显示
  421. if (config.lotteryIsShow) {
  422. // 抽奖中间部提示框
  423. $(".LotteryContainer").show()
  424. // 抽奖(播放器左下角)
  425. $(".UPlayerLotteryEnter").removeClass('is-hide')
  426. // 中奖播放器中显示
  427. $(".LotteryContainer-svgaWrap").show()
  428. // 粉丝福利社抽奖
  429. $('.LotteryDrawEnter').show()
  430.  
  431. } else {
  432. // 抽奖中间部提示框
  433. $(".LotteryContainer").hide()
  434. // 抽奖(播放器左下角)
  435. $(".UPlayerLotteryEnter").addClass('is-hide')
  436. // 中奖播放器中显示
  437. $(".LotteryContainer-svgaWrap").hide()
  438. // 粉丝福利社抽奖
  439. $('.LotteryDrawEnter').hide()
  440. }
  441.  
  442. // 屏蔽播放器内大多活动
  443. $('.player-dialog').children().each((index, dom) => {
  444. if (config.lotteryIsShow) {
  445. if (!$(dom).find('.LotteryContainer').length && !$(dom).has('.DoublePlayerList').length) {
  446. $(dom).hide()
  447. } else {
  448. $(dom).show()
  449. }
  450. } else if (!$(dom).has('.DoublePlayerList').length) {
  451. $(dom).hide()
  452. } else {
  453. $(dom).show()
  454. }
  455. })
  456.  
  457.  
  458. if (config.playerBottomSimplification) {
  459. $('.ActivityItem').removeClass('is-hide')
  460. if (!config.guessIsShow) {
  461. $('.ActiviesExpanel').addClass('is-hide')
  462. } else {
  463. $('.ActiviesExpanel').removeClass('is-hide')
  464. $('.ActiviesExpandPanel').css({
  465. width: 'auto',
  466. 'margin-left': '0',
  467. })
  468. }
  469. $('.ActivityItem:not(.ActivityItem[data-flag="room_level"]):not(.ActivityItem[data-flag="anchor_quiz"])').addClass('is-hide')
  470. $('.PlayerToolbar-Task').addClass('is-hide')
  471. $('.RomanticAct').addClass('is-hide')
  472. $('.ActCenterPkEntry').addClass('is-hide')
  473. $('.PartyEntry').addClass('is-hide')
  474. $('.ToolbarActivityArea>div:last-child>div>div:not(.LotteryDrawEnter)').addClass('is-hide')
  475. } else {
  476. $('.ActivityItem').removeClass('is-hide')
  477. $('.ActiviesExpanel').removeClass('is-hide')
  478. $('.PlayerToolbar-Task').removeClass('is-hide')
  479. $('.RomanticAct').removeClass('is-hide')
  480. $('.ActCenterPkEntry').removeClass('is-hide')
  481. $('.PartyEntry').removeClass('is-hide')
  482. $('.ToolbarActivityArea>div:last-child>div>div:not(.LotteryDrawEnter)').removeClass('is-hide')
  483. }
  484.  
  485. // 主播公告、贡献周榜、贵宾和粉丝团
  486. if (config.chatBoxCleaning) {
  487. $(".layout-Player-asideMainTop").addClass("hide")
  488. } else {
  489. $(".layout-Player-asideMainTop").removeClass("hide")
  490. }
  491.  
  492. // 是否显示【高能弹幕】
  493. if (config.isShowHighEnergyBarrageContainer) {
  494. $(".HighEnergyBarrageContainer").removeClass("is-hide")
  495. } else {
  496. $(".HighEnergyBarrageContainer").addClass("is-hide")
  497. }
  498.  
  499. // 弹幕悬停关闭
  500. if ($('.danmuMove')[0].style.display !== 'none' && config.danmuMove) {
  501. $('.room-Player-Box').removeClass('mark')
  502. } else {
  503. $('.room-Player-Box').addClass('mark')
  504. }
  505.  
  506. // 竞猜显示
  507. if (config.guessIsShow) {
  508. // 聊天框用户竞猜获奖
  509. $('.Barrage-list .Barrage-guess').parent('.Barrage-listItem').show()
  510. $('.ActivityItem[data-flag="anchor_quiz"]').show()
  511. $('.GuessGameMiniPanelB-wrapper').show()
  512. $('.guessGameContainer').show()
  513. $('.Bottom-guessGame-placeholder').height(InitiaGuessGameHeight)
  514. } else {
  515. // 聊天框用户竞猜获奖
  516. $('.Barrage-list .Barrage-guess').parent('.Barrage-listItem').hide()
  517. $('.ActivityItem[data-flag="anchor_quiz"]').hide()
  518. $('.GuessGameMiniPanelB-wrapper').hide()
  519. $('.guessGameContainer').hide()
  520. $('.Bottom-guessGame-placeholder').height(0)
  521. }
  522.  
  523. // 背景图
  524. let $layoutMain = $('.layout-Main')
  525. if (config.backgroundIsShow && !$('.is-fullScreenPage').length) {
  526. if (once.backgroundIsShow) {
  527. $('html').removeClass('no-background')
  528. // 恢复除播放器以外的多余bc-wrapper元素
  529. $('.bc-wrapper').show()
  530.  
  531. $('.wm-general').show().removeClass('top100')
  532.  
  533. $('.wm-general-bgblur').removeClass('background-image-hide')
  534.  
  535. $layoutMain[0].style = ""
  536. setTimeout(() => {
  537. window.scrollTo(0, $('.layout-Player').offset().top - 100)
  538. }, 200)
  539. once.backgroundIsShow = false
  540. }
  541. } else if (!$('.is-fullScreenPage').length) {
  542. $('html').addClass('no-background')
  543. // 暴雪频道特有
  544. if (originalayoutMainOffsetTop && (originalayoutMainOffsetTop > $(window).height() * 1 / 2)) {
  545. $('body').addClass('go-beyound')
  546. } else {
  547. $('body').removeClass('go-beyound')
  548. }
  549.  
  550. !originalLayoutMainMarginTop && (originalLayoutMainMarginTop = $layoutMain.css('margin-top').split('px')[0] - 0)
  551. if (once.backgroundIsShow) {
  552. setTimeout(() => {
  553. originalayoutMainOffsetTop = $layoutMain.offset().top
  554. if (originalayoutMainOffsetTop < 70) {
  555. const gaps = 70 - originalayoutMainOffsetTop
  556. $layoutMain.css('margin-top', originalLayoutMainMarginTop + gaps)
  557. } else {
  558. $layoutMain[0].style = ""
  559. }
  560. window.scrollTo(0, $('.layout-Player').offset().top - 100)
  561. }, 200)
  562. once.backgroundIsShow = false
  563. }
  564.  
  565. // 去掉除播放器以外的多余bc-wrapper元素
  566. $('.bc-wrapper').each((index, element) => {
  567. $(element).children().each((idx, ele) => {
  568. if ($(ele).hasClass('layout-Main')) {
  569. sign = index
  570. return false
  571. }
  572. })
  573. })
  574.  
  575. $('.wm-general').each((idx, dom) => {
  576. if ($(dom).find('div.layout-Main').length) {
  577. $(dom).addClass('top100')
  578. } else {
  579. $(dom).hide()
  580. }
  581. })
  582. $('.wm-general-bgblur').addClass('background-image-hide')
  583.  
  584. $('.bc-wrapper').not($('.bc-wrapper')[sign]).hide()
  585. }
  586.  
  587. // 输入框上方送礼3000毫米淡出
  588. $('#js-player-barrage .BarrageBanner').children().delay(1000 * 3).fadeOut('slow')
  589.  
  590. // 聊天框用户点赞 (parents多个s)
  591. $('.Barrage-list .roomDianzanIcon').parents('.Barrage-listItem').hide()
  592.  
  593. // 聊天框用户相关消息广播
  594. // 系统提示(例如禁言)Barrage-notice--red
  595. $('.Barrage-list .Barrage-icon--sys').each((idx, dom) => {
  596. let domParent = $(dom).parent('.Barrage-listItem')
  597. if (config.forbiddenMessage) {
  598. if (domParent.find('.Barrage-text').text().indexOf("禁言") === -1) {
  599. domParent.hide()
  600. } else {
  601. domParent.show()
  602. }
  603. } else {
  604. domParent.hide()
  605. }
  606. domParent = null
  607. })
  608.  
  609. })
  610. const observerConfig = {
  611. subtree: true,
  612. childList: true,
  613. }
  614. observer.observe(body, observerConfig)
  615. body = null
  616.  
  617. // 获取房间数据
  618. function getRoomData(rid) {
  619. return new Promise(resolve => {
  620. // rid 房间号
  621. // dt 统计周期 0(今天) 1(昨天) 7(7天内 ) 30(30天)thismonth(本月)
  622. GM_xmlhttpRequest({
  623. method: "POST",
  624. url: `https://www.doseeing.com/xeee/room/aggr`,
  625. data: `{"m":"${window.btoa(`rid=${rid}&dt=0`).split("").reverse().join("")}"}`,
  626. responseType: "json",
  627. headers: {
  628. "Content-Type": "application/json;charset=UTF-8",
  629. "Origin": "https://www.doseeing.com",
  630. "Referer": "https://www.doseeing.com/room/" + rid,
  631. 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
  632. },
  633. onload: function (res) {
  634. resolve(res.response.data);
  635. }
  636. })
  637. })
  638. }
  639. // 显示房间数据
  640. async function showRoomData() {
  641. const data = await getRoomData(rid)
  642. if (!data) return false
  643. const {
  644. // 总礼物价值
  645. "gift.all.price": giftAllPrice,
  646. // 总礼物送礼人数
  647. "gift.all.uv": giftAllUv,
  648. // 总付费礼物
  649. "gift.paid.price": giftPaidPrice,
  650. // 总付费送礼人数
  651. "gift.paid.uv": giftPaidUv,
  652. // 总弹幕数
  653. "chat.pv": chatPv,
  654. // 总发弹幕人数
  655. "chat.uv": chatUv,
  656. // 直播时间(分)
  657. "online.minutes": onlineMinutes,
  658. // 活跃人数
  659. "active.uv": activeUv,
  660. } = data
  661. const firstRow = `💬弹幕数:${formatData(chatPv)} 👨‍👩‍👧‍👦发弹幕人数:${formatData(chatUv)} ⏱️直播时间:${formatData(onlineMinutes)}分 🔥活跃人数:${formatData(activeUv)}`
  662. const secondRow = `🎁礼物价值:${(formatPrice(giftAllPrice))}元 🎅🏻礼物送礼人数:${formatData(giftAllUv)} 💸付费礼物:${formatPrice(giftPaidPrice)}元 🤴🏻付费送礼人数:${formatData(giftPaidUv)}`
  663. if (!$('.PlayerToolbar-Wealth .first').length) {
  664. $('.PlayerToolbar-Wealth').prepend('<div class="first"></div>')
  665. }
  666. $('.PlayerToolbar-Wealth .first').html(`${firstRow}
  667. ${secondRow}`)
  668.  
  669. myAlert({
  670. message: `房间数据<br/>
  671. ${firstRow}<br/>
  672. ${secondRow}<br/>
  673. `,
  674. type: 'info',
  675. dom: $('.PlayerToolbar-Wealth .first')
  676. })
  677. }
  678.  
  679. // 隐藏显示房间数据
  680. function hideRoomData() {
  681. $('.PlayerToolbar-Wealth .first').html('')
  682. }
  683. // 数据格式化
  684. function formatData(num) {
  685. return String(num).replace(/(\d)(?=(\d{3})+$)/g, '$1,')
  686. }
  687. // 金钱格式化
  688. function formatPrice(num) {
  689. const str = String(num)
  690. const integer = formatData(str / 100 | 0)
  691. const decimal = String(str % 100).padStart(2, '0')
  692. return `${integer}.${decimal}`
  693. }
  694.  
  695. // 寻找DOM
  696. function findDom(selectorStr) {
  697. return new Promise((resolve) => {
  698. setTimeout(() => {
  699. const $Dom = $(selectorStr)
  700. if ($Dom.length === 0) {
  701. resolve(false)
  702. } else {
  703. resolve($Dom)
  704. }
  705. }, 200)
  706. })
  707. }
  708.  
  709. // 轮询
  710. async function walk(callBack) {
  711. const res = await callBack()
  712. if (!res) {
  713. return await walk(callBack)
  714. } else {
  715. return res
  716. }
  717. }
  718.  
  719. GM_addStyle(`
  720. html ::-webkit-scrollbar{height:14px;width:12px;overflow:visible;position:absolute;bottom:16px}html ::-webkit-scrollbar-button{height:0;width:0}html ::-webkit-scrollbar-thumb,html ::-webkit-scrollbar-track{background-clip:padding-box;border:3px solid transparent;border-radius:100px}html ::-webkit-scrollbar-corner{background-color:transparent}html ::-webkit-scrollbar-thumb{background-color:#ccc}html ::-webkit-scrollbar-track{background-color:rgba(255,255,255,0)}html body .broadcastDiv-af5699{display:none!important;opacity:0!important;visibility:hidden!important}html body .layout-Main{transition:.5s margin-top;margin-top:0}html body #js-aside{margin-top:-68px;z-index:401}html body [class^=super-noble-icon-],html body [class^=super-tail-],html body [class^=super-user-icon]{display:none!important}html body [class^=super-text-]{background:0 0!important}html body [class^=super-text-]>img{display:none!important}html body [class^=danmuItem-]>img{display:none!important}html .Barrage{border-top:none}html .adjustClarity,html .danmuMove{display:none}html .room-Player-Box.mark [class^=danmuItem-]{cursor:default;pointer-events:none}html .danmuItem-31f924{background-color:transparent!important}html .danmuItem-31f924 .text-b132b0{font:700 24px SimHei,Microsoft JhengHei,Arial,Helvetica,sans-serif!important}html .Barrage-listItem>div:first-child{padding:0 10px!important;background-color:transparent!important;border-top:none!important;border-bottom:none!important}html .Barrage-listItem .Barrage-nickName{color:#2b94ff!important}html .Barrage-listItem .Barrage-nickName.is-self{color:#ff5d23!important}html .PlayerToolbar-Wealth .first{white-space:pre;float:left;font-size:12px;color:#888;margin-top:-10px;text-align:left}html .layout-Player-asideMainTop.hide .layout-Player-announce{display:none}html .layout-Player-asideMainTop.hide .layout-Player-barrage{top:0}html .layout-Player-asideMainTop.hide .layout-Player-rank{border:none;height:0}html .layout-Player-asideMainTop.hide .layout-Player-rank .ChatRank,html .layout-Player-asideMainTop.hide .layout-Player-rank .ChatRank-rankWraper{display:none}html .layout-Player-asideMainTop.hide .ChatRank-rankWraper{display:none}html .noble-bf13ad{background:0 0!important}html .Barrage-notice--noble{background:0 0!important;border:none!important}html.no-background .bc-wrapper{background-color:transparent!important;background-image:none!important}html.no-background .Background-holder{padding-top:10px}html.no-background #js-bottom{display:none}html.no-background body{background-image:none;background-color:#ffe}html.no-background body.go-beyound{background-image:url('https://s11.ax1x.com/2023/03/11/ppuTg81.jpg');background-color:#f6f6f6;background-position:center 68px;background-repeat:repeat-y}html.no-background body .layout-Container{background-image:none;background-color:#ffe}html.hidePk .MorePk,html.hidePk .PkView,html.hidePk .PkView-9f6a2c{display:none}html .is-fullScreenPage #wah0713{display:none}html #wah0713{position:fixed;top:50%;transform:translateY(-50%);right:-182px;border:1px solid #ccc;border-radius:6px;z-index:20;padding:10px 5px;background:#fef54e url(https://s11.ax1x.com/2023/03/11/ppuTIVe.jpg) no-repeat center/100%;width:160px;transition:all .5s ease-out}html #wah0713.hasUpdate .tip{animation:Bigger linear 2s infinite}html #wah0713.hasUpdate .gear>img{animation-play-state:running}html #wah0713.hasUpdate .gear .redDot{display:block}html #wah0713 .tip{text-align:center;margin-bottom:5px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}html #wah0713 .tip>a{color:red}html #wah0713:hover{right:0}html #wah0713:hover>button{opacity:1}html #wah0713 .gear{width:32px;padding-right:13px;position:absolute;top:50%;left:-45px;transform:translateY(-50%)}html #wah0713 .gear>img{width:100%;animation:rotating linear 30s infinite paused;border-radius:33%}html #wah0713 .gear .redDot{display:none;width:9px;height:9px;background-color:#fd4a4e;border-radius:50%;position:absolute;top:3px;right:13px}html #wah0713>button{margin:0 auto 5px;display:block;line-height:1;white-space:nowrap;cursor:pointer;background:#409eff;border:1px solid #409eff;color:#fff;-webkit-appearance:none;text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 10px;font-size:14px;border-radius:4px;opacity:.75}html #wah0713>button:last-of-type{margin-bottom:0}html #wah0713>button:hover{opacity:.8}html #wah0713>button.close{background-color:#fff;color:#409eff}html #wah0713-alert{display:none;padding:8px 16px;position:fixed;top:30%;left:50%;transform:translateX(-50%);z-index:600;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #ccc;border-radius:8px}html #wah0713-alert>i{width:14px;height:14px;display:inline-block;border-radius:50%;color:#fff;text-align:center;line-height:14px;font-family:Arial,"Microsoft YaHei","黑体","宋体",sans-serif;margin-right:8px;position:relative;top:-1px}html #wah0713-alert.warning{background-color:#fff1f0;border-color:#f5222d}html #wah0713-alert.warning>i{background-color:#f5222d}html #wah0713-alert.info{background-color:#f4f4f5;border-color:#909399}html #wah0713-alert.info>i{background-color:#909399}html #wah0713-alert>span{font-family:"Chinese Quote",-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Helvetica Neue",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px;font-variant:tabular-nums;color:rgba(0,0,0,.65)}html .top100{top:100px!important;height:100%!important}html .background-image-hide{background-image:none!important;background-color:transparent!important}html .Barrage-list.trim .Barrage-listItem>div .AnchorLevel,html .Barrage-list.trim .Barrage-listItem>div .AnchorLevel~:not(.Barrage-nickName,.Barrage-content),html .Barrage-list.trim .Barrage-listItem>div .UserLevel,html .Barrage-list.trim .Barrage-listItem>div .UserLevel~:not(.Barrage-nickName,.Barrage-content){display:none}#FansFestival2003Tips,#js-room-activity,#js-room-top-banner,#webmActKefuWeidget,.ActAutumnMilkTea2022Pop,.ActDayPay-toast,.AnchorInterToolsUser,.AnchorPocketTips,.AnchorReturnDialog,.Barrage-chat-ad,.Barrage-list .Barrage-message,.Barrage-list .Barrage-userEnter,.Barrage-topFloater,.Barrage-userEnter,.BarrageSuspendedBallAd,.Bottom-ad,.ChargeTask-closeBg,.DanmuEffectDom-container,.DiamondsFans51PromptPop,.DiamondsFansBarrage,.DiamondsFansPromptPop,.EnterEffect,.FirePower,.FirePowerIcon,.FirePowerRewardModal,.FishShopTip,.FuDaiActPanel,.FudaiGiftToolBarTips,.Header-download-wrap,.HeaderGif-left,.HeaderGif-right,.HeaderNav,.IconCardAdCard,.LotteryContainer-svgaDes,.LuckyStartEnter,.PaladinWeek-toast,.PcDiversion,.PeacehandBarrage,.PlayerToolbar-signCont,.PrivilegeGiftModalDialog,.RechargeBigRewards,.RedEnvelopAd-adBox,.RoomText-wrap,.ScreenBannerAd,.SignBaseComponent-sign-ad,.SysSign-Ad,.Title-roomOtherBottom,.WXTipsBox,.WishingForestDialog,.XinghaiAd,.activity-icon-4b45df,.activity-icon-c717fc,.ad-box-f661ba,.afterpic-8a2e13,.aside-top-uspension-box,.bc-f66a59,.closeBg-998534,.code-box-15b952,.code_box-5cdf5a,.focus_box_con-7adc83,.guessIconReminding,.headpic-dda332,.multiBitRate-da4b60,.noSubFloat-3e7a50,.noble-icon-88f562,.noble-icon-c10b6a,.normalBg-a5403d,.ordinaryBcBox-8220a7,.recommendAD-54569e,.user-icon-8af1e3,.user-icon-eeabb1,.vivo-ad-743527,.watermark-442a18,[class^=adsRoot_]{display:none!important}.layout-Player-asideMain{top:0!important}.opacity0{opacity:0}.is-hide{display:none!important}.black{filter:invert(1)}.black #wah0713,.black #wah0713-alert,.black .layout-Player-video,.black img{filter:invert(1)}@keyframes rotating{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes Bigger{0%{transform:scale(.95)}50%{transform:scale(1)}100%{transform:scale(.95)}}
  721. `)
  722. // debugJS
  723. unsafeWindow.$ = $
  724. })()