看视频

RT

  1. // ==UserScript==
  2. // @name 看视频
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.0
  5. // @description RT
  6. // @author Korvin
  7. // @match https://v.qq.com/*
  8. // @match https://www.ixigua.com/*
  9. // @match https://v.youku.com/*
  10. // @match https://www.iqiyi.com/*
  11. // @match https://www.mgtv.com/*
  12. // @grant GM_addStyle
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. 'use strict';
  17.  
  18. // 添加CSS样式
  19. GM_addStyle(`
  20. .my-button {
  21. position: fixed;
  22. left: 0;
  23. width: 40px;
  24. height: 40px;
  25. padding: 0;
  26. color: #fff;
  27. background-color: #007bff;
  28. border: none;
  29. border-radius: 50%;
  30. cursor: pointer;
  31. opacity: 0.3;
  32. font-size: 14px;
  33. line-height: 40px;
  34. text-align: center;
  35. transition: opacity 0.3s, width 0.3s, height 0.3s, line-height 0.3s;
  36. z-index: 9999;
  37. }
  38. .my-button:hover {
  39. opacity: 1;
  40. width: 50px;
  41. height: 50px;
  42. line-height: 50px;
  43. }
  44. .my-sub-button {
  45. position: fixed;
  46. left: 0;
  47. width: 40px;
  48. height: 40px;
  49. padding: 0;
  50. color: #fff;
  51. background-color: #007bff;
  52. border: none;
  53. border-radius: 50%;
  54. cursor: pointer;
  55. opacity: 0.3;
  56. font-size: 10px;
  57. line-height: 40px;
  58. text-align: center;
  59. transition: opacity 0.3s;
  60. z-index: 9999;
  61. }
  62. .my-sub-button:hover {
  63. opacity: 1;
  64. }
  65. `);
  66.  
  67. function addButton() {
  68. if (document.getElementById('mainButton')) return;
  69.  
  70. // 创建主按钮
  71. let mainButton = document.createElement('button');
  72. mainButton.id = 'mainButton';
  73. mainButton.innerHTML = '播';
  74. mainButton.className = 'my-button';
  75. mainButton.style.top = 'calc(50% - 70px)';
  76. document.body.appendChild(mainButton);
  77.  
  78. // 创建jsonplayer1按钮
  79. let jsonplayer1Button = document.createElement('button');
  80. jsonplayer1Button.id = 'jsonplayer1Button';
  81. jsonplayer1Button.innerHTML = '线路1';
  82. jsonplayer1Button.className = 'my-sub-button';
  83. jsonplayer1Button.style.top = 'calc(50% - 20px)';
  84. jsonplayer1Button.style.display = 'none';
  85. document.body.appendChild(jsonplayer1Button);
  86.  
  87. // 创建jsonplayer2按钮
  88. let jsonplayer2Button = document.createElement('button');
  89. jsonplayer2Button.id = 'jsonplayer2Button';
  90. jsonplayer2Button.innerHTML = '线路2';
  91. jsonplayer2Button.className = 'my-sub-button';
  92. jsonplayer2Button.style.top = 'calc(50% + 30px)';
  93. jsonplayer2Button.style.display = 'none';
  94. document.body.appendChild(jsonplayer2Button);
  95.  
  96. mainButton.addEventListener('mouseover', function() {
  97. // 在鼠标移动到按钮上时执行的代码
  98. if(jsonplayer1Button.style.display === 'none' && jsonplayer2Button.style.display === 'none') {
  99. jsonplayer1Button.style.display = 'block';
  100. jsonplayer2Button.style.display = 'block';
  101. } else {
  102. jsonplayer1Button.style.display = 'none';
  103. jsonplayer2Button.style.display = 'none';
  104. }
  105. });
  106.  
  107.  
  108. // jsonplayer1按钮的点击事件
  109. jsonplayer1Button.onclick = function() {
  110. window.open('https://jx.jsonplayer.com/player/?url=' + window.location.href, '_blank');
  111. }
  112.  
  113. // jsonplayer2按钮的点击事件
  114. jsonplayer2Button.onclick = function() {
  115. window.open('https://jx.777jiexi.com/player/?url=' + window.location.href, '_blank');
  116. }
  117. }
  118.  
  119. // 每隔500毫秒尝试添加按钮,直到成功
  120. let intervalId = setInterval(addButton, 500);
  121.  
  122. // 检查按钮是否已经被添加,如果已经被添加,就停止尝试
  123. function checkButtonAdded() {
  124. if (document.getElementById('mainButton')) {
  125. clearInterval(intervalId);
  126. }
  127. }
  128.  
  129. setInterval(checkButtonAdded, 500);
  130.  
  131. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址