视频网站清爽模式2

为腾讯、优酷、爱奇艺增加修改样式、视频播放便利、跳转解析网站播放视频的功能,对解析网站进行增强改造,以及避免一些不必要的误触。,识别垃圾广告常用的域名,自动退出广告页面

  1. // ==UserScript==
  2. // @name 视频网站清爽模式2
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3975
  5. // @released 2024-03-28_20:14:10_215
  6. // @description 为腾讯、优酷、爱奇艺增加修改样式、视频播放便利、跳转解析网站播放视频的功能,对解析网站进行增强改造,以及避免一些不必要的误触。,识别垃圾广告常用的域名,自动退出广告页面
  7. // @author 果心豆腐酱
  8. // @match https://v.qq.com/*
  9. // @match https://m.v.qq.com/*
  10. // @match https://youku.com/*
  11. // @match https://v.youku.com/*
  12. // @match https://www.youku.com/*
  13. // @match https://m.youku.com/*
  14. // @match https://jx.xmflv.com/*
  15. // @match https://jx.xmflv.cc/*
  16. // @match https://jx.yangtu.top/*
  17. // @match https://jx.jsonplayer.com/*
  18.  
  19. // @match *://*.iqiyi.com/*
  20. // @match *://*.youku.com/*
  21. // @match *://*v.qq.com/*
  22. // @match https://im1907.top/*
  23. // @grant GM_xmlhttpRequest
  24. // @icon https://v.qq.com/favicon.ico
  25. // @grant GM_setValue
  26. // @grant GM_getValue
  27. // @run-at document-start
  28. // ==/UserScript==
  29.  
  30.  
  31. //优质配色:#f6f6f6
  32. let 域名 = location.hostname
  33. if (域名.includes('.info') || 域名.includes('dwja50.xyz') || 域名.includes('ld48dsn.xyz') || 域名.includes('kl38.cc') || 域名.includes('jas040ki.xyz')) {
  34. location.href = GM_getValue("上次视频")
  35.  
  36. }
  37. console.log('页面加载完成');
  38. var 解析字体颜色 = 'green';
  39.  
  40. if (!location.href.includes('.xmflv.')) {
  41. var 主题色;
  42. var 深主题色;
  43. var 浅主题色;
  44. var VIP主题色;
  45. var 备案字体颜色;
  46. var 主评论色;
  47. var 评论色;
  48. var 浅灰字体色;
  49. var 浅色字体;
  50. var 亮色字体;
  51. var 深色字体;
  52. var 评论线条;
  53. var 音量;
  54. var 解析站点URL;
  55. //var 主题 = "青色"
  56. //初始化组件
  57.  
  58. if(document.querySelector('[class="report-area none"]'))return;
  59. 修改样式();
  60. function 修改样式() {
  61. const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  62. if (isMobile) {
  63. // 是手机设备
  64. 函数存放("窄版页面样式修改");
  65. } else {
  66. // 不是手机设备
  67. 函数存放("页面样式修改");
  68. }
  69. }
  70. //侧边栏按钮创建();
  71. 监测页面元素();
  72. document.addEventListener('DOMContentLoaded', function () {
  73.  
  74. 创建主设置组件();
  75. 判断视频网站视频组件加载();
  76. 监测全屏状态();
  77.  
  78. 去广告判断();
  79. // 页面加载完成后执行的操作
  80. console.log('页面加载完成2');
  81.  
  82.  
  83. // 定时检测视频进度并执行操作
  84. if (localStorage.getItem('advertisement') === "true") {
  85. 函数存放("去除游戏栏目");
  86. 函数存放("轮播栏广告播放");
  87. }
  88. 函数存放("去除游戏栏目");
  89. 函数存放("加载时可删除广告");
  90.  
  91. 函数存放("去除app提示");
  92. 函数存放("去除视频水印");
  93. 元素样式创建();
  94.  
  95. 监测激活状态();
  96. 监测去除腾讯广告()
  97. 函数存放("轮播栏广告小图");
  98. 腾讯视频会员到期提示();
  99. });
  100. window.addEventListener('load', function () {
  101.  
  102. });
  103.  
  104. function 腾讯视频会员到期提示() {
  105. var viptime = document.querySelector('.vip_now.__tips')?.textContent?.match(/\d{4}-\d{2}-\d{2}/);
  106. if (viptime) {
  107. const currentDate = new Date();
  108. // 获取VIP到期日期
  109. const vipExpireDate = new Date(viptime);
  110. // 计算距离到期日的天数
  111. const daysUntilExpire = Math.ceil((vipExpireDate - currentDate) / (1000 * 60 * 60 * 24));
  112.  
  113. if (daysUntilExpire <= 90 && daysUntilExpire > 30) {
  114. remindOncePerPeriod('1_month');
  115. } else if (daysUntilExpire <= 7 && daysUntilExpire > 3) {
  116. remindOncePerPeriod('1_week');
  117. } else if (daysUntilExpire <= 3) {
  118. remindOncePerDay();
  119. }
  120. }
  121.  
  122. function remindOncePerPeriod(period) {
  123. const lastReminderDate = localStorage.getItem(`lastReminderDate_${period}`);
  124. const today = (new Date()).toDateString();
  125.  
  126. if (lastReminderDate !== today) {
  127. alert(`您的VIP会员将于${expireDate}到期,请及时续费!`);
  128. localStorage.setItem(`lastReminderDate_${period}`, today);
  129. }
  130. }
  131. function remindOncePerDay() {
  132. const today = (new Date()).toDateString();
  133. let reminderCount = localStorage.getItem('reminderCount') || 0;
  134.  
  135. if (reminderCount < 1) {
  136. alert(`您的VIP会员将于${expireDate}到期,请及时续费!`);
  137. reminderCount++;
  138. localStorage.setItem('reminderCount', reminderCount);
  139. localStorage.setItem('lastReminderDate', today);
  140. }
  141. }
  142. }
  143. function 创建解析按钮() {
  144. if (!document.querySelector('.解析站点').checked) {
  145. return;
  146. }
  147. document.querySelector('.解析视频')?.remove()
  148. let 图标 = 'https://community.image.video.qpic.cn/v_station_video_web_comment_fbd86c-1_1647929910_1703449373405659?imageView2/2/w/2000';
  149. //手机浏览器下载按钮旁
  150. let 优酷剧集按钮 = document.querySelector('[class="brief-btm"]')
  151. if (优酷剧集按钮) {
  152. let html = `
  153. <div class="解析视频" >
  154. <img src="${图标}" style="left: 0px;width: 37px;height: 40px;margin: 0px 15px;position: relative;top: -2px;align-content: space-around;">
  155. <span class="解析span" style="left: 22px;top: -5px;position: relative;font-size: 5px;font-weight: 600;">解析</span>
  156. </div>
  157. `;
  158. 解析字体颜色 = '#999999';
  159. 优酷剧集按钮.innerHTML += html
  160. }
  161. //PC版弹幕栏
  162. 优酷剧集按钮 = document.querySelector('[class="switch-img_12hDa setconfig_Ojkob"]');
  163. if (优酷剧集按钮) {
  164. let html = `<div class="解析视频" style="display: inline-block;left: -5px;margin: 0px 15px; position: relative;top: 2px;align-content: space-around;">
  165. <img src="${图标}" style="width: 28px;height: 31px;">
  166. <span class="解析span" style="/* font-size: 10px; */left: 2px;top: 23px;position: absolute;font-size: 12px;font-weight: 600;height:20px;line-height: 20px;">解析</span>
  167. </div>`;
  168. if (优酷剧集按钮) {
  169. 优酷剧集按钮.insertAdjacentHTML("afterend", html);
  170. } else {
  171. 优酷剧集按钮.insertAdjacentHTML("afterend", html);
  172. }
  173. }
  174.  
  175. //全部 按钮
  176. let 腾讯顶栏上的按钮 = document.querySelector('[id="nav-all"]');
  177. if (腾讯顶栏上的按钮) {
  178. let html = `
  179. <div class="解析视频" >
  180. <img src="${图标}" class="解析视频 解析图片" style="; width: 30px; margin: 0px 15px; height: 30px;">
  181. </div>
  182. `;
  183. 腾讯顶栏上的按钮.insertAdjacentHTML("afterend", html);
  184.  
  185. }
  186. //追剧 按钮旁边,手机浏览器
  187. let 腾讯追剧边按钮 = document.querySelector('[class="open-app video-desc__chase"]');
  188. if (腾讯追剧边按钮) {
  189.  
  190. let html = `
  191. <div class="解析视频" style="background: white;border-radius: 20px;padding: 0px 10px 0px 10px;margin: 0px 10px 0px 10px;">
  192. <img src="${图标}" style="height: 32px;width: 40px;border-radius: 20px;">
  193. <span style="top: 2px;position: relative;font-size: 15px;font-weight: 600;width: 30px;margin: 0px 5px 0px 10px;height: 30px;">解析</span>
  194. </div>`;
  195. 腾讯追剧边按钮.insertAdjacentHTML("afterend", html);
  196. }
  197. let 爱奇艺追剧边按钮 = document.querySelector('[class="fun"]');
  198. if (爱奇艺追剧边按钮) {
  199. let html = `
  200. <div class="解析视频" style="position: relative;">
  201. <img src="${图标}" style="width: 28px;margin: 0px 15px 0px 10px;height: 37px;top: -2px;position: relative;">
  202. <span class="解析span" style="height: 20px;;left: -14px;top: 9px;position: relative;font-size: 12px;font-weight: 600;">解析</span>
  203. </div>
  204. <div class="border"></div>
  205. `;
  206. 解析字体颜色 = '#8ba9c1';
  207. 爱奇艺追剧边按钮.insertAdjacentHTML("beforeend", html);
  208. }
  209. let 爱奇艺追剧边按钮手机浏览器 = document.querySelector('[class="m-videoPlay-toolBar"]');
  210. if (爱奇艺追剧边按钮手机浏览器) {
  211. let html = `
  212. <div class="解析视频">
  213. <img src="${图标}" style="width: 28px;margin: 0px 20px 0px 20px;height: 30px;top: -2px;position: relative;">
  214. <span style="left: -49px;top: 24px;position: relative;font-size: 5px;font-weight: 600;">解析</span>
  215. </div>
  216. `;
  217. 爱奇艺追剧边按钮手机浏览器.insertAdjacentHTML("beforeend", html);
  218. }
  219. let 爱奇艺收藏 = document.querySelector('[class="interactiveBlock_interactive__TmxDm"]');
  220. if (爱奇艺收藏) {
  221. let html = `
  222. <div class="interactiveBlock_line__KFfHM"></div>
  223. <div class="解析视频">
  224. <img src="${图标}" style="width: 28px;margin: 0px 20px 0px 20px;height: 30px;top: -2px;position: relative;left: -13px;">
  225. <span style="left: -34px;top: 4px;position: relative;font-size: 12px;font-weight: 600;">解析</span>
  226. </div>
  227. `;
  228. 爱奇艺收藏.insertAdjacentHTML("beforeend", html);
  229. document.querySelector('[id="qyBarrageVue"]')?.insertAdjacentHTML("beforeend", html);
  230. }
  231. let 解析按钮 = document.querySelector('.解析视频');
  232. if (解析按钮) {
  233. 解析按钮.addEventListener('click', function (event) {
  234. 新窗口();
  235. })
  236. }
  237.  
  238. }
  239.  
  240. function 元素样式创建() {
  241. let css = `
  242. .解析视频{
  243. user-select: none;
  244. cursor: pointer;
  245. color: ${解析字体颜色};
  246. transition: transform 0.3s ease;
  247. transition: transform .3s ease;
  248. }
  249. .解析视频:hover {
  250. color: #f5c000 !important;
  251. transform: scale(1.2);
  252. }
  253. #saveButton{
  254. color: #333333 ;
  255. width: 40px;
  256. height: 20px;
  257. border-radius: 10px;
  258. background: white;
  259. }
  260. #saveButton:hover{
  261. color: green ;
  262. }
  263. #saveButton:active{
  264. color: #610110 ;
  265. }
  266. .main_button:hover {
  267. color: green ;
  268. }
  269. `
  270. if (document.querySelector('.解析样式')) {
  271. document.querySelector('.解析样式').remove()
  272. }
  273. var style = document.createElement('style');
  274. style.type = 'text/css';
  275. style.textContent = css;
  276. style.className = "解析样式";
  277. document.head.appendChild(style);
  278. }
  279. function 创建主设置组件() {
  280. 'use strict';
  281. // 创建设置按钮
  282. document.querySelector('.main_button')?.remove()
  283. var settingButton = document.createElement('div');
  284. settingButton.className = 'main_button';
  285. settingButton.style.top = '50%';
  286. settingButton.innerHTML = '设置';
  287. settingButton.style.color = '#376339';
  288. settingButton.style.borderRadius = '2px';
  289. settingButton.style.background = "linear-gradient(to right, #DCF0B0, rgba(252, 247, 224, 0.5))";
  290. settingButton.style.cursor = 'pointer';
  291. settingButton.style.zIndex = '9999';
  292. settingButton.addEventListener('mousedown', function (e) {
  293. dragMenu(settingButton, e);
  294. });
  295. settingButton.style.position = 'fixed';
  296. settingButton.style.width = '15px';
  297. settingButton.style.height = '50px';
  298. settingButton.style.lineHeight = '25px';
  299. settingButton.style.display = 'flex';
  300. settingButton.style.justifyContent = 'center';
  301. // 将按钮添加到页面的 body 元素中
  302. document.body.appendChild(settingButton);
  303. // setTimeout(function () {
  304. // // 获取按钮元素透明
  305. // selectButton.style.opacity = "0.1";
  306. // settingButton.style.opacity = "0.1";
  307. // }, 10000); // 10秒后执行
  308. // 创建设置界面
  309. var settingPanel = document.createElement('div');
  310. settingPanel.style.position = 'fixed';
  311. settingPanel.style.top = '47%';
  312. settingPanel.style.left = '20px';
  313. settingPanel.style.padding = '10px';
  314. settingPanel.style.color = '#376339';
  315. settingPanel.style.background = "linear-gradient(to right, #DCF0B0, #FCF7E0)";
  316. settingPanel.style.border = '1px solid #000';
  317. settingPanel.style.zIndex = '9999';
  318. settingPanel.style.display = 'none';
  319. // <input type="checkbox" class="closesidebar" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  320. // <label for="percentage">首次关闭侧边栏</label>
  321. // <br>
  322. settingPanel.innerHTML = `
  323. <input type="checkbox" class="percentage 选择 a" name="progressType" value="percentage" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  324. <label for="percentage">使用百分比</label>
  325. <input type="number" id="percentageThreshold" value="85" style="width: 50px;border:0px">
  326. <br>
  327. <input type="checkbox" class="percentage 选择 b" name="progressType" value="time" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  328. <label for="time">使用分秒时间</label>
  329. <input type="text" id="timeThreshold" placeholder="12:20" style="width: 50px;border:0px">
  330. <br>
  331. <input type="checkbox" id="removewatermark" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  332. <label for="percentage">去除视频水印</label>
  333. <br>
  334. <input type="checkbox" class="advertisement" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  335. <label for="percentage">屏蔽广告</label>
  336. <br>
  337. <input type="checkbox" class="解析站点" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  338. <label for="options">解析站点:</label>
  339. <select id="options">
  340. <option value="虾米" url="https://jx.xmflv.com/?url=">虾米</option>
  341. <option value="M1907" url="https://im1907.top/?jx=">M1907</option>
  342. <option value="虾米2" url="https://jx.xmflv.cc/?url=">虾米2</option>
  343. <option value="虾米2" url="https://jx.yangtu.top/?url=">虾米2</option>
  344. </select>
  345. <br>
  346. <input type="checkbox" id="htmlbackground" style=" -webkit-appearance: button;cursor:pointer;border:0px">
  347. <label for="percentage">替换背景</label>
  348. <form action="/submit-form" method="post">
  349. <select id="cars" name="cars">
  350. <option value="月光色">月光色</option>
  351. <option value="青色">青色</option>
  352. <option value="神秘森林">神秘森林</option>
  353. <option value="辣红色">辣红色</option>
  354. <option value="芒果色">芒果色</option>
  355. <option value="金黄色">金黄色</option>
  356. <option value="朱金">朱金</option>
  357. <option value="春节红">春节红</option>
  358. <option value="炎红">炎红</option>
  359. </select>
  360. </form>
  361. <br>
  362. <div style="width: 100%; height: 1px;background-color: #5c6e32; margin-bottom: 2px;"></div>
  363. <label for="percentage" style=" position: relative;top: 10px;">cookie:</label>
  364. <textarea class="cookie_textrea" placeholder="填写你需要加载到浏览器的cookie。" style="width: 110px;resize: none; height: 60px;"></textarea>
  365. <br>
  366. <button id="tiquButton" class="button" style="font-weight: bold; color: #333333;cursor:pointer;position: relative;left: 95px;">提取</button>
  367. <button id="jiazaiButton" class="button" style="font-weight: bold; color: #333333;cursor:pointer;position: relative;left: 100px;">加载</button>
  368. <br>
  369. <br>
  370. <br>
  371. <button id="saveButton" class="button" style="font-weight: bold;cursor:pointer;position: absolute;right: 10px;bottom: 10px;border:0px">保存</button>
  372. `;
  373.  
  374.  
  375. document.body.appendChild(settingPanel);
  376. document.querySelector('.选择.a').addEventListener('click', function (event) {
  377. if (document.querySelector('.选择.a').checked === true) {
  378. document.querySelector('.选择.b').checked = false;
  379. }
  380.  
  381. })
  382. document.querySelector('.选择.b').addEventListener('click', function (event) {
  383. if (document.querySelector('.选择.b').checked === true) {
  384. document.querySelector('.选择.a').checked = false;
  385. }
  386. })
  387. var selectBox = document.getElementById('options');
  388. // 添加事件监听器,在选项发生变化时执行相应的操作
  389. selectBox.addEventListener('change', function () {
  390. let selectedOption = selectBox.selectedOptions[0];
  391. let url = selectedOption.getAttribute('url');
  392. 解析站点URL = url;
  393. localStorage.setItem('解析站点URL', 解析站点URL)
  394. localStorage.setItem('选择站点', selectBox.selectedIndex)
  395. });
  396. // 获取要选择的选项的索引
  397. var targetIndex = Number(localStorage.getItem('选择站点'))
  398. if (targetIndex > 0) {
  399. // 选择选项
  400. selectBox.selectedIndex = targetIndex;
  401. }
  402. // 创建选择事件
  403. var event = new Event('change');
  404. // 触发选择事件
  405. selectBox.dispatchEvent(event);
  406.  
  407. // 获取选项编辑框的引用
  408. // settingPanel.addEventListener('mousedown', function (e) {
  409. // dragMenu(settingPanel, e);
  410. // });
  411. // 定义一个变量用于保存计时器的 ID
  412. var timerId;
  413. // 给设置按钮绑定鼠标移入事件
  414. settingButton.addEventListener('mouseenter', function () {
  415. // 显示设置面板
  416. settingPanel.style.display = 'block';
  417. // 清除计时器
  418. clearTimeout(timerId);
  419. });
  420. // 给设置面板绑定鼠标移入事件,避免鼠标移出设置按钮后立即隐藏设置面板
  421. settingPanel.addEventListener('mouseenter', function () {
  422. // 清除计时器
  423. clearTimeout(timerId);
  424. });
  425. // 给设置按钮绑定鼠标移出事件
  426. settingButton.addEventListener('mouseleave', function () {
  427. // 开始计时,500 毫秒后隐藏设置面板
  428. timerId = setTimeout(function () {
  429. settingPanel.style.display = 'none';
  430. }, 500);
  431. });
  432. // 给设置面板绑定鼠标移出事件,避免鼠标移入设置面板后立即隐藏设置面板
  433. settingPanel.addEventListener('mouseleave', function () {
  434. // 开始计时,500 毫秒后隐藏设置面板
  435. timerId = setTimeout(function () {
  436. settingPanel.style.display = 'none';
  437. }, 500);
  438. });
  439. // 显示/隐藏设置界面
  440. settingButton.addEventListener('click', function (event) {
  441. event.stopPropagation(); // 阻止事件冒泡
  442. event.preventDefault(); // 阻止默认行为
  443. if (settingPanel.style.display === 'none') {
  444. settingPanel.style.display = 'block';
  445. console.log('开始设置');
  446. const 进度选择Input = document.querySelectorAll('.选择');
  447. if (进度选择Input.length === 2) {
  448. for (let index = 0; index < 进度选择Input.length; index++) {
  449. 进度选择Input[index].style.cssText = 'width: 20px !important; cursor: pointer;';
  450. }
  451. }
  452. } else {
  453. settingPanel.style.display = 'none';
  454. }
  455. });
  456. var tiquButton = document.querySelector('#tiquButton');
  457. if (tiquButton) {
  458. tiquButton.addEventListener("click", function () {
  459. var cookieStr = document.querySelector('.cookie_textrea')
  460. if (cookieStr) {
  461. cookieStr.value = document.cookie
  462. }
  463. })
  464. }
  465. var jiazaiButton = document.querySelector('#jiazaiButton');
  466. if (jiazaiButton) {
  467. jiazaiButton.addEventListener("click", function () {
  468. 加载cookie();
  469. })
  470. }
  471. var cookieDomain = ".qq.com";
  472. function 加载cookie(cookieStr, cookieDomain, daysToExpire) {
  473. if (cookieStr) {
  474. if (cookieStr !== "") {
  475. var cookies = cookieStr.split(";");
  476. if (cookies.length !== 0) {
  477. cookies.forEach(function (cookie) {
  478. var keyValue = cookie.trim().split("=");
  479. var key = keyValue[0];
  480. var value = keyValue[1];
  481. // 设置过期时间为指定天数后
  482. var expires = new Date();
  483. expires.setTime(expires.getTime() + (daysToExpire * 24 * 60 * 60 * 1000));
  484. // 设置cookie,包括过期时间
  485. document.cookie = key + "=" + encodeURIComponent(value) + "; domain=" + cookieDomain + "; path=/; expires=" + expires.toUTCString();
  486. });
  487. } else {
  488. showToast("请不包含有cookie信息。");
  489. }
  490. } else {
  491. showToast("请填写cookie信息。");
  492. }
  493. } else {
  494. showToast("编辑框元素丢失了。");
  495. }
  496. }
  497. //取进度百分比的编辑框元素
  498. var percentageThresholdInput = document.getElementById('percentageThreshold');
  499. // 读取缓存percentageThreshold的值
  500. var savedPercentageThreshold = localStorage.getItem('percentageThreshold');
  501. //如果缓存没有内容就使用默认的数值
  502. if (savedPercentageThreshold) {
  503. percentageThresholdInput.value = savedPercentageThreshold;
  504. } else {
  505. percentageThresholdInput.value = '85'; // 默认值
  506. }
  507. // 读取缓存的timeThreshold的值
  508. var timeThresholdInput = document.getElementById('timeThreshold');
  509. var savedTimeThreshold = localStorage.getItem('timeThreshold');
  510. if (savedTimeThreshold) {
  511. timeThresholdInput.value = savedTimeThreshold;
  512. } else {
  513. timeThresholdInput.placeholder = '12:20'; // 默认值
  514. }
  515. var percentageValue = parseInt(localStorage.getItem('percentage'));
  516. if (isNaN(percentageValue) || percentageValue < 0) {
  517. document.querySelectorAll(".percentage")[0].checked = true
  518. } else {
  519. document.querySelectorAll(".percentage")[percentageValue].checked = true
  520. }
  521. var removewatermarkchecked = localStorage.getItem('removewatermark');
  522. if (removewatermarkchecked === "false") {
  523. document.querySelector("#removewatermark").checked = false;
  524. } else {
  525. document.querySelector("#removewatermark").checked = true;
  526. localStorage.setItem('removewatermark', true);
  527. }
  528. // var closesidebarchecked = localStorage.getItem('closesidebar');
  529. // if (closesidebarchecked === "false") {
  530. // document.querySelector(".closesidebar").checked = false
  531. // } else {
  532. // document.querySelector(".closesidebar").checked = true
  533. // localStorage.setItem('closesidebar', true);
  534. // }
  535. var advertisement = localStorage.getItem('advertisement');
  536. if (advertisement === "false") {
  537. document.querySelector(".advertisement").checked = false
  538. } else {
  539. document.querySelector(".advertisement").checked = true
  540. localStorage.setItem('advertisement', true);
  541. }
  542. var htmlbackground = localStorage.getItem('htmlbackground');
  543. if (htmlbackground === "true") {
  544. document.querySelector("#htmlbackground").checked = true;
  545. var cars = localStorage.getItem('cars');
  546. document.querySelector("#cars").selectedIndex = cars;
  547. } else {
  548. document.querySelector("#htmlbackground").checked = false;
  549. localStorage.setItem('htmlbackground', false);
  550. }
  551.  
  552. document.querySelector('.解析站点').checked = eval(localStorage.getItem('解析站点'))
  553.  
  554. // 监听保存按钮的点击事件
  555. var saveButton = document.getElementById('saveButton');
  556. saveButton.addEventListener('click', function () {
  557. // 保存percentageThreshold的值到localStorage
  558. var percentageThresholdValue = percentageThresholdInput.value;
  559. localStorage.setItem('percentageThreshold', percentageThresholdValue);
  560. // 保存timeThreshold的值到localStorage
  561. var timeThresholdValue = timeThresholdInput.value;
  562. localStorage.setItem('timeThreshold', timeThresholdValue);
  563. //保存去水印设置
  564. localStorage.setItem('removewatermark', document.querySelector("#removewatermark")?.checked);
  565. //保存屏蔽广告设置
  566. localStorage.setItem('advertisement', document.querySelector(".advertisement")?.checked);
  567. //保存侧边栏设置
  568. localStorage.setItem('closesidebar', document.querySelector(".closesidebar")?.checked);
  569. //主题替换功能
  570. var 主题替换 = document.querySelector("#htmlbackground")?.checked;
  571. localStorage.setItem('htmlbackground', 主题替换);
  572. if (主题替换) {
  573. localStorage.setItem('主题选择', document.querySelector('#cars').value);
  574. 修改样式();
  575. //保存侧边栏设置
  576.  
  577. }
  578.  
  579.  
  580.  
  581. //主题配色选择
  582. localStorage.setItem('cars', document.querySelector("#cars")?.selectedIndex);
  583. // // 判断是否所有的percentage都被选中
  584. var percentageInputs = document.querySelectorAll(".percentage");
  585. for (var i = 0; i < percentageInputs.length; i++) {
  586. if (percentageInputs[i].checked) {
  587. localStorage.setItem('percentage', i);
  588. }
  589. }
  590. //保存解析站带你设置
  591. localStorage.setItem('解析站点', document.querySelector(".解析站点")?.checked);
  592. if (document.querySelector('.解析站点').checked) {
  593. 创建解析按钮();
  594. }
  595. });
  596. //需要直接执行的代码
  597. // 使用正则表达式检测 userAgent
  598.  
  599. }
  600.  
  601. // 检测视频进度达到阈值时执行点击下一个视频
  602. function checkAndClickNext() {
  603. var jindu = document.querySelector(".txp_time_current");
  604. var changdu = document.querySelector(".txp_time_duration");
  605. // 解析进度和长度的分钟和秒钟
  606. if (jindu && changdu) {
  607. var progressParts = jindu.textContent.split(":");
  608. var durationParts = changdu.textContent.split(":");
  609. var progressMinutes = parseInt(progressParts[0]);
  610. var progressSeconds = parseInt(progressParts[1]);
  611. var durationMinutes = parseInt(durationParts[0]);
  612. var durationSeconds = parseInt(durationParts[1]);
  613. // 将分钟和秒钟转换为总秒数
  614. var progressTotalSeconds = progressMinutes * 60 + progressSeconds;
  615. var durationTotalSeconds = durationMinutes * 60 + durationSeconds;
  616. // 获取进度类型选择
  617. var progressType = parseInt(localStorage.getItem('percentage'));
  618. var nextButton = document.querySelector('.txp_btn.txp_btn_next_u');
  619. // 根据进度类型执行相应的进度判断
  620. if (progressType === 0) {
  621. // 获取百分比阈值
  622. var percentageThreshold = localStorage.getItem('percentageThreshold');
  623. // 计算百分比
  624. var percent = (progressTotalSeconds / durationTotalSeconds) * 100;
  625. //txp_tooltip txp_none
  626. // 如果进度达到阈值,则执行点击下一个视频的操作
  627. if (percent >= percentageThreshold) {
  628. if (nextButton) {
  629. nextButton.click();
  630. }
  631. }
  632. } else if (progressType === 1) {
  633. // 获取分秒时间阈值
  634. var timeThresholdParts = localStorage.getItem('timeThreshold');
  635. var timeParts = timeThresholdParts.split(":");
  636. var timeThresholdSeconds = parseInt(timeParts[0]) * 60 + parseInt(timeParts[1]);
  637. // 如果进度达到阈值时间,则执行点击下一个视频的操作
  638. if (progressTotalSeconds >= timeThresholdSeconds) {
  639. if (nextButton) {
  640. nextButton.click();
  641. }
  642. }
  643. }
  644. }
  645. //clearInterval(intervalId);
  646. }
  647. function 判断视频网站视频组件加载() {
  648. var intervalId = setInterval(function () {
  649.  
  650. let video = document.querySelectorAll('video')
  651. console.dir(video)
  652. if (video) {
  653. clearInterval(intervalId);
  654.  
  655. 音量 = video.volume
  656. 创建解析按钮();
  657. //监测播放状态();
  658. 去广告判断();
  659. 监测视频暂停状态()
  660. function 监测视频暂停状态() {
  661. let video = document.querySelector('video')
  662. if (video) {
  663. video.addEventListener("pause", function () {
  664. 去广告判断();
  665. })
  666. }
  667. }
  668. // // 监听playing事件,视频播放开始时触发
  669. // video.addEventListener('playing', function () {
  670. // console.log('视频开始播放');
  671. // // 监测视频源变化
  672. // const observer = new MutationObserver(function (mutations) {
  673. // mutations.forEach(function (mutation) {
  674. // if (mutation.attributeName === 'src') {
  675. // console.log('视频源已更改');
  676. // // 在此处执行视频更改后的操作
  677. // 监测播放状态();
  678. // }
  679. // });
  680. // });
  681. // // 监测video元素属性变化
  682. // observer.observe(video { attributes: true });
  683. // });
  684. }
  685. for (let index = 0; index < video.length; index++) {
  686. if (video[index].src != '') {
  687.  
  688. 设置辅助功能(video[index]);
  689. }
  690. }
  691. }, 1000);
  692. }
  693. function 判断爱奇艺选集按钮() {
  694. var intervalId = setInterval(function () {
  695.  
  696. let 选集 = document.querySelector('[class="iqp-btn iqp-btn-episode"]');
  697. if (选集) {
  698. clearInterval(intervalId);
  699. }
  700. }, 1000);
  701. }
  702. function 设置辅助功能(video) {
  703. let i = 1;
  704. let intervalId = setInterval(() => {
  705. let 腾讯PC = document.querySelector('.plugin_ctrl_txp_bottom');
  706. if (腾讯PC) {
  707. 腾讯PC.appendChild(添加辅助功能());
  708. 绑定热键();
  709. clearInterval(intervalId);
  710. } else {
  711. let 爱奇艺PC = document.querySelectorAll('[class="iqp-contrl"]');
  712. if (爱奇艺PC.length === 2) {
  713. 爱奇艺PC[0].parentElement?.querySelector('[data-player-hook="plgcontainer"]')?.remove()
  714. 爱奇艺PC[1].appendChild(添加辅助功能());
  715. 绑定热键();
  716. clearInterval(intervalId);
  717. } else {
  718. if (爱奇艺PC === 1) {
  719. 爱奇艺PC.appendChild(添加辅助功能());
  720. 绑定热键();
  721. clearInterval(intervalId);
  722. } else {
  723. let 优酷PC = document.querySelector('[class="kui-dashboard-rear-ctn"]');
  724. if (优酷PC) {
  725. 优酷PC.appendChild(添加辅助功能());
  726. 绑定热键();
  727. clearInterval(intervalId);
  728. }
  729. }
  730. }
  731. }
  732. i++;
  733. if (i === 10) {
  734. clearInterval(intervalId);
  735. }
  736. }, 1000);
  737. }
  738. //视频网站的
  739. function 监测播放状态() {
  740. let video = document.querySelector('video')
  741. if (video) {
  742. video.addEventListener("timeupdate", function () {
  743. var currentTime = Math.floor(video.currentTime); // 获取当前播放时间(秒)
  744. var duration = Math.floor(video.duration); // 获取视频总长度(秒)
  745. var progressType = parseInt(localStorage.getItem('percentage'));
  746. if (progressType === 0) {
  747. var percentageThreshold = localStorage.getItem('percentageThreshold');
  748. var percent = (currentTime / duration) * 100;
  749. if (percent >= percentageThreshold) {
  750. 点击下一集(video);
  751. }
  752. } else if (progressType === 1) {
  753. var timeThresholdParts = localStorage.getItem('timeThreshold');
  754. var timeParts = timeThresholdParts.split(":");
  755. var timeThresholdSeconds = parseInt(timeParts[0]) * 60 + parseInt(timeParts[1]);
  756. if (currentTime >= timeThresholdSeconds) {
  757. 点击下一集(video);
  758. }
  759. }
  760. });
  761. }
  762. }
  763. function 点击上一集() {
  764. window.history.back();
  765. }
  766. function 点击下一集() {
  767. if (location.hostname.includes('v.qq.')) {
  768. document.querySelector('.txp_btn.txp_btn_next_u')?.click();
  769. } else {
  770. if (location.hostname.includes('youku.')) {
  771. document.querySelector('[class=" kui-next-icon-0"]')?.click();
  772. } else {
  773. if (location.hostname.includes('.iqiyi.')) {
  774. document.querySelector('[class="iqp-btn iqp-btn-next"]').click();
  775. }
  776. }
  777. }
  778. }
  779.  
  780. //监测页面元素
  781. function 监测页面元素() {
  782. var oldURL = document.URL;
  783. // 创建 Mutation Observer 实例
  784. var observer = new MutationObserver(function (mutationsList) {
  785. // console.log("蜀黍");
  786. for (var mutation of mutationsList) {
  787. // 遍历每个被添加的节点
  788. for (var addedNode of mutation.addedNodes) {
  789. // 判断是否为元素节点
  790. if (addedNode.nodeType === Node.ELEMENT_NODE) {
  791. 去广告判断()
  792.  
  793. let videoyuansu = addedNode.querySelector('video')
  794. if (videoyuansu) {
  795. console.log('videoyuansu', videoyuansu)
  796. }
  797. let 当前剧集按钮 = document.querySelector('[class="c-album-item selected"]');
  798. if (当前剧集按钮) {
  799. if (!当前剧集按钮.querySelector('.覆盖按钮')) {
  800. 覆盖按钮(当前剧集按钮)
  801. }
  802. }
  803. var 协议 = addedNode.querySelector('[class="selected-wrap"]');
  804. if (协议) {
  805. 协议.click();
  806. }
  807. }
  808. }
  809. }
  810. });
  811. // 监测整个文档树的变动
  812. observer.observe(document, { childList: true, subtree: true });
  813. }
  814. // if (addedNode) {
  815. // let 播放页面广告 = addedNode.querySelector('video[preload="auto"]')
  816. // if (播放页面广告.parentElement?.parentElement ){
  817. // 播放页面广告.parentElement?.parentElement?.remove()
  818. // //会员原播放界面
  819. // let 缩小视频 = document.querySelector('[class="iqp-player-videolayer"]')
  820. // 缩小视频.style.height = '100%';
  821. // 缩小视频.style.width = '100%';
  822. // 缩小视频.style.top = '0';
  823. // 缩小视频.style.left = '0';
  824.  
  825. // html=`<div class="cupid-pause-max-play-btn" ><span class="play-btn"></span>继续播放</div>`
  826. // 缩小视频.querySelector('[data-cupid="container"]')?.insertAdjacentHTML("afterend", html);
  827.  
  828. // css=`.cupid-pause-max-play-btn {
  829. // left: calc(50% - 128px);
  830. // top: calc(50% - 44px);
  831. // position: absolute;
  832. // width: 128px;
  833. // height: 44px;
  834. // font-size: 16px;
  835. // border-radius: 22.41px;
  836. // }`
  837. // if (document.querySelector('.继续播放')) {
  838. // document.querySelector('.继续播放').remove()
  839. // }
  840. // var style = document.createElement('style');
  841. // style.type = 'text/css';
  842. // style.textContent = css;
  843. // style.className = "继续播放";
  844. // document.head.appendChild(style);
  845. // }
  846.  
  847.  
  848. // }
  849. function 去广告判断() {
  850. if (localStorage.getItem('advertisement') === "true") {
  851. if (document.location.hostname.includes('v.qq.com')) {
  852. 监测去除腾讯广告();
  853. } else {
  854. if (document.location.hostname.includes('.iqiyi')) {
  855. //console.log('警察蜀黍',addedNode)
  856. 爱奇艺去广告()
  857. } else {
  858. if (document.location.hostname.includes('youku.')) {
  859. 优酷去广告()
  860. }
  861. }
  862. }
  863. }
  864. }
  865.  
  866. var cartoonlistload;
  867. // 调用函数并打印
  868.  
  869. function 监测去除腾讯广告() {
  870. if (localStorage.getItem('advertisement') === "true") {
  871. //暂停视频的弹窗广告
  872. var video_material = document.querySelector('.txp_zt_video_material');
  873. if (video_material) {
  874. video_material.parentNode.removeChild(video_material);
  875. console.log("删除暂停视频的弹窗广告");
  876. } else {
  877. // 暂停视频的弹窗广告
  878. var pauseBanner = document.querySelector('.txp_zt_content.txp_ad_active_normal');
  879. if (pauseBanner) {
  880. pauseBanner.remove();
  881. console.log("删除暂停视频的弹窗广告");
  882. } else {
  883. // 推荐视频里的广告
  884. var pauseVideos = document.querySelectorAll(".video-card-module > div.card-wrap");
  885. if (pauseVideos.length > 0) {
  886. pauseVideos.forEach(function (video) {
  887. video.remove();
  888. });
  889. console.log("删除推荐视频里的广告");
  890. } else {
  891. // 推荐视频里的广告关闭按钮
  892. var close_btn = document.querySelectorAll(".close-btn SPAN");
  893. if (close_btn.length > 0) {
  894. close_btn.forEach(function (button) {
  895. if (button.textContent === "广告") {
  896. button.parentNode.parentNode.remove();
  897. }
  898. });
  899. console.log("删除推荐视频里的广告");
  900. } else {
  901. // 暂停视频的弹窗广告
  902. var pauselayer = document.querySelector('.creative-player-pause-layer');
  903. if (pauselayer) {
  904. pauselayer.remove();
  905. console.log("删除暂停视频的弹窗广告");
  906. } else {
  907. var 侧边栏广告 = document.querySelector(".game_switch_page_next_wrapper.game-switch-ad")
  908. if (侧边栏广告) {
  909. 侧边栏广告.remove();
  910. console.log("删除侧边栏广告");
  911. } else {
  912. var 挂件 = document.querySelector(".game_close_btn.svelte-a683jp")
  913. if (挂件) {
  914. 挂件.click();
  915. console.log("移除了挂件广告。");
  916. } else {
  917. var cartoonlist = document.querySelector(".card.vertical")
  918. if (cartoonlist) {
  919. // 在这里添加对应的删除操作
  920. } else {
  921. pauselayer = document.querySelector('[data-role="creative-player-full-screen-pause-layer"]')
  922. if (pauselayer) {
  923. pauselayer.remove();
  924. console.log("删除暂停视频的弹窗广告");
  925. } else {
  926. //内嵌的商品广告
  927. var data05e6c233 = document.querySelector('iframe[data-v-05e6c233]')
  928. if (data05e6c233) {
  929. data05e6c233.remove();
  930. console.log("删除内嵌的商品广告");
  931. }
  932. }
  933. }
  934. }
  935. }
  936. }
  937. }
  938. }
  939. }
  940. }
  941. }
  942.  
  943. var 播放器缩小广告 = document.querySelector('[class="txp_full_screen_pause-close"]');
  944. if (播放器缩小广告) {
  945. 播放器缩小广告.click();
  946. console.log("删除播放器缩小广告");
  947. }
  948. var 悬浮播放器 = document.querySelector('[class="vue-portal-target"]');
  949. if (悬浮播放器) {
  950. 悬浮播放器.remove();
  951. console.log("删除悬浮播放器");
  952. }
  953. var desc__download = document.querySelector('[class="open-app video-desc__download"]');
  954. if (desc__download) {
  955. desc__download.remove();
  956. console.log("删除手机浏览器下载app按钮");
  957. }
  958. var 侧边广告 = document.querySelector('.player-side-ads__left');
  959. if (侧边广告) {
  960. 侧边广告.parentNode.removeChild(interactiframe);
  961. console.log("删除播放器左侧栏广告", "interactiframe");
  962. }
  963. var 侧边挂件 = document.querySelector('[class="iwan-gamependant-container"]');
  964. if (侧边挂件) {
  965. 侧边挂件.remove();
  966. console.log("删除侧边挂件广告", "iwan-gamependant-container");
  967. }
  968.  
  969. var interactiframe = document.querySelector('.interact_entry.player__interact-iframe');
  970. if (interactiframe) {
  971. interactiframe.parentNode.removeChild(interactiframe);
  972. console.log("删除未知广告", "interactiframe");
  973. }
  974. var txpzt = document.querySelector('.txp_zt');
  975. if (txpzt) {
  976. txpzt.remove();
  977. console.log("删除未知广告", "txpzt");
  978. }
  979. // 去app查看
  980. var appBanner = document.querySelector('.at-app-banner__open-method.at-app-banner--button');
  981. if (appBanner) {
  982. appBanner.remove();
  983. }
  984.  
  985. // 去app查看2
  986. var appButton = document.querySelector('[dt-eid="open_app_bottom"]');
  987. if (appButton) {
  988. appButton.remove();
  989. }
  990.  
  991. // 播放器悬浮广告
  992. appButton = document.querySelector('[class="txp_ad_detail txp_ad_active_normal');
  993. if (appButton) {
  994. appButton.remove();
  995. }
  996.  
  997. }
  998. // 调用函数并打印
  999. function 爱奇艺去广告() {
  1000. if (localStorage.getItem('advertisement') === "true") {
  1001. //下载按钮
  1002. document.querySelector('[class="btnDownload_item__7wa4m "]')?.remove();;
  1003. //播放器右栏广告
  1004. let 播放器右栏广告 = document.querySelector('[class="qy-plist-ad type-3 roll"]')
  1005. if (播放器右栏广告) {
  1006. 播放器右栏广告.remove();
  1007. console.log("移除播放广告按钮");
  1008. }
  1009. //播放广告
  1010. let 播放广告 = document.querySelector('[class="cupid-pause-max-close-btn"]');
  1011. if (播放广告) {
  1012. if (播放广告.parentElement.style.display != 'none') {
  1013. 播放广告.click();
  1014.  
  1015. }
  1016. }
  1017. //播放广告2
  1018. 播放广告 = document.querySelector('[class="skippable-after"]')
  1019. if (播放广告) {
  1020. if (播放广告.parentElement.style.display != 'none') {
  1021. 播放广告.click();
  1022.  
  1023. }
  1024. }
  1025. //下载应用按钮
  1026. const 下载应用按钮 = document.querySelector('[class="item tiicke-down"]');
  1027. if (下载应用按钮) {
  1028. 下载应用按钮.remove();
  1029. console.log("移除下载应用按钮");
  1030. }
  1031. //手机浏览器下载应用按钮
  1032. const 手机浏览器下载应用按钮 = document.querySelector('[class="c-videoPlayPage-icon c-videoPlayPage-down"]');
  1033. if (手机浏览器下载应用按钮) {
  1034. 手机浏览器下载应用按钮.parentElement?.parentElement?.parentElement?.remove();
  1035. console.log("移除手机浏览器下载应用按钮");
  1036. }
  1037. //页面遮罩
  1038. const 页面遮罩 = document.querySelector('[class="qy-popup-mask"]');
  1039. if (页面遮罩) {
  1040. 页面遮罩.remove();
  1041. console.log("移除页面遮罩");
  1042. }
  1043. //打开app悬浮窗
  1044. const guide = document.querySelector('.m-iqyGuide-layer');
  1045. if (guide) {
  1046. guide.remove();
  1047. console.log("移除悬浮窗广告");
  1048. }
  1049. //打开app底部框
  1050. const banner = document.querySelector('.ChannelHomeBanner_hbd_eiF93');
  1051. if (banner) {
  1052. banner.remove();
  1053. console.log("移除底部框广告");
  1054. }
  1055. //应用推荐
  1056. const recList = document.querySelector('[name="m-recList"]');
  1057. if (recList) {
  1058. recList.remove();
  1059. console.log("移除应用推荐广告");
  1060. }
  1061. //播放页面打开app
  1062. const boxItems = document.querySelector('[id="player_bottom"]');
  1063. if (boxItems) {
  1064. boxItems.parentElement?.parentElement?.parentElement?.remove();
  1065. console.log("移除播放页面打开app广告");
  1066. }
  1067. //视频介绍
  1068. const videoInfo = document.querySelector('[name="m-videoInfo"]');
  1069. if (videoInfo) {
  1070. if (videoInfo.style.paddingTop !== '15px') {
  1071. videoInfo.style.paddingTop = '15px';
  1072. console.log("修改视频介绍样式");
  1073. }
  1074. }
  1075. //播放页面悬浮推荐
  1076. const hotWords = document.querySelector('[class="m-hotWords-bottom"]');
  1077. if (hotWords && hotWords.parentElement) {
  1078. hotWords.parentElement.remove();
  1079. console.log("移除播放页面悬浮推荐广告");
  1080. }
  1081. //播放页面视频详情下广告
  1082. const qy_plist_ad = document.querySelector('[class="qy-plist-ad type-1 image"]');
  1083. if (qy_plist_ad) {
  1084. qy_plist_ad.remove();
  1085. console.log("移除播放页面视频详情下广告");
  1086. }
  1087. //播放页面视频详情下广告
  1088. const 试看提示 = document.querySelector('[id="cc_minimalism_popup"]');
  1089. if (试看提示) {
  1090. 试看提示.remove();
  1091. console.log("移除播放页面试看提示广告");
  1092. }
  1093. //播放页面视频详情下广告
  1094. const 登陆提示 = document.querySelector('[data-block-v2="bottom_denglu"]');
  1095. if (登陆提示) {
  1096. 登陆提示.remove();
  1097. console.log("移除登陆提示");
  1098. }
  1099. //首页广告条
  1100. const adtl = document.querySelectorAll('[class="ad-tl"]');
  1101. for (let index = 0; index < adtl.length; index++) {
  1102. adtl[index].remove();
  1103. console.log("移除首页广告条提示");
  1104. }
  1105. //开通会员提示
  1106. let bTest = document.querySelector('[class="header__promotion__popup bTest"]')
  1107. if (bTest) {
  1108. bTest.remove();
  1109. console.log('爱奇艺开通会员提示广告去除执行完成')
  1110. }
  1111. //视频列表广告
  1112. let adseed = document.querySelector('[class="ad-seed"]')
  1113. if (adseed) {
  1114. adseed.remove();
  1115. console.log('爱奇艺视频列表广告去除执行完成')
  1116. }
  1117. //视频列表广告
  1118. let adef = document.querySelector('[class="ad-ef"]')
  1119. if (adef) {
  1120. adef.remove();
  1121. console.log('爱奇艺首页视频栏广告去除执行完成')
  1122. }
  1123. //播放页面广告
  1124. let 播放页面广告 = document.querySelector('[class="cupid-pause-max-close-btn"]')
  1125. if (播放页面广告) {
  1126. 播放页面广告.click();
  1127. console.log('爱奇艺播放页面广告去除执行完成')
  1128. }
  1129. //顶栏右侧游戏按钮
  1130. let 顶栏右侧游戏按钮 = document.querySelector('[class="T-icon-game"]')
  1131. if (顶栏右侧游戏按钮) {
  1132. 顶栏右侧游戏按钮.remove();
  1133. console.log('爱奇艺顶栏右侧游戏按钮游戏广告去除执行完成')
  1134. }
  1135. let 顶栏栏目选择 = document.querySelectorAll('[class="nav-link nav-index J-nav-channel"')
  1136. for (let index = 0; index < 顶栏栏目选择.length; index++) {
  1137. if (顶栏栏目选择[index].textContent === '游戏') {
  1138. 顶栏栏目选择[index].remove();
  1139. console.log('爱奇艺顶栏顶栏栏目选择按钮游戏广告去除执行完成')
  1140. }
  1141. }
  1142. // 轮播栏广告
  1143. let 轮播栏广告 = document.querySelectorAll('[class="panel-item"][data-v-e765da72]');
  1144. if (轮播栏广告.length > 0) {
  1145. for (let index = 轮播栏广告.length - 1; index >= 0; index--) {
  1146. let href = 轮播栏广告[index].querySelector('[href]');
  1147. if (href) {
  1148. href = href.getAttribute('href');
  1149. // 提取域名
  1150. const regex = /\/\/(.+)\//;
  1151. // 匹配 URL 字符串中的域名
  1152. const match = href.match(regex);
  1153. // 提取匹配结果中的域名
  1154. const domain = match && match[1];
  1155. if (domain) {
  1156. if (!domain.includes('.iqiyi') || domain.includes('game')) {
  1157. 轮播栏广告[index].remove();
  1158. console.log('爱奇艺轮播栏广告广告去除执行完成');
  1159. }
  1160. }
  1161. }
  1162. }
  1163. }
  1164.  
  1165.  
  1166. let 轮播栏广告2 = document.querySelector('[class="qy20-h-carousel_con-gray"][data-v-e765da72]')?.querySelectorAll('a');
  1167. if (轮播栏广告2) {
  1168. if (轮播栏广告2.length > 0) {
  1169. for (let index = 轮播栏广告2.length - 1; index >= 0; index--) {
  1170. let href2 = 轮播栏广告2[index].getAttribute('href');
  1171. if (href2) {
  1172. // 提取域名
  1173. const regex = /\/\/(.+)\//;
  1174. // 匹配 URL 字符串中的域名
  1175. const match = href2.match(regex);
  1176. // 提取匹配结果中的域名
  1177. const domain = match && match[1];
  1178. if (domain) {
  1179. if (!domain.includes('.iqiyi.') || domain.includes('game')) {
  1180. 轮播栏广告2[index].setAttribute('href', '');
  1181. console.log('爱奇艺轮播栏广告href去除执行完成');
  1182. }
  1183. }
  1184. }
  1185. }
  1186. }
  1187.  
  1188. }
  1189. // 轮播栏广告
  1190. let 轮播栏广告3 = document.querySelectorAll('.panel-item-link ');
  1191. if (轮播栏广告3.length > 0) {
  1192. for (let index = 轮播栏广告3.length - 1; index >= 0; index--) {
  1193. let href = 轮播栏广告3[index].href;
  1194. if (href) {
  1195. let url = new URL(href).hostname;
  1196.  
  1197. if (url) {
  1198. if (!url.includes('.iqiyi') || url.includes('game')) {
  1199. 轮播栏广告3[index].remove();
  1200. console.log('爱奇艺轮播栏广告3广告去除执行完成');
  1201. }
  1202. }
  1203. }
  1204. }
  1205.  
  1206. // 轮播栏广告
  1207. let 轮播栏广告4 = document.querySelectorAll('.qy20-h-carousel__link');
  1208. if (轮播栏广告4.length > 0) {
  1209. for (let index = 轮播栏广告4.length - 1; index >= 0; index--) {
  1210. let href = 轮播栏广告4[index].href;
  1211. if (href) {
  1212. let url = new URL(href).hostname;
  1213.  
  1214. if (url) {
  1215. if (!url.includes('.iqiyi') || url.includes('game')) {
  1216. 轮播栏广告4[index].remove();
  1217. document.querySelectorAll('.qy20-h-carousel__ul')[index]?.remove()
  1218. console.log('爱奇艺轮播栏广告4广告去除执行完成');
  1219. }
  1220. }
  1221. }
  1222. }
  1223. }
  1224.  
  1225.  
  1226.  
  1227. //轮播栏广告按钮
  1228. let 轮播栏广告按钮 = document.querySelector('[class="qy20-h-carousel__ad"]')
  1229. if (轮播栏广告按钮) {
  1230. 轮播栏广告按钮.style.display = 'none';
  1231. //console.log('爱奇艺轮播栏广告按钮去除执行完成',轮播栏广告按钮)
  1232. }
  1233. //console.log('爱奇艺广告去除执行完成')
  1234.  
  1235. }
  1236. }
  1237. }
  1238.  
  1239. function 优酷去广告() {
  1240. if (localStorage.getItem('advertisement') === "true") {
  1241.  
  1242. //底部打开app提示
  1243. let 底部打开app提示 = document.querySelector('[sourcetype="Sbanner_circle_0"]')
  1244. if (底部打开app提示) {
  1245. 底部打开app提示.remove();
  1246. console.log('优酷底部打开app提示去除执行完成')
  1247.  
  1248. }
  1249. //条幅广告
  1250. let 条幅广告 = document.querySelectorAll('[class="channelcommon_container "]')
  1251. for (let index = 0; index < 条幅广告.length; index++) {
  1252. 条幅广告[index].parentElement.remove();
  1253. console.log('优酷条幅广告去除执行完成')
  1254. }
  1255.  
  1256. //继续使用浏览器
  1257. let pause = document.querySelector('[id="youku-pause-container"]')
  1258. if (pause) {
  1259. pause.remove();
  1260. console.log('优酷继播放暂停广告去除执行完成')
  1261. }
  1262. //继续使用浏览器
  1263. let callEnd_box = document.querySelector('[class="callEnd_box "]')
  1264. if (callEnd_box) {
  1265. callEnd_box.remove();
  1266. console.log('优酷继续使用浏览器广告去除执行完成')
  1267. }
  1268. //下载app按钮
  1269. let download_clipboard = document.querySelector('[class="download clipboard"]')
  1270. if (download_clipboard) {
  1271. download_clipboard.parentElement.remove();
  1272. console.log('优酷下载app按钮去除执行完成')
  1273. }
  1274. //下载客户端按钮
  1275. let download = document.querySelector('[name="download"]')
  1276. if (download) {
  1277. download.remove();
  1278. console.log('优酷下载客户端去除执行完成')
  1279. }
  1280. //下载app
  1281. let downloadApp = document.querySelector('[class="icon downloadApp"]')
  1282. if (downloadApp) {
  1283. downloadApp.remove();
  1284. console.log('优酷下载app广告去除执行完成')
  1285. }
  1286. //领取会员
  1287. let guide = document.querySelector('[class="clipboard h5-detail-vip-guide"]')
  1288. if (guide) {
  1289. guide.remove();
  1290. console.log('优酷领取会员广告去除执行完成')
  1291. }
  1292. //继续使用浏览器
  1293. let promotelogin_infobottom = document.querySelector('[class="promotelogin_infobottom"]')
  1294. if (promotelogin_infobottom) {
  1295. promotelogin_infobottom.remove();
  1296. console.log('优酷继续使用浏览器2广告去除执行完成')
  1297. }
  1298. let 轮播栏广告 = document.querySelectorAll('[class=" newswiper_img_box"]')
  1299. for (let index = 0; index < 轮播栏广告.length; index++) {
  1300. let href = 轮播栏广告[index].getAttribute('href');
  1301. if (href) {
  1302. // 提取域名
  1303. //console.log(href)
  1304. const regex = /\/\/(.+)\//;
  1305. // 匹配 URL 字符串中的域名
  1306. const match = href.match(regex);
  1307. // 提取匹配结果中的域名
  1308. const domain = match && match[1];
  1309. if (domain) {
  1310. if (!domain.includes('youku.') || domain.includes('game')) {
  1311. 轮播栏广告[index].parentElement.remove()
  1312. // console.log(轮播栏广告[index].parentElement)
  1313. }
  1314. }
  1315.  
  1316. }
  1317. }
  1318. //动画轮播
  1319. let 轮播栏广告2 = document.querySelectorAll('[class=" slideBox"][data-href]')
  1320. for (let index = 0; index < 轮播栏广告2.length; index++) {
  1321. let href = 轮播栏广告2[index].getAttribute('data-href');
  1322. if (href) {
  1323. // 提取域名
  1324. //console.log(href)
  1325. const regex = /\/\/(.+)\//;
  1326. // 匹配 URL 字符串中的域名
  1327. const match = href.match(regex);
  1328. // 提取匹配结果中的域名
  1329. const domain = match && match[1];
  1330. if (domain) {
  1331. if (!domain.includes('youku.') || domain.includes('game')) {
  1332. 轮播栏广告2[index].parentElement.remove()
  1333. }
  1334. }
  1335. }
  1336. }
  1337. console.log('优酷广告去除执行完成')
  1338. }
  1339. }
  1340. function 监测爱奇艺轮播广告() {
  1341. // 目标元素
  1342. const targetElement = document.querySelector('.focus-img-wrap');
  1343. if (targetElement) {
  1344. // 创建一个 MutationObserver 实例
  1345. const observer = new MutationObserver((mutationsList, observer) => {
  1346. // 在每次变动时执行的回调函数
  1347. for (const mutation of mutationsList) {
  1348. if (mutation.type === 'childList') {
  1349. // 子节点发生变化(添加或删除)
  1350.  
  1351. let 链接 = mutation.target.querySelector('.img-link');
  1352. if (链接) {
  1353. let url = new URL(链接.href).hostname;
  1354. if (!url.includes('.iqiyi') || url.includes('game')) {
  1355.  
  1356. 链接.href = ''
  1357. 链接.style.backgroundImage = 'url("//pic0.iqiyipic.com/lequ/common/lego/20240107/cad725369c6c4c579219ee46f3b4d6d5.jpg?caplist=jpg,webp")'
  1358. 链接 = targetElement.querySelector('.focus_title_inner');
  1359. if (链接) {
  1360. url = new URL(链接.href).hostname;
  1361. if (!url.includes('.iqiyi') || url.includes('game')) {
  1362. 链接.href = ''
  1363. 链接.querySelector('.caption').textContent = '航海之王';
  1364. 链接.querySelector('.desc').textContent = '新春观影快乐';
  1365. console.log('修改标题', mutation.target);
  1366. }
  1367. }
  1368. }
  1369. }
  1370.  
  1371.  
  1372.  
  1373.  
  1374. } else if (mutation.type === 'attributes') {
  1375. // 属性发生变化
  1376.  
  1377. }
  1378. }
  1379. });
  1380.  
  1381. // 配置观察选项
  1382. const config = { childList: true, attributes: true, subtree: true };
  1383.  
  1384. // 开始观察目标元素
  1385. observer.observe(targetElement, config);
  1386.  
  1387. }
  1388.  
  1389. }
  1390. //监测全屏状态
  1391. function 监测全屏状态() {
  1392. var targetNode = document.querySelector("body"); // 要监测的目标元素
  1393. // console.log("蜀黍", targetNode);
  1394. var observer = new MutationObserver(function (mutationsList) {
  1395. for (var mutation of mutationsList) {
  1396. if (mutation.type === 'attributes') {
  1397. // 如果发现目标元素的属性变化
  1398. if (mutation.attributeName === 'class') {
  1399. console.log('类名发生了变化:', targetNode.className);
  1400. const main_button = document.querySelector(".main_button");
  1401. const toggle_button = document.querySelector(".toggle_button");
  1402. if (targetNode.className === "tvplayer-fake-fullscreeen plugin_ctrl_fake_fullscreen") {
  1403. main_button.style.opacity = "0";
  1404. toggle_button.style.opacity = "0";
  1405. } else {
  1406. main_button.style.opacity = "1";
  1407. toggle_button.style.opacity = "1";
  1408. }
  1409. }
  1410. }
  1411. }
  1412. });
  1413. var config = { attributes: true, attributeFilter: ['class', 'dt-params'] };
  1414. observer.observe(targetNode, config);
  1415. }
  1416.  
  1417. function 侧边栏按钮创建() {
  1418. // 创建侧边栏开关按钮元素
  1419. if (!location.hostname.includes('v.qq.')) {
  1420. return;
  1421. }
  1422. document.querySelector('.toggle_button')?.remove()
  1423. const selectButton = document.createElement('div');
  1424. selectButton.className = 'toggle_button';
  1425. selectButton.textContent = '<';
  1426. // 设置按钮样式
  1427. selectButton.style.top = '40%';
  1428. selectButton.style.color = 'rgb(55, 99, 57)';
  1429. selectButton.style.background = 'linear-gradient(to right, rgb(220, 240, 176), rgba(252, 247, 224, 0.5))';
  1430. selectButton.style.cursor = 'pointer';
  1431. selectButton.style.zIndex = '9999';
  1432. selectButton.style.position = 'fixed';
  1433. selectButton.style.width = '15px';
  1434. selectButton.style.height = '50px';
  1435. selectButton.style.borderRadius = '2px';
  1436. selectButton.style.lineHeight = '50px';
  1437. selectButton.style.display = 'flex';
  1438. selectButton.style.justifyContent = 'center'
  1439. document.body.appendChild(selectButton);
  1440. 侧边栏调整()
  1441. }
  1442. //手动调整侧边剧集栏,初次打开网页,会自动收起侧边剧集栏
  1443. function 侧边栏调整() {
  1444. // 封装函数来处理侧边栏的显示和隐藏
  1445. function toggleSidebar(selectButton) {
  1446. var 展开侧边栏;
  1447. //新版侧边栏,没有自带按钮
  1448. const 自带收缩按钮 = document.querySelector('.player__wide-btn');
  1449. const sidebar = document.querySelector('.page-content__right');
  1450. var 播放器;
  1451. if (自带收缩按钮) {
  1452. dinglan = document.querySelector('.site_head.dd.site_head_channel');
  1453. 播放器 = document.querySelector('#player-container');
  1454. var episode = document.querySelectorAll(".container-episode").length
  1455. //判断自带的关闭侧边栏按钮
  1456. var wideBtn = 自带收缩按钮;
  1457. if (episode) {
  1458. if (wideBtn) {
  1459. wideBtn.click();
  1460. 展开侧边栏 = false;
  1461. }
  1462. } else {
  1463. if (wideBtn) {
  1464. wideBtn.click();
  1465. 展开侧边栏 = true;
  1466. }
  1467. }
  1468. return;
  1469. } else {
  1470. 播放器 = document.querySelector('#player-container');
  1471. if (!播放器) {
  1472. return;
  1473. }
  1474.  
  1475. if (sidebar.style.display === 'none') {
  1476. // 恢复侧边栏
  1477. sidebar.style.display = '';
  1478. 展开侧边栏 = true;
  1479. } else {
  1480. // 关闭侧边栏
  1481. sidebar.style.display = 'none';
  1482. 展开侧边栏 = false;
  1483. }
  1484. }
  1485. //收缩展开侧边栏,并重新调整播放器大小
  1486. if (展开侧边栏 === true) {
  1487. selectButton.textContent = '<';
  1488. var 播放器框架 = document.querySelector(".container-main__left")
  1489. // 从元素中获取原始宽度和高度
  1490. const originalWidth = 播放器.style.width;
  1491. const originalHeight = 播放器.style.height;
  1492. //新的高度site_head dd site_head_channel top-nav-wrap head_inner
  1493. var dinglan = document.querySelector('.top-nav-wrap.head_inner');
  1494. var newVideoHeight = window.innerHeight - dinglan.offsetHeight - 30;
  1495. // 计算新的宽度
  1496. //const newWidth = (parseInt(originalWidth) / parseInt(originalHeight)) * newVideoHeight;
  1497. // 设置元素 player-container 的宽度
  1498. //播放器.style.width = `${newWidth}px`;
  1499.  
  1500. 播放器.style.height = `${newVideoHeight}px`;
  1501. console.log("新的播放器宽度", newVideoHeight)
  1502. // 将修改后的宽度和高度保存在浏览器缓存中
  1503. //localStorage.setItem('modifiedWidth', `${newWidth}px`);
  1504. localStorage.setItem('modifiedHeight', `${newVideoHeight}px`);
  1505. } else {
  1506. selectButton.textContent = '>';
  1507. // 从缓存中获取修改后的宽度和高度
  1508. //const cachedWidth = localStorage.getItem('modifiedWidth');
  1509. const cachedHeight = localStorage.getItem('modifiedHeight');
  1510. // 设置元素 player-container 的宽度和高度
  1511. //播放器.style.width = cachedWidth;
  1512. 播放器.style.height = cachedHeight;
  1513. }
  1514. }
  1515. //侧边栏按钮点击
  1516. const selectButton = document.querySelector('.toggle_button')
  1517. selectButton.addEventListener('click', function (event) {
  1518. event.stopPropagation(); // 阻止事件冒泡
  1519. event.preventDefault(); // 阻止默认行为
  1520. toggleSidebar(selectButton);
  1521. });
  1522. //绑定按钮元素移动
  1523. selectButton.addEventListener('mousedown', function (e) {
  1524. //dragMenu(selectButton, e);
  1525. });
  1526. if (localStorage.getItem('closesidebar') === "true") {
  1527. toggleSidebar(selectButton);
  1528.  
  1529. }
  1530. }
  1531. //元素移动函数
  1532.  
  1533. //提示弹幕
  1534. function showToast(message, isError) {
  1535. // 创建新的提示框
  1536. const toastContainer = document.createElement('div');
  1537. // 设置样式属性
  1538. toastContainer.style.position = 'fixed';
  1539. toastContainer.style.justifyContent = 'center';
  1540. toastContainer.style.top = '30%';
  1541. toastContainer.style.left = '50%';
  1542. toastContainer.style.width = '65vw';
  1543. toastContainer.style.transform = 'translate(-50%, -50%)';
  1544. toastContainer.style.display = 'flex';
  1545. toastContainer.style.padding = '5px';
  1546. toastContainer.style.fontSize = '20px';
  1547. toastContainer.style.background = '#e7f4ff';
  1548. toastContainer.style.zIndex = '999';
  1549. toastContainer.style.borderRadius = '15px';
  1550. toastContainer.classList.add('PopupMessage'); // 设置 class 名称为 PopupMessage
  1551. // 根据是否为错误提示框添加不同的样式
  1552. if (isError) {
  1553. toastContainer.classList.add('success');
  1554. toastContainer.style.color = '#3fc91d';
  1555. } else {
  1556. toastContainer.classList.add('error');
  1557. toastContainer.style.color = '#CC5500';
  1558. }
  1559. // 将提示框添加到页面中
  1560. document.body.appendChild(toastContainer);
  1561. // 获取页面高度的 20vh
  1562. const windowHeight = window.innerHeight;
  1563. //设置最低的高度。
  1564. const height = windowHeight * 0.2;
  1565. // 设置当前提示框的位置
  1566. toastContainer.style.top = `${height}px`;
  1567. // 在页面中插入新的信息
  1568. const toast = document.createElement('div');
  1569. // 使用 <br> 实现换行
  1570. toast.innerHTML = message.replace(/\n/g, '<br>');
  1571. toastContainer.appendChild(toast);
  1572. // 获取所有的弹出信息元素,包括新添加的元素
  1573. const popupMessages = document.querySelectorAll('.PopupMessage');
  1574. // 调整所有提示框的位置
  1575. let offset = 0;
  1576. popupMessages.forEach(popup => {
  1577. if (popup !== toastContainer) {
  1578. popup.style.top = `${parseInt(popup.style.top) - toast.offsetHeight - 5}px`;
  1579. }
  1580. offset += popup.offsetHeight;
  1581. });
  1582. // 在 3 秒后隐藏提示框
  1583. setTimeout(() => {
  1584. toastContainer.classList.add('hide');
  1585. // 过渡动画结束后移除提示框
  1586. setTimeout(() => {
  1587. toastContainer.parentNode.removeChild(toastContainer);
  1588. }, 300);
  1589. }, 3000);
  1590. }
  1591.  
  1592. //监测激活状态
  1593. function 监测激活状态() {
  1594. document.addEventListener("visibilitychange", function () {
  1595. if (document.visibilityState === "visible") {
  1596. // 浏览器窗口处于激活状态
  1597. console.log("浏览器已激活");
  1598. document.querySelector("body").click();
  1599. } else {
  1600. // 浏览器窗口处于非激活状态
  1601. console.log("浏览器已非激活");
  1602. }
  1603. });
  1604.  
  1605. }
  1606.  
  1607. function 函数存放(函数) {
  1608. // txp_videos_container
  1609. if (函数 === "轮播栏广告小图") {
  1610. if (localStorage.getItem('advertisement') === "true") {
  1611. var elements = document.querySelectorAll(".focus-item");
  1612. elements.forEach(function (element) {
  1613. if (element.tagName === "A") {
  1614. // console.log("蜀黍", element.href);
  1615. if (element.href === "javascript:;") {
  1616. var 关闭广告 = document.querySelector(".close-creative");
  1617. if (关闭广告) {
  1618. if (关闭广告.title === "关闭广告") {
  1619. 关闭广告.click();
  1620. console.log("移除轮播栏的广告成功")
  1621. return;
  1622. } else {
  1623. console.log("删除轮播栏的广告成功")
  1624. element.remove();
  1625. 关闭广告 = document.querySelector(".close-creative");
  1626. if (关闭广告.title === "关闭广告") {
  1627. 关闭广告.click();
  1628. console.log("移除轮播栏的广告成功2")
  1629. return;
  1630. }
  1631. }
  1632. }
  1633. }
  1634. }
  1635. });
  1636. }
  1637. }
  1638. if (函数 === "轮播栏广告播放") {
  1639. if (localStorage.getItem('advertisement') === "true") {
  1640. var 轮播广告栏 = document.querySelectorAll('.focus-wrap.large-focus')
  1641. if (轮播广告栏) {
  1642. var targetNode = document.querySelector(".close-creative");
  1643. if (targetNode) {
  1644. var adobserver = new MutationObserver(function (mutationsList, observer) {
  1645. for (var mutation of mutationsList) {
  1646. if (mutation.type === 'attributes' && mutation.attributeName === 'title') {
  1647. if (mutation.target.title === "关闭广告") {
  1648. mutation.target.click();
  1649. }
  1650. }
  1651. }
  1652. });
  1653. var config = { attributes: true };
  1654. adobserver.observe(targetNode, config);
  1655. }
  1656. }
  1657. }
  1658. }
  1659. if (函数 === "去除视频水印") {
  1660. if (localStorage.getItem('removewatermark') === "true") {
  1661. if (document.querySelector("#player > txpdiv")) {
  1662. document.querySelector("#player > txpdiv").remove();
  1663. console.log("视频水印已去除1")
  1664. }
  1665. var watermarkElement = document.querySelector('.txp-watermark');
  1666. if (watermarkElement) {
  1667. // 移除水印元素
  1668. watermarkElement.parentNode.removeChild(watermarkElement);
  1669. console.log("视频水印已去除2")
  1670. }
  1671. }
  1672. }
  1673. if (函数 === "页面样式修改") {
  1674. if (localStorage.getItem('htmlbackground') === "true") {
  1675. var 主题选择 = localStorage.getItem('主题选择');
  1676. if (主题选择) {
  1677. 主题色选择(主题选择);
  1678. } else {
  1679. let 主题 = "月光色";
  1680. 主题色选择(主题);
  1681. }
  1682. let css;
  1683. if (location.hostname.includes('v.qq.')) {
  1684. css = `
  1685. html {
  1686. background: ${主题色} !important;
  1687. }
  1688. body {
  1689. min-width: 12px !important;
  1690. }
  1691. .small-focus .top-nav-wrap[data-v-063bf321], .top-nav-wrap-black[data-v-063bf321] {
  1692. background-color: ${主题色}f5 !important;
  1693. }
  1694. .at-feed--dark{
  1695. --C2: ${浅灰字体色} !important;
  1696. }
  1697. :root[theme|=v2]{
  1698. --C2: ${浅灰字体色} !important;
  1699. }
  1700. /*评论区内容*/
  1701. [class="page-content__bottom"]{
  1702. width: calc(100vw - 475px);
  1703. }
  1704. .at-feed.at-feed--dark.at-feed--normal {
  1705. margin: 0 0 0 10px;
  1706. }
  1707. /*播放器异常视频列表*/
  1708. .episode-panel__scroll-wrapper[data-v-fdb92036] .episode-panel__scroll-wrapper-header {
  1709. background:${深主题色} !important;
  1710. }
  1711. .b-tab[data-v-88ee66b1] {
  1712. background:${深主题色} !important;
  1713. filter: brightness(80%);
  1714. }
  1715. .top-list {
  1716. display: none;
  1717. }
  1718. /*侧边栏剧集*/
  1719. [class="page-content__right"]{
  1720. position: absolute !important;
  1721. left: calc(100vw - 400px);
  1722. top: 100vh;
  1723. }
  1724. /*反馈按钮*/
  1725. [id="shortcut"]{
  1726. opacity: 0;
  1727. }
  1728. [id="shortcut"]:hover {
  1729. opacity: 1;
  1730. }
  1731. /*顶栏高度*/
  1732. [class="top-nav-wrap head_inner"]{
  1733. height: 50px !important;
  1734. }
  1735. /*顶栏按钮*/
  1736. .channel-nav-text:hover {
  1737. color: #00ff62;
  1738. font-weight: 900 !important;
  1739. }
  1740. [class="mod_search"]{
  1741. top: 8px !important;
  1742. height: 35px !important;
  1743. }
  1744. [class="page-play view-content"] [class="_footer-wrap_yjuq2_1"]{
  1745. width: calc(100vw - 475px) !important;
  1746. }
  1747. .at-feed-stream-comment-item {
  1748. border-top: 1px solid ${深主题色} !important;
  1749. }
  1750. .at-feed-stream-item-wrapper {
  1751. border-radius: 10px;
  1752. background: ${深主题色} !important;
  1753. border-top: 1px solid ${深主题色} !important;
  1754. }
  1755. [class="at-feed at-feed--normal"]{
  1756. margin: 0 0 0 10px;
  1757. }
  1758. .container-main__left {
  1759. padding-bottom: calc(100vh - 55px) !important;
  1760. }
  1761. /*预约按钮*/
  1762. .video-subscribe-btn.order-normal-button {
  1763. background: rgb(251 128 2 / 75%) !important;
  1764. }
  1765. body {
  1766. background: ${主题色} url(//vm.gtimg.cn/z/static/vplay/child-bg.png) !important;
  1767. --background: ${主题色} !important;
  1768. }
  1769. /*视频列表*/
  1770. .list-page-wrap{
  1771. background: ${主题色} !important;
  1772. }
  1773. /*视频列表-返回*/
  1774. .list-page-wrap .kinds-list-wrap{
  1775. background: ${主题色} !important;
  1776. }
  1777. ._footer-wrap_yjuq2_1 {
  1778. background: ${主题色} !important;
  1779. }
  1780. /*顶栏设置*/
  1781. .top-nav-wrap.top-nav-wrap-black {
  1782. background: linear-gradient(to bottom,${深主题色}f5 ,${主题色}f5);
  1783. }
  1784. /*播放界面顶栏设置*/
  1785. #ssi-header{
  1786. --background: ${深主题色}7d !important;
  1787. }
  1788. .top-nav-wrap[data-v-063bf321]{
  1789. height: 55px !important;
  1790. }
  1791. .left-nav-wrap .logo-wrap .logo-link {
  1792. margin-top: 12px !important;
  1793. }
  1794. .left-nav-wrap .logo-wrap {
  1795. height: 55px !important;
  1796. }
  1797. .let-nav-wrap-black .logo-wrap{
  1798. background: linear-gradient(to bottom,${深主题色} ,${主题色});
  1799. }
  1800. /*左侧菜单列表*/
  1801. .left-nav-wrap.let-nav-wrap-black{
  1802. background: ${主题色} !important;
  1803. }
  1804. // /*左侧菜单列表*/
  1805. // .left-nav-wrap .nav-wrap{
  1806. // background: ${主题色} ;
  1807. // }
  1808. .sub-nav-group{
  1809. background-color:${深主题色}d9 !important;
  1810. }
  1811. /*账号页面*/
  1812. div#new_vs_header{
  1813. background: ${深主题色}d9 !important;
  1814. }
  1815. /*列表广告*/
  1816. .card-wrap{
  1817. display: none;
  1818. }
  1819. .video-card-wrap{
  1820. background: linear-gradient(to bottom, rgb(43, 43, 43), ${主题色}) !important;
  1821. }
  1822. /*视频图标变大*/
  1823. .video-card-wrap .video-card {
  1824. position: relative;
  1825. }
  1826. .video-card-wrap .video-card::before {
  1827. content: "";
  1828. border-radius: 16px;
  1829. position: absolute;
  1830. top: 0;
  1831. left: 0;
  1832. width: 100%;
  1833. height: 100%;
  1834. background-color: ${主题色}4d; /* 设置遮罩层的颜色和透明度 */
  1835. z-index: 1; /* 确保遮罩层位于元素之上 */
  1836. opacity: 0; /* 初始时遮罩层透明 */
  1837. transition: opacity 0.3s ease; /* 添加过渡效果 */
  1838. box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3); /* 添加内阴影效果 */
  1839. }
  1840. .video-card-wrap .video-card:hover::before {
  1841. opacity: 1; /* 鼠标悬停时遮罩层完全显示 */
  1842. }
  1843. .content.fixed{
  1844. background: ${主题色}d9 !important;
  1845. }
  1846. /*客户端下载*/
  1847. .pop_info_content.pop_client_wrap{
  1848. background: ${主题色}d9 !important;
  1849. }
  1850. /*视频分类详情列表*/
  1851. .list-base-wrap[data-v-b9f874bd]{
  1852. background: ${主题色} !important;
  1853. }
  1854. /*返回*/
  1855. .list-page-wrap .back-btn-wrap[data-v-fda3d7da]{
  1856. background: ${主题色} !important;
  1857. }
  1858. .list-base-wrap .kinds-list-wrap .kinds-list-content .abbreviat-filters[data-v-b9f874bd]{
  1859. background: ${主题色} !important;
  1860. }
  1861. /*置顶按钮*/
  1862. .list-base-wrap .goToTop[data-v-b9f874bd]{
  1863. background: ${深主题色}cc ;
  1864. }
  1865. .list-base-wrap .goToTop[data-v-b9f874bd]:hover{
  1866. background: ${深主题色}e6 ;
  1867. }
  1868. /*播放页面*/
  1869. /*VIP提示*/
  1870. .vip-button__main-title--v2 {
  1871. color: ${VIP主题色} !important;
  1872. }
  1873. /*播放器*/
  1874. .container-main__wrapper[data-v-83430311] {
  1875. position: relative;
  1876. top: -5px !important;
  1877. }
  1878. .play-layout[data-v-83430311] {
  1879. padding: 0 !important;
  1880. }
  1881. .playlist-side-fuild__container{
  1882. background: ${主题色}d9 !important;
  1883. }
  1884. .general-banner-adapt.filter-labels-wrap{
  1885. background: ${主题色}d9 !important;
  1886. }
  1887. .focus-wrap.large-focus {
  1888. box-shadow: 0px 0px 20px 21px rgb(3 21 26) !important;
  1889. }
  1890. /*播放器高度*/
  1891. @media (max-width: 1280px){
  1892. .page-content .container-player[data-v-e54bf460] {
  1893. height: 100vh!important;
  1894. }
  1895. }
  1896. @media (max-width: 1629px){
  1897. .page-content .container-player[data-v-e54bf460] {
  1898. height: 100vh !important;
  1899. }
  1900. }
  1901. @media (max-width: 1840px){
  1902. .page-content .container-player[data-v-e54bf460] {
  1903. height: 7100vh !important;
  1904. }
  1905. }
  1906. .container-player[data-v-e54bf460] {
  1907. height: 100vh !important;
  1908. }
  1909. .b-sticky__container[data-v-78461fb4] {
  1910. top: 50px !important;
  1911. }
  1912. /*分享列表*/
  1913. .playlist-intro__btns{
  1914. background: ${主题色} !important;
  1915. }
  1916. /*全集列表*/
  1917. .playlist-overlay{
  1918. background: ${主题色} !important;
  1919. }
  1920. /*历史记录*/
  1921. .quick_pop_tabs{
  1922. background: ${浅主题色} !important;
  1923. }
  1924. .mod_quick_videolist.mod_quick_videolist_history{
  1925. background: ${主题色} !important;
  1926. }
  1927. .quick_pop_footer{
  1928. background: ${浅主题色} !important;
  1929. }
  1930. /*旧播放界面背景*/
  1931. .container-main__wrapper[data-v-e54bf460] {
  1932. background: ${浅主题色} !important;
  1933. }
  1934. /*提示框*/
  1935. .toast-wrap{
  1936. background: ${深主题色}d9 !important;
  1937. }
  1938. /*反馈按钮*/
  1939. .x_fixed_tool{
  1940. background: ${主题色}d9 !important;
  1941. }
  1942. /*备案字体颜色*/
  1943. ._footer-wrap_yjuq2_1 * {
  1944. color: ${备案字体颜色} !important;
  1945. }
  1946. /*旧播放器页面*/
  1947. .container-main__wrapper[data-v-e54bf460]:before{
  1948. background: ${主题色} !important;
  1949. }
  1950. /*顶栏高度*/
  1951. #ssi-header{
  1952. height: 57px !important;
  1953. }
  1954. #ssi-header .site_head {
  1955. background: ${主题色}d9 !important;
  1956. }
  1957. .site_head{
  1958. height: 55px !important;
  1959. }
  1960.  
  1961. /*评论背景*/
  1962. .container-bottom{
  1963. background: ${主题色} !important;
  1964. }
  1965. .at-feed-stream-comment-list {
  1966. background: ${评论色} !important;
  1967. }
  1968. /*顶栏*/
  1969. .new_vs_header{
  1970. background: ${深主题色}d9 !important;
  1971. }
  1972. /*顶栏字体*/
  1973. .site_channel .channel_nav {
  1974. color: ${亮色字体} !important;
  1975. }
  1976. /*顶栏右边图标*/
  1977. .mod_quick .quick_link{
  1978. color: ${亮色字体} !important;
  1979. }
  1980. .site_channel .channel_more{
  1981. color: ${亮色字体} !important;
  1982. }
  1983. .site_head.dd.site_head_simple {
  1984. background: ${深主题色}d9 !important;
  1985. }
  1986. /*备案栏*/
  1987. ._footer-wrap_momhz_1{
  1988. background: ${主题色} !important;
  1989. }
  1990. ._footer-wrap_momhz_1 * {
  1991. color: ${备案字体颜色} !important;
  1992. }
  1993. .at-feed-stream-tab__nav {
  1994. padding-bottom: 5px !important;
  1995. }
  1996. /*评论颜色*/
  1997. .at-feed__date{
  1998. color: ${浅色字体} !important;
  1999. }
  2000. /*未选择颜色*/
  2001. .at-feed-stream-tab__nav-item{
  2002. color: ${浅色字体} !important;
  2003. }
  2004. /*登陆颜色*/
  2005. .at-feed-stream-post__login{
  2006. color: ${浅色字体} !important;
  2007. }
  2008. .at-feed-stream-post {
  2009. padding-bottom: 5px;
  2010. }
  2011. .t-feed__date{
  2012. color: ${备案字体颜色} !important;
  2013. }
  2014. /*无评论颜色*/
  2015. .at-feed-stream-tab .at-net-error__title{
  2016. color: ${浅色字体} !important;
  2017. }
  2018. /*长文本编写框*/
  2019. .mod-page__editor{
  2020. background: ${浅主题色} !important;
  2021. }
  2022. /*正文*/
  2023. .ql-container.ql-snow *{
  2024. background: ${浅主题色} !important;
  2025. }
  2026. /**/
  2027. .mod-page__action{
  2028. background: ${浅主题色}00 !important;
  2029. }
  2030. .mod-card{
  2031. background: ${浅主题色}00 !important;
  2032. }
  2033. .mod-button.disabled {
  2034. background: ${深主题色} !important;
  2035. }
  2036. /*备案栏配置*/
  2037. .contentinfo_title{
  2038. color: ${深色字体} !important;
  2039. }
  2040. .mod_footer_contentinfo .foot_link{
  2041. color: ${浅色字体} !important;
  2042. }
  2043. .mod_footer_contentinfo .dl_list .item{
  2044. color: ${浅色字体} !important;
  2045. }
  2046. .mod_footer *{
  2047. color: ${浅色字体} !important;
  2048. }
  2049. .cookie_textrea {
  2050. width: 0px;
  2051. /* 设置滚动条宽度 */
  2052. }
  2053. .cookie_textrea::-webkit-scrollbar {
  2054. width: 0px;
  2055. /* 设置滚动条宽度 */
  2056. }
  2057. .button:hover::after {
  2058. border-radius: 5px;
  2059. background-color: rgba(255, 255, 255, 0.3) !important;
  2060. }
  2061. .button:hover {
  2062. border-radius: 5px;
  2063. background-color: #70B9E8;
  2064. }
  2065. .button:active {
  2066. border-radius: 5px;
  2067. background: #2db628;
  2068. /* position: fixed; */
  2069. /* margin-bottom: 9px; */
  2070. text-shadow: none;
  2071. box-shadow: 10px 10px 10px rgba(0, 0, 0, .3) inset;
  2072. }
  2073. /*视频图标变大*/
  2074. .card.vertical {
  2075. transition: transform 0.3s ease; /* 添加过渡效果 */
  2076. }
  2077. .card.vertical:hover {
  2078. transform: scale(1.2); /* 鼠标悬停时放大1.2倍 */
  2079. }
  2080. .player-bottom__intro[data-v-00cea49d] {
  2081. padding-left: 32px !important;
  2082. }
  2083. .episode-container[data-v-fdb92036] {
  2084. position: absolute !important;
  2085. top: calc(100vh - 55px) !important;
  2086. height: 100vh !important;
  2087. }
  2088. .container-bottom__inner[data-v-e54bf460] {
  2089. width: calc(100vw - 96px) !important;
  2090.  
  2091. }
  2092. /*.player-bottom[data-v-7a1450c1] {
  2093. background: ${深主题色} !important;
  2094. }*/
  2095. .container-bottom__left[data-v-e54bf460] {
  2096. width: calc(100vw - 400px) !important;
  2097. }
  2098. .episode-panel__scroll-wrapper[data-v-fdb92036] {
  2099. background: ${深主题色} !important;
  2100. }
  2101. // .container-main__left[data-v-e54bf460] {
  2102. // width: 100vw !important;
  2103. // }
  2104. .container-main[data-v-e54bf460] {
  2105. width: 98vw !important;
  2106. }
  2107. .container-episode[data-v-e54bf460] {
  2108. width: 0px !important;
  2109. }
  2110. /*全部剧集关闭按钮*/
  2111. svg.base-icon.svg-icon.svg-icon__overlay-close {
  2112. width: 40px !important;
  2113. height: 40px !important;
  2114. }
  2115. svg.base-icon.svg-icon.svg-icon__overlay-close:hover {
  2116. width: 40px !important;
  2117. height: 40px !important;
  2118. color: #570000 !important;
  2119. }
  2120. * {
  2121. scrollbar-color: ${深主题色} transparent !important;
  2122. }
  2123.  
  2124. .player-bottom__item-download{
  2125. display: none !important;
  2126. }
  2127. .list-page-wrap[data-v-fda3d7da]{
  2128. top: 50px !important;
  2129. }
  2130. .list-base-wrap[data-v-b9f874bd]{
  2131. top: 50px !important;
  2132. }
  2133. `;
  2134. }
  2135.  
  2136. //优酷主题
  2137. if (location.hostname.includes('youku.')) {
  2138. css = `
  2139. #app{
  2140. background-color: ${主题色} !important;
  2141. }
  2142. body {
  2143. background: ${主题色} !important;
  2144. }
  2145. /*顶栏*/
  2146. .topheader_top_header_box{
  2147. background-color:${深主题色}ab !important;
  2148. }
  2149. /*轮播栏阴影*/
  2150. .focussidebarswiper_focus_wrap{
  2151. box-shadow: 0px 0px 20px 21px rgb(3 21 26) !important;
  2152. }
  2153. [data-theme=dark] .right-wrap{
  2154. background-color: ${主题色} !important;
  2155. height: calc(100vh - 290px) !important;
  2156. }
  2157. [class="preview_preview_wrap"]{
  2158. background-color:#deb406 ;
  2159. }
  2160. .preview_preview_wrap .preview_preview_pos .preview_preview_desc, .preview_preview_wrap_focus .preview_preview_pos .preview_preview_desc, .preview_preview_wrap_focus_out .preview_preview_pos .preview_preview_desc, .preview_preview_wrap_out .preview_preview_pos .preview_preview_desc{
  2161. color: #ffffff;
  2162. }
  2163. [data-theme=dark] .module-playbox-new .playbox-new .play-paction-wrap-new .nav-mamu-new{
  2164. background-color: ${深主题色} !important;
  2165. }
  2166. [data-theme=dark] body.newBg {
  2167. background: ${主题色}!important;
  2168. }
  2169. /*播放器左侧*/
  2170. .play-top-container-new{
  2171. background-color: ${主题色} !important;
  2172. }
  2173. #app{
  2174. background-color: ${主题色} !important;
  2175. }
  2176. /*播放页面视频介绍*/
  2177. [data-theme=dark] .bottom-area-wrap-new{
  2178. background-color: ${主题色} !important;
  2179. }
  2180. /*主页顶栏*/
  2181. .topheader_topheaderwrap{
  2182. background-color:${深主题色}cf !important;
  2183. }
  2184. .modulelist_s_body{
  2185. background-color: ${主题色} !important;
  2186. }
  2187. .g-box{
  2188. border-radius: 10px;
  2189. background: linear-gradient(to bottom, ${深主题色} , ${主题色}61);
  2190. }
  2191. .pack_yk_pack_focus .pack_info_list{
  2192. background-color: ${深主题色} !important;
  2193. }
  2194. .newswiper_swiper_wrap{
  2195. box-shadow: 0px 0px 20px 21px rgb(3 21 26) !important;
  2196. }
  2197. .preview_preview_wrap_focus{
  2198. background-color: ${深主题色}!important;
  2199. }
  2200. .preview_preview_wrap.preview_posright{
  2201. background-color: ${深主题色} !important;
  2202. }
  2203. .pack_yk_pack_v .pack_pack_cover, .pack_yk_pack_v .pack_vip_cover{
  2204. background-color: ${深主题色} !important;
  2205. }
  2206. /*轮播栏*/
  2207. .module_mod{
  2208. top: 70px;
  2209. }
  2210. /*轮播栏下选择按钮*/
  2211. .channelcommon_container{
  2212. top: 50px;
  2213. }
  2214. /*播放页背景*/
  2215. .play-top-container-new {
  2216. background: ${深主题色}!important;
  2217. }
  2218.  
  2219. [data-theme=dark] .listbox-new {
  2220. top: 0px !important;
  2221. right: -15px !important;
  2222. position: absolute !important;
  2223. height: calc(100vh - 460px) !important;
  2224. border-radius: 0 0 20px 20px;
  2225. opacity: 0;
  2226. z-index: 999999;
  2227. }
  2228. [data-theme=dark] .listbox-new:hover {
  2229. opacity: 1;
  2230. height: calc(100vh - 290px) !important;
  2231. }
  2232. [data-theme=dark] .module-playbox-new .playbox-new .play-paction-wrap-new {
  2233. width: 100% !important;
  2234. }
  2235.  
  2236. vip-layer.kui-vip-layer-0 {
  2237. display: none !important;
  2238. }
  2239. [data-theme=dark] .play-top-container-new {
  2240. height: calc(100vh - -67px) !important;
  2241. /*height: 100vh !important;*/
  2242. }
  2243. .topheader_topheaderwrap {
  2244. min-height: 50px !important;
  2245. height: 50px !important;
  2246. }
  2247. .topheadernav_nav_box .topheadernav_nav_item {
  2248. line-height: 50px !important;
  2249. }
  2250. .topheader_top_header_box .topheader_top_box {
  2251. height: 50px !important;
  2252. }
  2253. [data-theme=dark] .l-container-new {
  2254. padding-top: 50px !important;
  2255. }
  2256. .topheader_top_header_box {
  2257. height: 50px !important;
  2258. }
  2259. .search_search_box_nav {
  2260. top: 5px !important;
  2261. }
  2262. .logo_logo_box .logo_logo_img {
  2263. margin: 14px 0 0 26px !important;
  2264. }
  2265. .logo_logo_box {
  2266. height: 50px !important;
  2267. }
  2268. .topheadernav_nav_box {
  2269. height: 50px !important;
  2270. }
  2271. .ikudownload_kuhuduan_box a {
  2272. height: 50px !important;
  2273. }
  2274. .historyrecord_urecord .historyrecord_recordicon {
  2275. height: 50px !important;
  2276. }
  2277. .vip_vip_wrap {
  2278. margin: 14px 9px 0 !important;
  2279. padding-bottom: 0px !important;
  2280. }
  2281. .usercenter_user_center_box {
  2282. margin: 4px 46px 0 9px !important;
  2283. }
  2284. #checkout_counter_popup{
  2285. display: none !important;
  2286. }
  2287. .fee-wrap-new.full-mode {
  2288. display: none;
  2289. }
  2290. /*登录(不可用)广告*/
  2291. [class="usercenter_panel usercenter_upanel "]{
  2292. display: none;
  2293. }
  2294. .search_search_box {
  2295. width: 465px;
  2296. height: 40px;
  2297. border-radius: 10px;
  2298. background-color: rgba(0,0,0,.2);
  2299. border: 1px solid hsla(0,0%,100%,.2);
  2300. position: absolute;
  2301. top: 4px;
  2302. left: 158px;
  2303. text-align: left;
  2304. -webkit-app-region: no-drag;
  2305. }
  2306. [data-theme=dark] .module-playbox-new{
  2307. height: calc(100vh - 55px) !important;
  2308. }
  2309. .fixed_bar_2rZMG {
  2310. opacity: 0 !important;
  2311. }
  2312. .historyrecord_urecord .historyrecord_panel {
  2313. top: 50px !important;
  2314. }
  2315. .ikudownload_kuhuduan_box .ikudownload_download_panel {
  2316. top: 50px !important;
  2317. }
  2318. .vip_vip_wrap .vip_vip_panel {
  2319. top: 37px !important;
  2320. }
  2321. @media (max-width: 1440px){
  2322. [data-theme=dark] .play-paction-wrap-new #player {
  2323. width: 100% !important;
  2324. height: 100% !important;
  2325. }
  2326. [data-theme=dark] .module-playbox-new {
  2327. height: calc(100vh - 55px) !important;
  2328. }
  2329. .search_search_box {
  2330. left: 285px !important;
  2331. }
  2332. }
  2333. @media (min-width: 1441px) and (max-width: 1920px){
  2334. [data-theme=dark] .play-paction-wrap-new #player {
  2335. height: calc(100vh - 60px) !important;
  2336. width: 100% !important;
  2337. }
  2338. .search_search_box {
  2339. left: 455px !important;
  2340. }
  2341. }
  2342.  
  2343.  
  2344. `
  2345.  
  2346. }
  2347. //爱奇艺主题
  2348. if (location.hostname.includes('.iqiyi.')) {
  2349. css = `
  2350. .qy-mod-img.horizon[data-v-4e909722] {
  2351. background: ${深主题色};
  2352. border-radius: 8px;
  2353. }
  2354. .qy-mod-img .qy-mod-link-wrap[data-v-4e909722], .qy-mod-img .qy-mod-link[data-v-4e909722] {
  2355. border-radius: 8px;
  2356. }
  2357. .qy-header.home2020.qy-header-fixed.qy-header--bg .header-wrap{
  2358. background-color: ${深主题色}cc;
  2359. }
  2360. .content-wrap[data-v-5baba7d6]{
  2361. background: linear-gradient(180deg,transparent,${主题色} 150px);
  2362. }
  2363. .qy20-h-carousel-wrap[data-v-e765da72], .qy20-h-carousel[data-v-e765da72]{
  2364. background: ${主题色} !important;
  2365. }
  2366. /*列表背景*/
  2367. .content-wrap[data-v-6d677a68] {
  2368. background: linear-gradient(180deg,transparent,${主题色} 150px);
  2369. }
  2370. /*轮播栏背景*/
  2371. .qy20-h-carousel {
  2372. background-color: ${主题色}!important;
  2373. }
  2374. .ch-res[data-v-bc0d88da]{
  2375. min-width: 100%;
  2376. }
  2377. .qy20-h-carousel__maskl{
  2378. background-image: linear-gradient(270deg, ${主题色} 0%, transparent) !important;
  2379. }
  2380. /*顶栏*/
  2381. .qy-header.home2020.qy-header--absolute .header-wrap{
  2382. background: linear-gradient(180deg,${主题色}c9,#ff000000 150px) !important;;
  2383. }
  2384. .qy20-h-carousel__maskr{
  2385. background-image: linear-gradient(270deg, ${主题色} 0%, transparent) !important;
  2386. }
  2387. .tl-layout[data-v-5ed27594] {
  2388. width: calc(100vw - 100px);
  2389. left: 2%;
  2390. }
  2391. /**/
  2392. .qy-mod-list .qy-mod-li[data-v-5643dd65]{
  2393. border-radius: 10px;
  2394. background: linear-gradient(180deg,#e9182600,${深主题色} 150px);
  2395. }
  2396. .card-hover-animation{
  2397. background-color: ${深主题色} !important;
  2398. }
  2399. .qy-header.home2020 .header-wrap{
  2400. background-color: ${深主题色} !important;
  2401. }
  2402. .abs[data-v-3da728c4], .side-cont[data-v-3da728c4]{
  2403. background-color: ${主题色} !important;
  2404. }
  2405. .qy-footer[data-v-48b3cf8e]{
  2406. background-color:${主题色} !important;
  2407. }
  2408. .qy-dark{
  2409. background:${主题色} !important;
  2410. }
  2411. [class="top-nav-wrap head_inner"]{
  2412. height: 55px !important;
  2413. }
  2414. class="mod_search"{
  2415. top:4px !important;
  2416. height: 40px !important;
  2417. }
  2418. .qy-app-wrap .flash-wrap {
  2419. width: 100%;
  2420. }
  2421. .side-cont[data-v-3da728c4] {
  2422. position: absolute !important;
  2423. z-index: 999 !important;
  2424. opacity: 0 !important;
  2425. height: 50% !important;
  2426. }
  2427. .side-cont.tvg:hover {
  2428. opacity: 1 !important;
  2429. height: 100% !important;
  2430. }
  2431. .btn-wrap[data-v-554b252e]{
  2432. display: none;
  2433. }
  2434. .iqp-bottom-show .iqp-bottom {
  2435. background: ${主题色} !important;
  2436. }
  2437. .fixed-box[data-v-727893da] {
  2438. position: relative;
  2439. background: #fff;
  2440. z-index: 10003;
  2441. box-sizing: border-box;
  2442. width: 480px;
  2443. height: 520px;
  2444. border-radius: 20px;
  2445. cursor: pointer;
  2446. }
  2447. `
  2448. }
  2449.  
  2450. let style = document.createElement('style');
  2451. style.textContent = css;
  2452. document.head.appendChild(style);
  2453. }
  2454. // // 主页第一个列表栏
  2455. // const parentElement = document.querySelector('[class="tl-layout"]');
  2456. // if (parentElement) {
  2457. // // 创建要添加的元素
  2458. // const newElement = document.createElement("div");
  2459. // // 设置新元素的样式
  2460. // newElement.style.position = "relative";
  2461. // newElement.style.margin = "0 auto";
  2462. // newElement.style.width = "994px";
  2463. // newElement.style.height = "20px";
  2464. // newElement.style.minWidth = "100vw";
  2465. // newElement.style.background = `linear-gradient(to bottom, #151515, ${主题色} )`;
  2466. // newElement.style.overflow = "hidden";
  2467. // newElement.style.pointerEvents = "auto";
  2468. // // 将新元素添加到父元素的后面
  2469. // parentElement.insertAdjacentElement('beforebegin', newElement);
  2470. // }
  2471. }
  2472. if (函数 === "窄版页面样式修改") {
  2473. if (localStorage.getItem('htmlbackground') === "true") {
  2474. let 主题选择 = document.querySelector('#cars');
  2475. if (主题选择) {
  2476. 主题色选择(主题选择.value);
  2477. } else {
  2478. let 主题 = "月光色";
  2479. 主题色选择(主题);
  2480. }
  2481.  
  2482. let css = `
  2483. /*视频展示背景图片框*/
  2484. .item_content {
  2485. border-radius: 9px;
  2486. }
  2487. `;
  2488. // css2=` /*顶栏背景*/
  2489. // .mod_channel .site_header {
  2490. // background: ${主题色};
  2491. // }
  2492. // /*视频预览区*/
  2493. // .mod_channel .container {
  2494. // background: ${主题色};
  2495. // }
  2496. // /*轮播栏背景*/
  2497. // .mod_channel .swiper {
  2498. // background: ${主题色};
  2499. // }
  2500. // /*轮播栏页面数提示*/
  2501. // .mod_channel .swiper-container .swiper_count {
  2502. // background: ${主题色};
  2503. // }`
  2504. var style = document.createElement('style');
  2505. style.type = 'text/css';
  2506. style.textContent = css;
  2507. document.head.appendChild(style);
  2508. }
  2509. }
  2510. if (函数 === "加载时可删除广告") {
  2511. // 顶栏的游戏广告关闭按钮
  2512. if (localStorage.getItem('advertisement') === "true") {
  2513. var quick_games = document.querySelector('.quick_item.quick_games');
  2514. if (quick_games) {
  2515. quick_games.remove();
  2516. }
  2517. 爱奇艺去广告();
  2518. }
  2519. }
  2520. if (函数 === "去除游戏栏目") {
  2521. if (localStorage.getItem('advertisement') === "true") {
  2522. removeElements();
  2523. function removeElements() {
  2524. var pauseVideos = document.querySelectorAll("._nav-item_ugz17_31");
  2525. if (pauseVideos.length > 0) {
  2526. pauseVideos.forEach(function (video) {
  2527. var span = video.querySelector('span').textContent.trim();
  2528. console.log(span);
  2529. if (span === "游戏" || span === "传奇游戏库" || span === "棋牌游戏库" || span === "游戏中心") {
  2530. video.remove();
  2531. // console.log(2, span);
  2532. }
  2533. });
  2534. }
  2535. }
  2536. var elementsWithDtCmd = document.querySelectorAll('[dt-cmd]');
  2537. // 遍历所有匹配的元素
  2538. elementsWithDtCmd.forEach(function (element) {
  2539. // 在这里对每个元素执行您的操作
  2540. var text = element.textContent.trim();
  2541. if (text === "游戏" || text === "传奇游戏库" || text === "棋牌游戏库" || text === "游戏中心") {
  2542. element.parentNode.remove();
  2543. // console.log(element);
  2544. }
  2545. });
  2546. // 顶栏的全部视频里的
  2547. var sub_nav_item = document.querySelectorAll(".sub-nav-item");
  2548. // 遍历所有匹配的元素
  2549. sub_nav_item.forEach(function (element) {
  2550. // 在这里对每个元素执行您的操作
  2551. var text = element.textContent.trim();
  2552. if (text === "游戏" || text === "传奇游戏库" || text === "棋牌游戏库" || text === "游戏中心") {
  2553. element.remove();
  2554. // console.log(element);
  2555. }
  2556. });
  2557. //顶栏上的
  2558. var nav_all_text = document.querySelectorAll(".nav-all-text");
  2559. // 遍历所有匹配的元素
  2560. nav_all_text.forEach(function (element) {
  2561. // 在这里对每个元素执行您的操作
  2562. var text = element.textContent.trim();
  2563. if (text === "游戏" || text === "传奇游戏库" || text === "棋牌游戏库" || text === "游戏中心") {
  2564. element.textContent = "体育"
  2565. console.log(element);
  2566. }
  2567. });
  2568. }
  2569. }
  2570. if (函数 === "轮播栏广告播放") {
  2571.  
  2572. }
  2573. if (函数 === "页面样式文档加载后修改") {
  2574. if (localStorage.getItem('htmlbackground') === "true") {
  2575. let 主题选择 = document.querySelector('#cars');
  2576. if (主题选择) {
  2577. 主题色选择(主题选择.value);
  2578. } else {
  2579. let 主题 = "月光色";
  2580. 主题色选择(主题);
  2581. }
  2582. if (location.hostname.includes('youku.')) {
  2583. let css = `
  2584. [data-theme=dark] body.newBg {
  2585. background: ${主题色} !important;
  2586. }
  2587. `;
  2588.  
  2589. var style = document.createElement('style');
  2590. style.textContent = css;
  2591. document.head.appendChild(style);
  2592. }
  2593. }
  2594. }
  2595. if (函数 === "轮播栏广告播放") {
  2596.  
  2597. }
  2598. if (函数 === "去除app提示") {
  2599. const open_app_bottom2 = document.querySelector('[dt-eid="open_app_bottom"]');
  2600. if (open_app_bottom2) {
  2601. open_app_bottom2.style.display = 'none'
  2602. console.log('警察蜀黍11')
  2603. }
  2604. //打开app
  2605. const openapp = document.querySelector('.site-top__open-app');
  2606. if (openapp) {
  2607. openapp.style.display = 'none'
  2608. console.log('警察蜀黍22')
  2609. }
  2610. //继续使用浏览器
  2611. const textbutton = document.querySelector('.at-app-banner--textbutton');
  2612. if (textbutton) {
  2613. textbutton.style.display = 'none'
  2614. console.log('警察蜀黍33')
  2615. }
  2616. var 花絮资讯 = document.querySelectorAll('.title')
  2617. for (let index = 0; index < 花絮资讯.length; index++) {
  2618. if (花絮资讯[index].textContent = '花絮资讯') {
  2619. 花絮资讯[index].remove()
  2620. }
  2621. }
  2622.  
  2623. var 相关视频 = document.querySelector('.bottom-wrapper')?.remove();
  2624. //var 预告视频=document.querySelector('.playlist.playlist--trival')?.remove()
  2625. var 打开看完整版 = document.querySelector('.open-app.old-open')?.remove();
  2626. //打开app播放
  2627.  
  2628. var banner = document.querySelector('.at-app-banner');
  2629. if (banner) {
  2630. banner.style.display = "none";
  2631. }
  2632.  
  2633. }
  2634. }
  2635. function 主题色选择(主题) {
  2636. if (主题 === "青色") {
  2637. 主题色 = "#083e4f";
  2638. 深主题色 = "#052935";
  2639. 浅主题色 = "#104353";
  2640. VIP主题色 = "#ffb300";
  2641. 备案字体颜色 = '#5c96a9';
  2642. 浅色字体 = '#5a8b9b';
  2643. 亮色字体 = "#1cb6e7";
  2644. 深色字体 = "#002835";
  2645. 主评论色 = '#00303f';
  2646. 评论色 = '#003f53';
  2647. 浅灰字体色 = '#5d91b8';
  2648. } else {
  2649. if (主题 === "朱金") {
  2650. 主题色 = "#9d5901";
  2651. 深主题色 = "#673b01";
  2652. 浅主题色 = "#673b01";
  2653. VIP主题色 = "#ffb300";
  2654. 备案字体颜色 = '#d18a2e';
  2655. 浅色字体 = '#5a8b9b';
  2656. 亮色字体 = "#ff9d1e";
  2657. 深色字体 = "#00210d";
  2658. 主评论色 = '#854b00';
  2659. 评论色 = '#93580c';
  2660. 浅灰字体色 = '#5d91b8';
  2661. } else {
  2662. if (主题 === "金黄色") {
  2663. 主题色 = "#ffa500";
  2664. 深主题色 = "#e59503";
  2665. 浅主题色 = "#e59503";
  2666. VIP主题色 = "#ffb300";
  2667. 备案字体颜色 = '#9d6600';
  2668. 浅色字体 = '#5a8b9b';
  2669. 亮色字体 = "#553700";
  2670. 深色字体 = "#00210d";
  2671. 评论色 = '#ffb836';
  2672. 浅灰字体色 = '#5d91b8';
  2673. } else {
  2674. if (主题 === "芒果色") {
  2675. 主题色 = "#F5CBA3";
  2676. 深主题色 = "#EB8F3B";
  2677. 浅主题色 = "#F8D8BA";
  2678. VIP主题色 = "#ffb300";
  2679. 备案字体颜色 = '#917860';
  2680. 浅色字体 = '#5a8b9b';
  2681. 亮色字体 = "#ff8c1f";
  2682. 深色字体 = "#00210d";
  2683. 评论色 = '#ffdbb8';
  2684. 浅灰字体色 = '#5d91b8';
  2685. } else {
  2686. if (主题 === "神秘森林") {
  2687. 主题色 = "#0F612F";
  2688. 深主题色 = "#0A3E1E";
  2689. 浅主题色 = "#5F9675";
  2690. VIP主题色 = "#ffb300";
  2691. 备案字体颜色 = "#8bc1a0";
  2692. 浅色字体 = '#5a8b9b';
  2693. 亮色字体 = "#1ed163";
  2694. 深色字体 = "#00210d";
  2695. 主评论色 = '#004d1e';
  2696. 评论色 = '#0e6931';
  2697. 评论线条 = '#0a5b29';
  2698. 浅灰字体色 = '#8ab29a';
  2699. } else {
  2700. if (主题 === "辣红色") {
  2701. 主题色 = "#A91721";
  2702. 深主题色 = "#6F0F15";
  2703. 浅主题色 = "#B17D81";
  2704. VIP主题色 = "#ffb300";
  2705. 备案字体颜色 = "#b5888b";
  2706. 浅色字体 = '#5a8b9b';
  2707. 亮色字体 = "#ff9116";
  2708. 深色字体 = "#00210d";
  2709. 主评论色 = '#830009';
  2710. 评论色 = '#a30d17';
  2711. 评论线条 = '#005d24';
  2712. 浅灰字体色 = '#5d91b8';
  2713. } else {
  2714. if (主题 === "月光色") {
  2715. 主题色 = "#0C4C7D";
  2716. 深主题色 = "#072B47";
  2717. 浅主题色 = "#98B3C8";
  2718. VIP主题色 = "#ffb300";
  2719. 备案字体颜色 = "#769dbb";
  2720. 浅色字体 = '#909ea9';
  2721. 主评论色 = '#033d69';
  2722. 评论色 = '#00589b';
  2723. 亮色字体 = "#ff9116";
  2724. 深色字体 = "#00210d";
  2725. 评论线条 = '#005d24';
  2726. 浅灰字体色 = '#5d91b8';
  2727. } else {
  2728. if (主题 === "春节红") {
  2729. 主题色 = "#c20f0c";
  2730. 深主题色 = "#8b0c0a";
  2731. 浅主题色 = "#98B3C8";
  2732. VIP主题色 = "#ffb300";
  2733. 备案字体颜色 = "#ff8f8d";
  2734. 浅色字体 = '#909ea9';
  2735. 主评论色 = '#033d69';
  2736. 评论色 = '#c52421';
  2737. 亮色字体 = "#ff9116";
  2738. 深色字体 = "#270100";
  2739. 评论线条 = '#005d24';
  2740. 浅灰字体色 = '#8ab29a';
  2741. } else {
  2742. if (主题 === "炎红") {
  2743. 主题色 = "#ff3300";
  2744. 深主题色 = "#bb2600";
  2745. 浅主题色 = "#ff6f4b";
  2746. VIP主题色 = "#ffb300";
  2747. 备案字体颜色 = "#ff8f8d";
  2748. 浅色字体 = '#909ea9';
  2749. 主评论色 = '#033d69';
  2750. 评论色 = '#c52421';
  2751. 亮色字体 = "#ff9116";
  2752. 深色字体 = "#270100";
  2753. 评论线条 = '#005d24';
  2754. 浅灰字体色 = '#8ab29a';
  2755. }
  2756. }
  2757. }
  2758. }
  2759. }
  2760. }
  2761. }
  2762. }
  2763. }
  2764. }
  2765. function 新窗口() {
  2766. var 页面链接 = window.location.href;
  2767. const iframeSrc = 解析站点URL + decodeURIComponent(页面链接);
  2768. document.querySelector('[class="video-item-episode video-item-episode--active video-item-episode--num playlist__item"]')?.textContent
  2769. window.open(iframeSrc);
  2770. console.log('播放器框架2');
  2771. let 播放器 = document.querySelectorAll('video')
  2772. for (let index = 0; index < 播放器.length; index++) {
  2773. 播放器[index].pause();
  2774. 播放器[index].remove();
  2775. }
  2776. }
  2777.  
  2778. function 覆盖按钮(需覆盖按钮) {
  2779. // 找到body下第一个span元素
  2780. //var firstSpan = document.querySelector('[class="c-album-item selected"]');
  2781. var firstSpan = 需覆盖按钮
  2782. // 创建一个透明的覆盖层
  2783. var overlay = document.createElement('div');
  2784. overlay.style.position = 'absolute';
  2785. overlay.className = '覆盖按钮';
  2786. overlay.style.top = '0';
  2787. overlay.style.left = '0';
  2788. overlay.style.width = '100%';
  2789. overlay.style.height = '100%';
  2790. overlay.style.background = 'transparent';
  2791. overlay.style.zIndex = '9999';
  2792. 新窗口()
  2793. // 绑定点击事件到覆盖层
  2794. overlay.addEventListener('click', function (event) {
  2795. event.stopPropagation(); // 阻止事件冒泡
  2796. event.preventDefault(); // 阻止默认行为
  2797. // 在这里可以添加您希望执行的代码
  2798. });
  2799. // 将覆盖层添加到第一个span元素上面
  2800. firstSpan.style.position = 'relative';
  2801. firstSpan.style.zIndex = '9999';
  2802. firstSpan.appendChild(overlay);
  2803. }
  2804. function 更新页面URL(url) {
  2805. window.history.pushState(null, null, url);
  2806.  
  2807. }
  2808. }
  2809.  
  2810. if (location.href.includes('.xmflv.') || location.href.includes('im1907.')||location.href.includes('yangtu.')||location.href.includes('jsonplayer.')) {
  2811.  
  2812. var cid;
  2813. var 当前VID;
  2814. var 当前标题 = '酷炫解析';
  2815. var 阻止弹出新页面 = true;
  2816. var 恢复播放 = eval(localStorage.getItem('恢复播放'));
  2817. var 工具条;
  2818. //先执行判断离开页面时,是否阻断,避免跳入广告网站
  2819. 页面关闭监测();
  2820. localStorage.setItem('ICOcVk', new Date().getTime())
  2821. localStorage.setItem('ICOcVk_2', 1)
  2822. 样式创建();
  2823. if (window.location.hostname.includes('xmflv.com')) {
  2824. var 解析域名 = 'https://jx.xmflv.com/?url='
  2825. } else {
  2826. 解析域名 = 'https://jx.xmflv.cc/?url='
  2827. }
  2828. 判断是否是手机设备();
  2829.  
  2830. 解析网站广告();
  2831. let 播放按钮 = document.querySelector('[class="art-icon art-icon-play"]')
  2832. if (播放按钮) {
  2833. if (播放按钮.style.display === 'none') {
  2834. if (document.querySelector('[class="art-icon art-icon-pause"]')) {
  2835. } document.querySelector('[class="art-icon art-icon-pause"]').click()
  2836. }
  2837. }
  2838. 创建视频列表主程序();
  2839. 判断视频组件加载();
  2840. 解析网站广告();
  2841. 监测解析网站全屏状态();
  2842. function 判断视频组件加载() {
  2843. var intervalId = setInterval(function () {
  2844. var video = document.querySelector('video');
  2845. if (video) {
  2846. 工具条 = 取工具条();
  2847. console.dir(工具条);
  2848. clearInterval(intervalId);
  2849. 监测播放状态();
  2850. 解析站创建主设置组件();
  2851. 判断历史记录();
  2852. // 创建下一集按钮();
  2853. 工具条.appendChild(添加辅助功能());
  2854. 弹幕按钮状态();
  2855. 绑定热键();
  2856. 创建隐藏工具条按钮();
  2857. // 添加用户交互,例如点击按钮来触发视频播放
  2858. 工具条.addEventListener('click', function() {
  2859. if (恢复播放 === true && video.paused) {
  2860. video.play().catch(function(error) {
  2861. console.error('播放失败:', error);
  2862. });
  2863. }
  2864. });
  2865. }
  2866. }, 1000);
  2867. }
  2868. function 取工具条() {
  2869. 工具条 = document.querySelector(".art-controls");
  2870. if (!工具条) {
  2871. 工具条 = document.querySelector("#s-controls");
  2872. }
  2873. return 工具条;
  2874. }
  2875. function 创建视频列表主程序() {
  2876. (function () {
  2877. 'use strict';
  2878. var 解析地址 = decodeURIComponent(window.location.search);
  2879. var cid;
  2880. var vid;
  2881. // 使用正则表达式匹配cid=之后的字母数字部分
  2882. if (解析地址.includes('v.qq.')) {
  2883. let match = 解析地址.match(/cid=([\w]+)&vid=([\w]+)/);
  2884. if (match ? match[2] : '') {
  2885. cid = match[1];
  2886. vid = match[2];
  2887. 取腾讯视频列表(cid, vid);
  2888. } else {
  2889. match = 解析地址.match(/cover\/([\w]+)\/([\w]+)/);
  2890. if (match ? match[2] : '') {
  2891. cid = match[1];
  2892. vid = match[2];
  2893. 取腾讯视频列表(cid, vid);
  2894. }
  2895. }
  2896. } else {
  2897. if (解析地址.includes('.iqiyi.')) {
  2898. let match = 解析地址.match(/com\/([\w]+)/);
  2899. if (match ? match[1] : '') {
  2900. vid = match[1];
  2901. 取爱奇艺视频主页JSON_GM(match[1]);
  2902. } else {
  2903. match = 解析地址.match(/cover\/([\w]+)/);
  2904. if (match) {
  2905. vid = match[1];
  2906. 取爱奇艺视频主页JSON_GM(vid);
  2907. }
  2908. }
  2909. } else {
  2910. if (解析地址.includes('youku.')) {
  2911. let match = 解析地址.match(/id_(.*?)\.html/);
  2912. if (match ? match[1] : '') {
  2913. vid = match[1];
  2914. 取优酷视频列表_GM(match[1]);
  2915. }
  2916. }
  2917. }
  2918. }
  2919.  
  2920. function 取腾讯视频列表(cid, vid) {
  2921. let 缓存剧集JSON = JSON.parse(localStorage.getItem('腾讯剧集JSON'))
  2922. if (缓存剧集JSON) {
  2923. if (缓存剧集JSON.cid === cid && 缓存剧集JSON.获取时间 === 取当日时间戳()) {
  2924. 缓存剧集JSON.vid = vid;
  2925. 创建视频列表(缓存剧集JSON)
  2926. return;
  2927. }
  2928. }
  2929. var page_context;
  2930. var 页数 = 0;
  2931. var 总页数;
  2932. var jsondata = {
  2933. "page_params": {
  2934. "req_from": "web_vsite",
  2935. "page_id": "vsite_episode_list",
  2936. "page_type": "detail_operation",
  2937. "id_type": "1",
  2938. "page_size": "",
  2939. "cid": "",
  2940. "vid": "",
  2941. "lid": "",
  2942. "page_num": "",
  2943. "page_context": "",
  2944. "detail_page_type": "1"
  2945. },
  2946. "has_cache": 1
  2947. };
  2948. jsondata.page_params.cid = cid;
  2949. jsondata.page_params.vid = vid;
  2950. var 剧集JSON = {};
  2951. 剧集JSON.列表 = [];
  2952. 剧集JSON.vid = vid;
  2953. function 发送请求() {
  2954. console.log('JSON数据', JSON.stringify(jsondata))
  2955. GM_xmlhttpRequest({
  2956. method: 'POST',
  2957. url: 'https://pbaccess.video.qq.com/trpc.universal_backend_service.page_server_rpc.PageServer/GetPageData?video_appid=3000010&vplatform=2&vversion_name=8.2.96',
  2958. data: JSON.stringify(jsondata),
  2959. headers: {
  2960. 'Content-Type': 'application/json',
  2961. 'accept': 'application/json, text/plain, */*',
  2962. 'accept-language': 'zh-CN,zh;q=0.9',
  2963. 'origin': 'https://v.qq.com',
  2964. 'referer': 'https://v.qq.com/',
  2965. 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102"',
  2966. 'sec-ch-ua-mobile': '?0',
  2967. 'sec-ch-ua-platform': '"Windows"',
  2968. 'sec-fetch-dest': 'empty',
  2969. 'sec-fetch-mode': 'cors',
  2970. 'sec-fetch-site': 'same-site',
  2971. 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36'
  2972. },
  2973. onload: function (response) {
  2974. // 处理响应
  2975. let 返回文本 = JSON.parse(response.responseText);
  2976. let post页数列表 = 返回文本.data.module_list_datas[0].module_datas[0].module_params.tabs;
  2977. let 视频列表 = 返回文本.data.module_list_datas[0].module_datas[0].item_data_lists.item_datas
  2978. for (let index = 0; index < 视频列表.length; index++) {
  2979. if (视频列表[index].item_params.union_title != '' && 视频列表[index].item_params.is_trailer === '0') {
  2980. let json = {
  2981. 集数: 剧集JSON.列表.length + 1,
  2982. cid: cid,
  2983. vid: 视频列表[index].item_params.vid,
  2984. play_title: 视频列表[index].item_params.play_title,
  2985. url: 解析域名 + 'https://m.v.qq.com/x/m/play?cid=' + cid + '&vid=' + 视频列表[index].item_params.vid
  2986. }
  2987. 剧集JSON.列表.push(json)
  2988. }
  2989. }
  2990. if (post页数列表) {
  2991. 总页数 = JSON.parse(post页数列表);
  2992. } else {
  2993. 总页数 = []
  2994. }
  2995.  
  2996. 页数++;
  2997. if (页数 < 总页数.length) {
  2998. //page_context = URL参数转POST(总页数[页数].page_context);
  2999. page_context = 总页数[页数].page_context;
  3000. jsondata.page_params.cid = cid;
  3001. jsondata.page_params.page_context = page_context;
  3002. console.log(页数, page_context, jsondata);
  3003. // 继续发送请求
  3004. 发送请求();
  3005. } else {
  3006. // 所有页数都已获取,退出循环
  3007. console.log(剧集JSON)
  3008. console.log('所有页数已获取');
  3009. 剧集JSON.cid = cid;
  3010. 创建视频列表(剧集JSON)
  3011. 剧集JSON.获取时间 = 取当日时间戳();
  3012. localStorage.setItem('腾讯剧集JSON', JSON.stringify(剧集JSON))
  3013. }
  3014.  
  3015. },
  3016. onerror: function (error) {
  3017. alert(error);
  3018. }
  3019. });
  3020. }
  3021.  
  3022.  
  3023. // 开始第一次请求
  3024. 发送请求();
  3025. }
  3026. function 取爱奇艺视频列表_GM(cid, vid) {
  3027. let 缓存剧集JSON = JSON.parse(localStorage.getItem('爱奇艺剧集JSON'))
  3028. if (缓存剧集JSON) {
  3029. if (缓存剧集JSON.cid === cid && 缓存剧集JSON.获取时间 === 取当日时间戳()) {
  3030. 缓存剧集JSON.vid = vid
  3031. 创建视频列表(缓存剧集JSON)
  3032.  
  3033. return;
  3034. }
  3035. }
  3036. var 剧集JSON = {}
  3037. 剧集JSON.列表 = [];
  3038. 剧集JSON.页数 = 1;
  3039. 剧集JSON.cid = cid;
  3040. 剧集JSON.vid = vid;
  3041. function 发送请求() {
  3042. console.log('发送请求');
  3043. GM_xmlhttpRequest({
  3044. method: 'GET',
  3045. url: `https://pub.m.iqiyi.com/h5/main/videoList/album/?albumId=${cid}&size=50&page=${剧集JSON.页数}&needPrevue=true&needVipPrevue=true`,
  3046. headers: {
  3047. 'authority': 'pub.m.iqiyi.com',
  3048. 'accept': '*/*',
  3049. 'accept-language': 'zh-CN,zh;q=0.9',
  3050. 'sec-ch-ua': '"Not A;Brand";v="99", "Chromium";v="102"',
  3051. 'sec-ch-ua-mobile': '?0',
  3052. 'sec-ch-ua-platform': '"Windows"',
  3053. 'sec-fetch-dest': 'empty',
  3054. 'sec-fetch-mode': 'cors',
  3055. 'sec-fetch-site': 'same-site',
  3056. 'user-agent': 'jdapp;android;8.3.5;9.3.7;;network/wifi;model/Mi Note 2;osVer/26;appBuild/71043;psn/|7;psq/1;uid/;adk/;ads/;pap/JA2015_311210|8.4.2|ANDROID 8.0.0;osv/8.0.0;pv/2.23;jdv/;ref/com.jingdong.app.mall.WebActivity;partner/huawei;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 8.0.0; Mi Note 2 Build/OPR1.170623.032; wv)) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36'
  3057. },
  3058. onload: function (response) {
  3059. // 处理响应
  3060. if (爱奇艺视频列表数据处理(cid, JSON.parse(response.responseText), 剧集JSON)) {
  3061. 发送请求()
  3062. }
  3063. },
  3064. onerror: function (error) {
  3065. console.error(error);
  3066. }
  3067. });
  3068. }
  3069.  
  3070. // 开始第一次请求
  3071. 发送请求();
  3072. }
  3073. function 取优酷视频列表_GM(cid) {
  3074. let 缓存剧集JSON = JSON.parse(localStorage.getItem('优酷剧集JSON'))
  3075. if (缓存剧集JSON) {
  3076. if (缓存剧集JSON.cid === cid && 缓存剧集JSON.获取时间 === 取当日时间戳()) {
  3077. 缓存剧集JSON.vid = vid
  3078. 创建视频列表(缓存剧集JSON)
  3079. return;
  3080. }
  3081. }
  3082. 加载腾讯cookie()
  3083. var 剧集JSON = {}
  3084. 剧集JSON.列表 = [];
  3085. 剧集JSON.页数 = 1;
  3086. 剧集JSON.cid = cid;
  3087. 剧集JSON.vid = vid;
  3088. function 发送请求() {
  3089. console.log('发送请求');
  3090. GM_xmlhttpRequest({
  3091. method: 'GET',
  3092. url: `https://m.youku.com/video/id_${剧集JSON.cid}.html`,
  3093. headers: {
  3094. 'user-agent': ' Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Mobile Safari/537.36'
  3095. },
  3096. onloadstart: function (response) {
  3097. console.log('请求开始', response);
  3098. },
  3099. onload: function (response) {
  3100. // 处理响应
  3101. let 响应json = response.responseText.match(/window.__INITIAL_DATA__ =(.+?);window.__PLATOCONFIG__ =/)[1];
  3102. if (响应json) {
  3103. console.dir(JSON.parse(响应json))
  3104.  
  3105. }
  3106. if (优酷视频数据处理(剧集JSON.cid, response.responseText, 剧集JSON)) {
  3107. 发送请求()
  3108. }
  3109.  
  3110. },
  3111. onerror: function (error) {
  3112. console.error(error);
  3113. }
  3114. });
  3115. }
  3116.  
  3117. // 开始第一次请求
  3118. 发送请求();
  3119. }
  3120. function 加载腾讯cookie() {
  3121. var cookieDomain = "xmflv.com";
  3122. // 设置cookie字符串
  3123. var cookieStr = 'x5sec=7b22617365727665722d686579693b32223a226663383030616662316364303762656165313337636439383361323663633366434b4b7679617747454b2f4c375a37382f2f2f2f2f774577676f48777a766a2f2f2f2f2f41513d3d222c22733b32223a2261343236396338303436613431336364227d;';
  3124. if (cookieStr) {
  3125. // 分割cookie字符串
  3126. if (cookieStr.trim() !== "") {
  3127. var cookies = cookieStr.split(";");
  3128. if (cookies.length > 0) {
  3129. // 遍历每个cookie,并设置为对应的键值对
  3130. cookies.forEach(function (cookie) {
  3131. var keyValue = cookie.trim().split("=");
  3132. var key = keyValue[0];
  3133. var value = keyValue[1];
  3134. // 设置cookie
  3135. document.cookie = key + "=" + encodeURIComponent(value) + "; domain=" + cookieDomain + "; path=/;";
  3136. });
  3137. } else {
  3138. showToast("请不包含有cookie信息。");
  3139. }
  3140. } else {
  3141. showToast("请填写cookie信息。");
  3142. }
  3143. } else {
  3144. showToast("编辑框元素丢失了。");
  3145. }
  3146.  
  3147. }
  3148. function 优酷视频数据处理(vid, data, 剧集JSON) {
  3149. let 返回JSON = data.match(/window.__INITIAL_DATA__ =(.+?);window.__PLATOCONFIG__ =/)[1];
  3150. if (返回JSON !== null) {
  3151. 返回JSON = JSON.parse(返回JSON);
  3152. let 视频列表路径;
  3153. for (let index = 0; index < 返回JSON.componentList.length; index++) {
  3154. if (返回JSON.componentList[index].componentName === '播放页选集') {
  3155. 视频列表路径 = 返回JSON.componentList[index].dataNode;
  3156. } else {
  3157. }
  3158. }
  3159. // if(parseInt(视频列表路径[0].data.stage)!=1){
  3160. // 剧集JSON.cid = 视频列表路径[0].data.action.value;
  3161. // return true;
  3162. // }
  3163. for (let index = 0; index < 视频列表路径.length; index++) {
  3164. let 片子类型 = 视频列表路径[index].data.videoType
  3165. if (片子类型 === '正片') {
  3166. var isExist = 剧集JSON.列表.find(function (item) {
  3167. return item.vid === 视频列表路径[index].data.action.value;
  3168. });
  3169. // 如果不存在相同的cid和vid,则进行插入操作
  3170. if (!isExist) {
  3171. var json = {
  3172. 集数: 视频列表路径[index].data.stage,
  3173. cid: vid,
  3174. stage: 视频列表路径[index].data.stage,
  3175. vid: 视频列表路径[index].data.action.value,
  3176. play_title: `${返回JSON.videoMap.showName}_${视频列表路径[index].data.stage}_${视频列表路径[index].data.title}`,
  3177. url: 解析域名 + `https://v.youku.com/v_show/id_${视频列表路径[index].data.action.value}.html`
  3178. };
  3179. 剧集JSON.列表.push(json);
  3180. }
  3181. }
  3182. }
  3183.  
  3184. let 最后一集 = 返回JSON.videoMap.episodeLast;
  3185. if (parseInt(json.stage) === parseInt(最后一集)) {
  3186. console.dir('所有页数已获取', 剧集JSON)
  3187. 剧集JSON.cid = cid;
  3188. 剧集JSON.获取时间 = 取当日时间戳();
  3189. localStorage.setItem('优酷剧集JSON', JSON.stringify(剧集JSON))
  3190. 创建视频列表(剧集JSON)
  3191. return false;
  3192. } else {
  3193. 剧集JSON.cid = json.vid;
  3194. return true;
  3195. }
  3196. }
  3197. }
  3198. function 爱奇艺视频列表数据处理(cid, data, 剧集JSON) {
  3199. if (data.data?.videos) {
  3200. var 返回文本 = data;
  3201. let 视频列表 = 返回文本.data?.videos
  3202. console.log(返回文本, 视频列表)
  3203. for (let index = 0; index < 视频列表.length; index++) {
  3204. if (视频列表[index].type === 1) {
  3205. let json = {
  3206. 集数: 剧集JSON.列表.length + 1,
  3207. cid: cid,
  3208. vid: 视频列表[index].pageUrl.match(/com\/([\w]+)/)[1],
  3209. play_title: 视频列表[index].shortTitle,
  3210. url: 解析域名 + 视频列表[index].pageUrl
  3211. }
  3212. 剧集JSON.列表.push(json)
  3213. }
  3214. }
  3215. 剧集JSON.页数++;
  3216. return true;
  3217. } else {
  3218. // 所有页数都已获取,退出循环
  3219. console.log(剧集JSON)
  3220. console.log('所有页数已获取');
  3221. 创建视频列表(剧集JSON)
  3222. 剧集JSON.获取时间 = 取当日时间戳();
  3223. localStorage.setItem('爱奇艺剧集JSON', JSON.stringify(剧集JSON))
  3224. return false;
  3225. }
  3226. }
  3227.  
  3228.  
  3229. function 取腾讯视频列表_废弃(cid, vid) {
  3230. let 缓存剧集JSON = JSON.parse(localStorage.getItem('腾讯剧集JSON'))
  3231. if (缓存剧集JSON) {
  3232. if (缓存剧集JSON.cid === cid && 缓存剧集JSON.获取时间 === 取当日时间戳()) {
  3233. 缓存剧集JSON.vid = vid;
  3234. 创建视频列表(缓存剧集JSON)
  3235. return;
  3236. }
  3237. }
  3238. var page_context;
  3239. var 页数 = 0;
  3240. var 总页数;
  3241. var jsondata = { "page_params": { "req_from": "web_mobile", "page_id": "vsite_episode_list", "page_type": "detail_operation", "id_type": "1", "cid": "omcczahf3t2sye4", "vid": "y0019zkakfv", "lid": "", "page_size": "50" }, "has_cache": 1 };
  3242. jsondata.page_params.cid = cid;
  3243. jsondata.page_params.vid = vid;
  3244. var 剧集JSON = {};
  3245. 剧集JSON.列表 = [];
  3246. 剧集JSON.vid = vid;
  3247. function 发送请求() {
  3248. console.log('JSON数据', JSON.stringify(jsondata))
  3249. GM_xmlhttpRequest({
  3250. method: 'POST',
  3251. url: 'https://pbaccess.video.qq.com/trpc.universal_backend_service.page_server_rpc.PageServer/GetPageData?video_appid=1200029&vplatform=2',
  3252. data: JSON.stringify(jsondata),
  3253. headers: {
  3254. 'Accept': 'application/json, text/plain, */*',
  3255. 'Accept-Encoding': 'gzip, deflate, br',
  3256. 'Accept-Language': 'zh-CN,zh;q=0.9',
  3257. 'Content-Type': 'application/json;charset=UTF-8',
  3258. 'Cookie': 'pgv_pvid=99f2863be9515d54; video_omgid=e05169a47f71dc12a87a4ec66d385f9e; vversion_name=8.5.50; _qimei_uuid42=17c1907091b1002cb915a0513ccfc4d871a0a846d1; video_platform=2',
  3259. 'Origin': 'https://m.v.qq.com',
  3260. 'Referer': 'https://m.v.qq.com/',
  3261. 'Sec-Fetch-Dest': 'empty',
  3262. 'Sec-Fetch-Mode': 'cors',
  3263. 'Sec-Fetch-Site': 'same-site',
  3264. 'User-Agent': 'jdapp;android;8.3.5;9.3.7;;network/wifi;model/Mi Note 2;osVer/26;appBuild/71043;psn/|7;psq/1;uid/;adk/;ads/;pap/JA2015_311210|8.4.2|ANDROID 8.0.0;osv/8.0.0;pv/2.23;jdv/;ref/com.jingdong.app.mall.WebActivity;partner/huawei;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 8.0.0; Mi Note 2 Build/OPR1.170623.032; wv)) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36'
  3265. },
  3266. onload: function (response) {
  3267. // 处理响应
  3268. let 返回文本 = JSON.parse(response.responseText);
  3269. let post页数列表 = 返回文本.data.module_list_datas[0].module_datas[0].module_params.tabs;
  3270. let 视频列表 = 返回文本.data.module_list_datas[0].module_datas[0].item_data_lists.item_datas
  3271. for (let index = 0; index < 视频列表.length; index++) {
  3272. if (视频列表[index].item_params.union_title != '' && 视频列表[index].item_params.is_trailer === '0') {
  3273. let json = {
  3274. cid: cid,
  3275. vid: 视频列表[index].item_params.vid,
  3276. play_title: 视频列表[index].item_params.play_title,
  3277. url: 解析域名 + 'https://m.v.qq.com/x/m/play?cid=' + cid + '&vid=' + 视频列表[index].item_params.vid
  3278. }
  3279. 剧集JSON.列表.push(json)
  3280. }
  3281. }
  3282. 总页数 = JSON.parse(post页数列表);
  3283. 页数++;
  3284. if (页数 < 总页数.length) {
  3285. //page_context = URL参数转POST(总页数[页数].page_context);
  3286. page_context = 总页数[页数].page_context;
  3287. jsondata.page_params.cid = cid;
  3288. jsondata.page_params.page_context = page_context;
  3289. console.log(页数, page_context, jsondata);
  3290. // 继续发送请求
  3291. 发送请求();
  3292. } else {
  3293. // 所有页数都已获取,退出循环
  3294. console.log(剧集JSON)
  3295. console.log('所有页数已获取');
  3296. 剧集JSON.cid = cid;
  3297. 创建视频列表(剧集JSON)
  3298. 剧集JSON.获取时间 = 取当日时间戳();
  3299. localStorage.setItem('腾讯剧集JSON', JSON.stringify(剧集JSON))
  3300. }
  3301.  
  3302. },
  3303. onerror: function (error) {
  3304. console.error(error);
  3305. }
  3306. });
  3307. }
  3308.  
  3309.  
  3310. // 开始第一次请求
  3311. 发送请求();
  3312. }
  3313. //创建爱奇艺视频列表(JS)
  3314.  
  3315. function 取爱奇艺视频主页JSON_GM(vid) {
  3316. var page_context;
  3317. var 页数 = 0;
  3318. var 总页数;
  3319.  
  3320. function 发送请求() {
  3321. console.log('发送请求');
  3322. GM_xmlhttpRequest({
  3323. method: 'GET',
  3324. url: `https://www.iqiyi.com/${vid}.html`,
  3325. headers: {
  3326. 'authority': ' m.iqiyi.com',
  3327. 'accept': ' text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
  3328. 'accept-language': 'zh-CN,zh;q=0.9',
  3329. 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102"',
  3330. 'sec-ch-ua-mobile': '?0',
  3331. 'sec-ch-ua-platform': '"Windows"',
  3332. 'sec-fetch-dest': 'empty',
  3333. 'sec-fetch-mode': 'cors',
  3334. 'sec-fetch-site': 'same-site',
  3335. 'user-agent': 'jdapp;android;8.3.5;9.3.7;;network/wifi;model/Mi Note 2;osVer/26;appBuild/71043;psn/|7;psq/1;uid/;adk/;ads/;pap/JA2015_311210|8.4.2|ANDROID 8.0.0;osv/8.0.0;pv/2.23;jdv/;ref/com.jingdong.app.mall.WebActivity;partner/huawei;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 8.0.0; Mi Note 2 Build/OPR1.170623.032; wv)) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36'
  3336. },
  3337. onload: function (response) {
  3338. // 处理响应 ;
  3339. var match = response.responseText.match(/albumId":(\d+)/);
  3340. if (match ? match[1] : '') {
  3341. 取爱奇艺视频列表_GM(match[1], vid);
  3342. }
  3343. },
  3344. onerror: function (error) {
  3345. console.error(error);
  3346. }
  3347. });
  3348. }
  3349.  
  3350. // 开始第一次请求
  3351. 发送请求();
  3352. }
  3353. })();
  3354. }
  3355. function 设置元素置顶位置(元素) {
  3356.  
  3357.  
  3358. }
  3359. function 创建隐藏工具条按钮() {
  3360. document.querySelector('.隐藏')?.remove();
  3361. var 隐藏 = document.createElement('div');
  3362. 隐藏.className = '隐藏';
  3363. 隐藏.textContent = '隐藏';
  3364. 隐藏.style.borderRadius = '2px';
  3365. if (判断是否是手机设备()) {
  3366. 隐藏.style.bottom = '70px';
  3367. } else {
  3368. var viewportHeight = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0);
  3369. var calculatedValue = -1 * viewportHeight + 50;
  3370. 隐藏.style.top = calculatedValue + 'px';
  3371. }
  3372.  
  3373. 隐藏.addEventListener('click', function (event) {
  3374. event.stopPropagation(); // 阻止事件冒泡
  3375. event.preventDefault(); // 阻止默认行为
  3376. if (document.querySelector("#xmflv > div")) {
  3377. document.querySelector("#xmflv > div").className = 'art-video-player art-subtitle-show art-layer-show art-backdrop art-mobile art-hide-cursor';
  3378. }
  3379.  
  3380. })
  3381. document.querySelector('[class="art-controls"]').appendChild(隐藏);
  3382. let css = `
  3383. .隐藏{
  3384. display: flex;
  3385. line-height: 20px;
  3386. color: black;
  3387. position: absolute;
  3388. right: 10px;
  3389. background: blanchedalmond;
  3390. width: 40px;
  3391. height: 20px;
  3392. z-index: 999;
  3393. justify-content: center;
  3394. }
  3395. .隐藏:hover{
  3396. background: #00aeec;
  3397. }
  3398. .隐藏:active{
  3399. background: #ff8100;
  3400. }
  3401. `
  3402. let css样式 = document.createElement('style');
  3403. css样式.textContent = css;
  3404. document.head.appendChild(css样式);
  3405. }
  3406. function 弹幕按钮状态() {
  3407. let 弹幕开关 = document.querySelector('[class="art-icon art-icon-danmu-on"]');
  3408. if (弹幕开关) {
  3409. if (localStorage.getItem('弹幕开关') === 'true') {
  3410. if (弹幕开关.style.display === 'none') {
  3411. 弹幕开关.click();
  3412. }
  3413. } else {
  3414. if (弹幕开关.style.display != 'none') {
  3415. 弹幕开关.click();
  3416. }
  3417. }
  3418. }
  3419. }
  3420. function 判断历史记录() {
  3421. let 未登录(不可用) = document.querySelector('[class="record__unlogin __web-inspector-hide-shortcut__"]')
  3422. if (未登录(不可用)) {
  3423. 未登录(不可用).remove()
  3424. let 历史记录 = localStorage.getItem('历史记录')
  3425. if (!历史记录) {
  3426. 历史记录 = [];
  3427. }
  3428. let js = {
  3429. 标题: document.title,
  3430. url: location.href,
  3431. 日期: 取当前时间()
  3432. }
  3433. 历史记录.push(js)
  3434.  
  3435. }
  3436. }
  3437.  
  3438.  
  3439. function 创建下一集按钮() {
  3440. // 创建 div 元素
  3441. if (document.querySelector('[class="art-control art-control-btn-next hint--rounded hint--top"]')) {
  3442. return;
  3443. }
  3444. document.querySelector('.art-control.art-control-btn-next.hint--rounded.hint--top')?.remove();
  3445. var div = document.createElement('div');
  3446. // 添加 class 属性
  3447. div.className = 'art-control art-control-btn-next hint--rounded hint--top';
  3448. // 添加 data-index 和 aria-label 属性
  3449. div.setAttribute('data-index', '25');
  3450. div.setAttribute('aria-label', '下一集');
  3451. // 创建 svg 元素
  3452. var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
  3453. svg.setAttribute('t', '1683908412710');
  3454. svg.setAttribute('class', 'icon');
  3455. svg.setAttribute('viewBox', '0 0 1024 1024');
  3456. svg.setAttribute('version', '1.1');
  3457. svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
  3458. svg.setAttribute('p-id', '1649');
  3459. svg.setAttribute('width', '32');
  3460. svg.setAttribute('height', '32');
  3461. // 创建 path 元素
  3462. var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
  3463. path.setAttribute('d', 'M665.47 417.65l-345.03-244.3c-69.8-49.42-166.29 0.49-166.29 86.01v502.27c0 85.52 96.49 135.43 166.29 86.01l345.03-244.31c64.02-45.34 64.02-140.34 0-185.68zM811.82 868.52c-30.38 0-55-24.62-55-55V207.46c0-30.38 24.62-55 55-55s55 24.62 55 55v606.07c0 30.37-24.62 54.99-55 54.99z');
  3464. path.setAttribute('p-id', '1650');
  3465. path.setAttribute('fill', '#ffffff');
  3466. // 将 path 元素添加到 svg 元素中
  3467. svg.appendChild(path);
  3468. // 将 svg 元素添加到 div 元素中
  3469. div.appendChild(svg);
  3470. div.addEventListener('click', function (event) {
  3471. event.stopPropagation(); // 阻止事件冒泡
  3472. event.preventDefault(); // 阻止默认行为
  3473. 点击下一集(document.querySelector('video'))
  3474. })
  3475. // 将创建的 div 元素添加到音量按钮后面
  3476. var count = 0;
  3477. var timeoutId = setTimeout(function checkVolumeControl() {
  3478. var volumeControl = document.querySelector('[class="art-control art-control-volume"]');
  3479. if (volumeControl) {
  3480. // 添加元素的逻辑
  3481. volumeControl.insertAdjacentElement('afterend', div);
  3482. clearTimeout(timeoutId); // 满足条件后停止 setTimeout
  3483. } else {
  3484. count++;
  3485. if (count < 5) {
  3486. setTimeout(checkVolumeControl, 1000);
  3487. }
  3488. }
  3489. }, 0);
  3490.  
  3491. }
  3492.  
  3493. document.title = 当前标题;
  3494. console.log("页面已经激活");
  3495. // 在这里执行你需要的操作
  3496. let intervalId = setInterval(function () {
  3497. document.title = 当前标题;
  3498. }, 1000); // 每秒更改一次标题
  3499.  
  3500.  
  3501. function 当前剧集(VID) {
  3502. 当前VID = VID;
  3503. let 剧集列表 = document.querySelectorAll('.视频剧集列表')
  3504. for (let i = 0; i < 剧集列表.length; i++) {
  3505. let 剧集 = 剧集列表[i].querySelectorAll('.视频剧集')
  3506. for (let index = 0; index < 剧集.length; index++) {
  3507. if (剧集[index].getAttribute('VID') === VID) {
  3508. 切换视频剧集列表(i + 1)
  3509. 剧集[index].style.background = 'green';
  3510. 剧集列表[i].scrollTop = 剧集[index].offsetTop - 剧集[index].offsetHeight - 30
  3511. 当前标题 = 剧集[index].getAttribute('剧集名');
  3512. document.title = 当前标题
  3513. break;
  3514. }
  3515. }
  3516.  
  3517. }
  3518. }
  3519. async function 剧集盒子创建() {
  3520. document.querySelector('.剧集盒子')?.remove();
  3521. let 剧集盒子 = document.createElement('div');
  3522. 剧集盒子.className = '剧集盒子';
  3523. 剧集盒子.style.borderRadius = '12px';
  3524. 剧集盒子.style.background = 'rgb(0 0 0 / 50%)';
  3525. if (判断是否是手机设备()) {
  3526. 剧集盒子.style.left = '10px';
  3527. 剧集盒子.style.height = '280px';
  3528. } else {
  3529. 剧集盒子.style.left = 'calc(100vw - 295px)';
  3530. 剧集盒子.style.height = '310px';
  3531. }
  3532. 剧集盒子.style.position = 'absolute';
  3533. 剧集盒子.style.width = '290px';
  3534. 剧集盒子.style.bottom = '70px';
  3535. 剧集盒子.style.zIndex = '999';
  3536. 剧集盒子.style.display = 'none';
  3537. // 构造一个 Promise 对象来检查目标元素是否存在
  3538. const 工具条检查 = new Promise((resolve, reject) => {
  3539. let 检查次数 = 0;
  3540. const 检查间隔 = setInterval(() => {
  3541. const 工具条 = document.querySelector('[class="art-controls"]');
  3542. if (工具条) {
  3543. clearInterval(检查间隔);
  3544. resolve(工具条);
  3545. } else {
  3546. 检查次数++;
  3547. if (检查次数 > 100) {
  3548. clearInterval(检查间隔);
  3549. reject(new Error('无法找到目标元素'));
  3550. }
  3551. }
  3552. }, 100);
  3553. });
  3554. // 等待目标元素被添加到文档中
  3555. try {
  3556. const 工具条 = await 工具条检查;
  3557. 工具条.appendChild(剧集盒子);
  3558. 剧集盒子点击判断(剧集盒子);
  3559. return 剧集盒子;
  3560. } catch (error) {
  3561. console.error(error);
  3562. }
  3563. }
  3564. function 视频剧集列表创建(剧集盒子, 集数) {
  3565. let 视频剧集列表 = document.createElement('div');
  3566. 视频剧集列表.className = '视频剧集列表';
  3567. 视频剧集列表.style.width = '100%';
  3568. 视频剧集列表.style.height = 'calc(100% - 60px)';
  3569. 视频剧集列表.style.display = 'flex';
  3570. 视频剧集列表.style.flexWrap = 'wrap';
  3571. 视频剧集列表.style.overflowY = 'auto';
  3572. 视频剧集列表.style.borderRadius = '0px 0px 12px 12px';
  3573. 视频剧集列表.style.alignContent = 'flex-start';
  3574. 视频剧集列表.setAttribute('集数', 集数)
  3575. 剧集盒子.appendChild(视频剧集列表);
  3576. return 视频剧集列表;
  3577. }
  3578. function 样式创建() {
  3579. let css = `
  3580. ..art-bottom .art-progress .art-control-progress{
  3581. height: 25px !important;
  3582. }
  3583. .art-control.art-control-progress{
  3584. height: 25px !important;
  3585. }
  3586. .视频剧集列表::-webkit-scrollbar {
  3587. width: 0px;
  3588. }
  3589. .剧集选择 {
  3590. color: rgb(255 255 255 / 50%);
  3591. }
  3592. @media (hover: none) and (max-width: 768px) {
  3593. .剧集选择 {
  3594. color:#ffc107;
  3595. /* 在移动设备上添加其他样式 */
  3596. }
  3597. .art-control.art-control-time{
  3598. top: -60px;
  3599. left: 0px;
  3600. position: absolute;
  3601. }
  3602. .art-video-player .art-layer-auto-playback{
  3603. bottom: 90px;
  3604. }
  3605. }
  3606. .剧集选择:hover {
  3607. user-select: none;
  3608. cursor: pointer;
  3609. border-radius: 25px;
  3610. color: green ;
  3611. }
  3612. .页数 {
  3613. overflow-x: scroll;
  3614. white-space: nowrap;
  3615. }
  3616. .页数::-webkit-scrollbar {
  3617. width: 0px;
  3618. }
  3619. .页数子元素 {
  3620. user-select: none;
  3621. background: green ;
  3622. padding: 0px 4px 0px 4px;
  3623. width: 60px;
  3624. height: 30px;
  3625. }
  3626.  
  3627. .页数子元素:hover {
  3628. cursor: pointer;
  3629. user-select: none;
  3630. border-radius: 5px;
  3631. background: #70B9E8 ;
  3632. }
  3633.  
  3634. .页数子元素:hover::after {
  3635. border-radius: 5px;
  3636. background: rgba(255, 255, 255, 0.3) ;
  3637. }
  3638. .视频剧集:active {
  3639. background: #b1a125;/* 点击时的颜色 */
  3640. }
  3641. .视频剧集{
  3642. user-select: none;
  3643. background: rgb(203 103 0);
  3644.  
  3645. }
  3646. .视频剧集:hover::after {
  3647. border-radius: 25px;
  3648. background: rgba(255, 255, 255, 0.3) ;
  3649. }
  3650.  
  3651. .视频剧集:hover {
  3652. user-select: none;
  3653. cursor: pointer;
  3654. border-radius: 25px;
  3655. background: #70B9E8 ;
  3656. }
  3657. .视频剧集:active {
  3658. background: #b1a125;/* 点击时的颜色 */
  3659. }
  3660. .main_button{
  3661. color: rgb(104 107 104) ;
  3662. background: white;
  3663. }
  3664. .设置面板:hover {
  3665. user-select: none;
  3666. cursor: pointer;
  3667. border-radius: 25px;
  3668. color: green ;
  3669. }
  3670. #saveButton{
  3671. color: #333333 ;
  3672. }
  3673. #saveButton:hover{
  3674. color: green ;
  3675. }
  3676. #saveButton:active{
  3677. color: #00b4f8 ;
  3678. }
  3679. .main_button:hover {
  3680. color: green ;
  3681. }
  3682. `;
  3683.  
  3684. if (document.querySelector('.custom')) {
  3685. document.querySelector('.custom').remove()
  3686. }
  3687. var style = document.createElement('style');
  3688. style.type = 'text/css';
  3689. style.textContent = css;
  3690. style.className = "custom";
  3691. document.head.appendChild(style);
  3692. }
  3693. async function 创建视频列表(剧集JSON) {
  3694. 创建剧集选择按钮();
  3695. let 剧集盒子 =await 剧集盒子创建();
  3696. let 当前页数 = 1;
  3697. let 每页数量 = 110;
  3698. let 总页数 = Math.ceil(剧集JSON.列表.length / 每页数量);
  3699. let 页数 = document.createElement('div');
  3700. 页数.className = '页数';
  3701. 页数.style.height = '50px';
  3702. 页数.style.width = '100%';
  3703. 页数.style.display = 'flex';
  3704. 页数.style.zIndex = '999';
  3705. 页数.style.borderRadius = '12px 12px 0px 0px';
  3706. 页数.style.background = 'rgb(0 0 0 / 18%)';
  3707. 剧集盒子.appendChild(页数);
  3708. let 当前集数 = 0;
  3709. let 添加数 = 0;
  3710. for (let i = 0; i < 总页数; i++) {
  3711. let 视频剧集列表 = 视频剧集列表创建(剧集盒子);
  3712. for (let j = i * 每页数量; j < Math.min((i + 1) * 每页数量, 剧集JSON.列表.length); j++) {
  3713. let 视频剧集 = document.createElement('div');
  3714. 视频剧集.className = '视频剧集';
  3715. 视频剧集.textContent = 剧集JSON.列表[j].集数;
  3716. 视频剧集.setAttribute('剧集名', 剧集JSON.列表[j].play_title);
  3717. 视频剧集.setAttribute('vid', 剧集JSON.列表[j].vid);
  3718. 视频剧集.setAttribute('cid', 剧集JSON.cid);
  3719. 视频剧集.setAttribute('url', 剧集JSON.列表[j].url);
  3720. 视频剧集.style.height = '30px';
  3721. 视频剧集.style.width = '30px';
  3722. 视频剧集.style.lineHeight = '30px';
  3723. 视频剧集.style.borderRadius = '12px';
  3724. 视频剧集.style.display = 'flex';
  3725. 视频剧集.style.justifyContent = 'center';
  3726. //视频剧集.style.background = '#ff6c00';
  3727. 视频剧集.style.margin = '3px';
  3728. 视频剧集列表.appendChild(视频剧集);
  3729. 添加数++;
  3730. 视频剧集.addEventListener('click', function () {
  3731. 阻止弹出新页面 = false;
  3732. location.href = 视频剧集.getAttribute('url');
  3733. 剧集盒子.style.display = 'none';
  3734. })
  3735. }
  3736.  
  3737. let 页数子元素 = document.createElement('div');
  3738. console.log(i,)
  3739. 页数子元素.className = '页数子元素';
  3740. 页数子元素.textContent = (当前集数 + 1) + '-' + 添加数
  3741. 当前集数 = Math.min((i + 1) * 每页数量);
  3742. 页数子元素.style.height = '30px';
  3743. 页数子元素.style.width = '70px';
  3744. 页数子元素.style.lineHeight = '30px';
  3745. 页数子元素.style.display = 'flex';
  3746. 页数子元素.style.justifyContent = 'center';
  3747. 页数子元素.style.borderRadius = '12px';
  3748. 页数子元素.style.margin = '0px 3px 0px 3px';
  3749. 页数子元素.addEventListener('click', function () {
  3750. 切换视频剧集列表(i + 1);
  3751. });
  3752. 页数.appendChild(页数子元素);
  3753. }
  3754.  
  3755. // 默认显示第一页的视频剧集列表
  3756. 切换视频剧集列表(当前页数);
  3757. 创建下一集按钮();
  3758. 当前剧集(剧集JSON.vid);
  3759. }
  3760. function 创建剧集选择按钮() {
  3761. document.querySelector('.剧集选择')?.remove()
  3762. var interval = setInterval(function () {
  3763.  
  3764. if (工具条) {
  3765. clearInterval(interval); // 停止循环
  3766. var selectButton = document.createElement('button');
  3767. selectButton.className = '剧集选择';
  3768. selectButton.style.width = '40px';
  3769. selectButton.style.height = '29px';
  3770. selectButton.style.borderRadius = '10px';
  3771. selectButton.textContent = 'V';
  3772. selectButton.style.border = '0';
  3773. if (location.hostname.includes('im1907.top')) {
  3774. selectButton.style.position = 'absolute';
  3775. selectButton.style.right = '55px';
  3776. selectButton.style.bottom = '-20px';
  3777. }
  3778. var thirdChild = 工具条.children[2];
  3779. 工具条.insertBefore(selectButton, thirdChild);
  3780. selectButton.addEventListener('click', function () {
  3781. let 视频列表盒子 = document.querySelector('.剧集盒子')
  3782. if (视频列表盒子) {
  3783. if (视频列表盒子.style.display === 'none') {
  3784. 视频列表盒子.style.display = 'block';
  3785. 当前剧集(vid);
  3786. } else {
  3787. 视频列表盒子.style.display = 'none';
  3788. }
  3789. }
  3790. });
  3791. }
  3792. }, 1000);
  3793. }
  3794. function 取爱奇艺视频主页JSON(cid) {
  3795. var page_context;
  3796. var 页数 = 0;
  3797. var 总页数;
  3798. function 发送请求() {
  3799. console.log('发送请求');
  3800. fetch(`https://www.iqiyi.com/${cid}.html`, {
  3801. method: 'GET',
  3802. headers: {
  3803. 'authority': ' m.iqiyi.com',
  3804. 'accept': ' text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
  3805. 'accept-language': 'zh-CN,zh;q=0.9',
  3806. 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102"',
  3807. 'sec-ch-ua-mobile': '?0',
  3808. 'sec-ch-ua-platform': '"Windows"',
  3809. 'sec-fetch-dest': 'empty',
  3810. 'sec-fetch-mode': 'cors',
  3811. 'sec-fetch-site': 'same-site',
  3812. 'user-agent': 'jdapp;android;8.3.5;9.3.7;;network/wifi;model/Mi Note 2;osVer/26;appBuild/71043;psn/|7;psq/1;uid/;adk/;ads/;pap/JA2015_311210|8.4.2|ANDROID 8.0.0;osv/8.0.0;pv/2.23;jdv/;ref/com.jingdong.app.mall.WebActivity;partner/huawei;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 8.0.0; Mi Note 2 Build/OPR1.170623.032; wv)) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36'
  3813. }
  3814. })
  3815. .then(response => response.text())
  3816. .then(data => {
  3817. // 处理响应
  3818.  
  3819. let domObject = 元素转DOM对象(data);
  3820. //document.body.appendChild(domObject.documentElement);
  3821. let script = domObject.querySelectorAll('script')
  3822. for (let index = 0; index < script.length; index++) {
  3823.  
  3824. if (script[index].innerHTML.includes("window.__INITIAL_STATE__")) {
  3825.  
  3826. var script2 = document.createElement('script');
  3827. script2.innerHTML = script[index].innerHTML;
  3828. document.head.appendChild(script2);
  3829. if (window.__INITIAL_STATE__) {
  3830. //console.log("脚本内容包含 window.__INITIAL_STATE__", JSON.stringify(window.__INITIAL_STATE__));
  3831. 取爱奇艺视频列表_GM(window.__INITIAL_STATE__.play.videoInfo.aid)
  3832. }
  3833. script2.remove();
  3834. } else {
  3835. console.log("脚本内容不包含 window.__INITIAL_STATE__");
  3836. }
  3837. }
  3838.  
  3839.  
  3840. })
  3841. .catch(error => {
  3842. console.error(error);
  3843. });
  3844. }
  3845.  
  3846. // 开始第一次请求
  3847. 发送请求();
  3848. }
  3849. function 源码script处理(源码) {
  3850. let domObject = 元素转DOM对象(源码);
  3851. //document.body.appendChild(domObject.documentElement);
  3852. let script = domObject.querySelectorAll('script')
  3853. for (let index = 0; index < script.length; index++) {
  3854.  
  3855. if (script[index].innerHTML.includes("window.__INITIAL_STATE__")) {
  3856.  
  3857. var script2 = document.createElement('script');
  3858. script2.className = '临时加载'
  3859. script2.innerHTML = script[index].innerHTML;
  3860. //document.head.appendChild(script2);
  3861. unsafeWindow.document.head.appendChild(script2);
  3862. if (window.__INITIAL_STATE__) {
  3863. //console.log("脚本内容包含 window.__INITIAL_STATE__", JSON.stringify(window.__INITIAL_STATE__));
  3864. 取爱奇艺视频列表_GM(window.__INITIAL_STATE__.play.videoInfo.aid)
  3865. }
  3866. script2.remove();
  3867. } else {
  3868. console.log("脚本内容不包含 window.__INITIAL_STATE__");
  3869. }
  3870. }
  3871. }
  3872. function 取爱奇艺视频列表2(cid) {
  3873. var 页数 = 1;
  3874. var 总页数;
  3875. var js = {
  3876. 剧集JSON: [],
  3877. 页数: 1
  3878. }
  3879. function 发送请求() {
  3880. console.log('发起第一次请求')
  3881. fetch(`https://pub.m.iqiyi.com/h5/main/videoList/album/?albumId=${cid}&size=50&page=${页数}&needPrevue=true&needVipPrevue=true`, {
  3882. method: 'GET',
  3883. headers: {
  3884. 'authority': ' pub.m.iqiyi.com',
  3885. 'accept': ' */*',
  3886. 'accept-language': 'zh-CN,zh;q=0.9',
  3887. 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="102"',
  3888. 'sec-ch-ua-mobile': '?0',
  3889. 'sec-ch-ua-platform': '"Windows"',
  3890. 'sec-fetch-dest': 'empty',
  3891. 'sec-fetch-mode': 'cors',
  3892. 'sec-fetch-site': 'same-site',
  3893. 'user-agent': 'jdapp;android;8.3.5;9.3.7;;network/wifi;model/Mi Note 2;osVer/26;appBuild/71043;psn/|7;psq/1;uid/;adk/;ads/;pap/JA2015_311210|8.4.2|ANDROID 8.0.0;osv/8.0.0;pv/2.23;jdv/;ref/com.jingdong.app.mall.WebActivity;partner/huawei;apprpd/Home_Main;Mozilla/5.0 (Linux; Android 8.0.0; Mi Note 2 Build/OPR1.170623.032; wv)) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/71.0.3578.99 Mobile Safari/537.36'
  3894. }
  3895. })
  3896. .then(response => response.json())
  3897. .then(data => {
  3898. 爱奇艺视频列表数据处理(data, js)
  3899. })
  3900. .catch(error => {
  3901. console.error(error);
  3902. });
  3903. }
  3904.  
  3905. // 开始第一次请求
  3906. 发送请求();
  3907. }
  3908. function 解析网站广告() {
  3909. function 解析网站广告子程序() {
  3910. var 解析暂停广告 = document.getElementById('adv_wrap_hh');
  3911. if (解析暂停广告) {
  3912. 解析暂停广告.remove();
  3913. console.log("删除解析网站暂停广告", "interactiframe");
  3914. } else {
  3915. clearInterval(定时器);
  3916. }
  3917. }
  3918. var 定时器 = setInterval(解析网站广告子程序, 1000);
  3919. }
  3920. function 取当日时间戳() {
  3921. const currentDate = new Date();
  3922. currentDate.setHours(0, 0, 0, 0); // 将时间部分设置为0,只保留日期部分
  3923. const timestamp = currentDate.getTime() / 1000; // 获取时间戳(秒)
  3924. return timestamp;
  3925. }
  3926. function 解析站创建主设置组件() {
  3927. 'use strict';
  3928. // 创建设置按钮
  3929. document.querySelector('.main_button')?.remove();
  3930. var settingButton = document.createElement('button');
  3931. settingButton.className = 'main_button';
  3932. settingButton.style.top = '50%';
  3933. settingButton.innerHTML = '设置';
  3934.  
  3935. //settingButton.style.color = '#376339';
  3936. //settingButton.style.background = "linear-gradient(to right, #DCF0B0, rgba(252, 247, 224, 0.5))";
  3937. settingButton.style.cursor = 'pointer';
  3938. settingButton.style.zIndex = '9999';
  3939. settingButton.style.margin = '3px';
  3940. settingButton.style.border = '0';
  3941. settingButton.addEventListener('mousedown', function (e) {
  3942. // dragMenu(settingButton, e);
  3943. });
  3944. //https://jx.xmflv.com/
  3945. var 工具条 = document.querySelector(".art-controls");
  3946. if (工具条) {
  3947. settingButton.style.width = '40px';
  3948. settingButton.style.height = '29px';
  3949. settingButton.style.borderRadius = '10px';
  3950. settingButton.style.fontSize = '10px';
  3951. settingButton.style.padding = '4px';
  3952. if (location.hostname.includes('im1907.top')) {
  3953. settingButton.style.position = 'absolute';
  3954. settingButton.style.right = '55px';
  3955. settingButton.style.bottom = '-20px';
  3956. }
  3957. // 将新元素插入父元素的第三个位置,如果没有子元素,添加为第一元素
  3958. var thirdChild = 工具条.children[2];
  3959. 工具条.insertBefore(settingButton, thirdChild);
  3960. }
  3961. var settingPanel = document.createElement('div');
  3962. settingPanel.className = '设置面板';
  3963. settingPanel.style.position = 'fixed';
  3964. settingPanel.style.top = '47%';
  3965. settingPanel.style.right = '20px';
  3966. settingPanel.style.padding = '10px';
  3967. settingPanel.style.borderRadius = '10px';
  3968. settingPanel.style.color = '#376339';
  3969. settingPanel.style.background = "linear-gradient(to right, #DCF0B0, #FCF7E0)";
  3970. settingPanel.style.border = '1px solid #000';
  3971. settingPanel.style.zIndex = '9999';
  3972. settingPanel.style.display = 'none';
  3973. settingPanel.innerHTML = `
  3974. <input type="checkbox" class="进度选择 选择 a" name="progressType" value="进度选择" style="cursor:pointer;20px !important">
  3975. <label for="进度选择">使用百分比</label>
  3976. <input type="number" id="百分比进度" value="85" style="width: 50px;">
  3977. <br>
  3978. <input type="checkbox" class="进度选择 选择 b" name="progressType" value="time" style="cursor:pointer;20px !important">
  3979. <label for="time">使用分秒时间</label>
  3980. <input type="text" id="时间进度" placeholder="12:20" style="width: 50px;background: #a5af74; border-radius: 5px;">
  3981. <br>
  3982. <br>
  3983. <button id="saveButton" class="button" style="font-weight: bold;cursor:pointer; position: absolute; left: 150px;bottom: 5px; border: 0; border-radius: 10px;">保存</button>
  3984. `;
  3985. function 弃用功能() {
  3986. // <br>
  3987. // <input type="checkbox" class="弹幕开关" name="progressType" value="弹幕开关" checked style="cursor:pointer;20px !important">
  3988. // <label for="弹幕开关">开启弹幕</label>
  3989. }
  3990. document.body.appendChild(settingPanel);
  3991.  
  3992. document.querySelector('.选择.a').addEventListener('click', function (event) {
  3993. if (document.querySelector('.选择.a').checked === true) {
  3994. document.querySelector('.选择.b').checked = false;
  3995. }
  3996.  
  3997. })
  3998. document.querySelector('.选择.b').addEventListener('click', function (event) {
  3999. if (document.querySelector('.选择.b').checked === true) {
  4000. document.querySelector('.选择.a').checked = false;
  4001. }
  4002. })
  4003. settingPanel.addEventListener('mousedown', function (e) {
  4004. //dragMenu(settingPanel, e);
  4005. });
  4006. // 定义一个变量用于保存计时器的 ID
  4007. var timerId;
  4008. // 给设置按钮绑定鼠标移入事件
  4009. settingButton.addEventListener('mouseenter', function () {
  4010. // 显示设置面板
  4011. settingPanel.style.display = 'block';
  4012. // 清除计时器
  4013. clearTimeout(timerId);
  4014. });
  4015. // 给设置面板绑定鼠标移入事件,避免鼠标移出设置按钮后立即隐藏设置面板
  4016. settingPanel.addEventListener('mouseenter', function () {
  4017. // 清除计时器
  4018. clearTimeout(timerId);
  4019. });
  4020. // 给设置按钮绑定鼠标移出事件
  4021. settingButton.addEventListener('mouseleave', function () {
  4022. // 开始计时,500 毫秒后隐藏设置面板
  4023. timerId = setTimeout(function () {
  4024. settingPanel.style.display = 'none';
  4025. }, 500);
  4026. });
  4027. // 给设置面板绑定鼠标移出事件,避免鼠标移入设置面板后立即隐藏设置面板
  4028. settingPanel.addEventListener('mouseleave', function () {
  4029. // 开始计时,500 毫秒后隐藏设置面板
  4030. timerId = setTimeout(function () {
  4031. settingPanel.style.display = 'none';
  4032. }, 500);
  4033. });
  4034. // 显示/隐藏设置界面
  4035. settingButton.addEventListener('click', function () {
  4036. if (settingPanel.style.display === 'none') {
  4037. settingPanel.style.display = 'block';
  4038. console.log('开始设置');
  4039. const 进度选择Input = document.querySelectorAll('.选择');
  4040. if (进度选择Input.length === 2) {
  4041. for (let index = 0; index < 进度选择Input.length; index++) {
  4042. 进度选择Input[index].style.cssText = 'width: 20px !important; cursor: pointer;';
  4043. }
  4044. }
  4045. } else {
  4046. settingPanel.style.display = 'none';
  4047. }
  4048. });
  4049. //取进度百分比的编辑框元素
  4050. var 百分比进度编辑框 = document.getElementById('百分比进度');
  4051. // 读取缓存进度选择Threshold的值
  4052. var 百分比进度缓存值 = localStorage.getItem('百分比进度');
  4053. //如果缓存没有内容就使用默认的数值
  4054. if (百分比进度缓存值) {
  4055. 百分比进度编辑框.value = 百分比进度缓存值;
  4056. } else {
  4057. 百分比进度编辑框.placeholder = '85'; // 默认值
  4058. }
  4059. // 读取缓存的timeThreshold的值
  4060. var 时间进度编辑框 = document.getElementById('时间进度');
  4061. var 时间进度缓存值 = localStorage.getItem('时间进度');
  4062. if (时间进度缓存值) {
  4063. 时间进度编辑框.value = 时间进度缓存值;
  4064. } else {
  4065. 时间进度编辑框.placeholder = '12:20'; // 默认值
  4066. }
  4067. var 进度选择Value = parseInt(localStorage.getItem('进度选择'));
  4068. if (isNaN(进度选择Value) || 进度选择Value < 0) {
  4069. document.querySelectorAll(".进度选择")[0].checked = true
  4070. } else {
  4071. document.querySelectorAll(".进度选择")[进度选择Value].checked = true
  4072. }
  4073. // var 弹幕开关 = localStorage.getItem('弹幕开关');
  4074. // if (弹幕开关='true') {
  4075. // if (document.querySelector(".弹幕开关")) {
  4076. // document.querySelector(".弹幕开关").checked = true;
  4077. // } else {
  4078. // document.querySelector(".弹幕开关").checked = false;
  4079. // }
  4080. // }
  4081.  
  4082. // 监听保存按钮的点击事件
  4083. var saveButton = document.getElementById('saveButton');
  4084. saveButton.addEventListener('click', function () {
  4085. // 保存进度选择Threshold的值到localStorage
  4086. var 百分比进度 = 百分比进度编辑框.value;
  4087. localStorage.setItem('百分比进度', 百分比进度);
  4088. // 保存timeThreshold的值到localStorage
  4089. var 时间进度 = 时间进度编辑框.value;
  4090. localStorage.setItem('时间进度', 时间进度);
  4091. //localStorage.setItem('弹幕开关', document.querySelector(".弹幕开关")?.checked);
  4092. // // 判断是否所有的进度选择都被选中
  4093. var 进度选择Inputs = document.querySelectorAll(".进度选择");
  4094. for (var i = 0; i < 进度选择Inputs.length; i++) {
  4095. if (进度选择Inputs[i].checked) {
  4096. localStorage.setItem('进度选择', i);
  4097. }
  4098. }
  4099. });
  4100. }
  4101. function 取腾讯视频源码JSON文本(content) {
  4102.  
  4103. var regex = /window\.__PINIA__=(.*?)(?=<\/script>)/s;
  4104. var match = regex.exec(content);
  4105. if (match && match.length >= 2) {
  4106. let initialStateText = match[1];
  4107. // 现在 initialStateText 中存储了 window.__INITIAL_STATE__ 和 </script> 之间的内容
  4108. initialStateText = initialStateText.replace(/:undefined/g, ':"undefined"');
  4109. return initialStateText;
  4110. }
  4111. }
  4112. function URL参数转POST(params) {
  4113. const searchParams = new URLSearchParams(params);
  4114. const json = {};
  4115. for (const [key, value] of searchParams) {
  4116. json[key] = value;
  4117. }
  4118. // return JSON.stringify(json);
  4119. return json;
  4120. }
  4121. function 读取当前视频() {
  4122. fetch('https://v.qq.com/x/cover/mzc00200no18bci/u003627s899.html')
  4123. .then(response => response.text())
  4124. .then(data => {
  4125. let domObject = 元素转DOM对象(data);
  4126. //document.body.appendChild(domObject.documentElement);
  4127. let script = domObject.querySelectorAll('script')
  4128. for (let index = 0; index < script.length; index++) {
  4129. if (script[index].innerHTML.includes("window.__PINIA__")) {
  4130. var script2 = document.createElement('script');
  4131. script2.innerHTML = script[index].innerHTML;
  4132. document.head.appendChild(script2);
  4133. if (window.__PINIA__) {
  4134. console.log("脚本内容包含 window.__PINIA__", JSON.stringify(window.__PINIA__));
  4135. console.log(window.__PINIA__?.episodeClips?.nextPageContext)
  4136. }
  4137. script2.remove();
  4138. } else {
  4139. console.log("脚本内容不包含 window.__PINIA__");
  4140. }
  4141. }
  4142. });
  4143. }
  4144. function 元素转DOM对象(data) {
  4145. let htmlString = data;
  4146. // 创建一个 DOMParser 实例
  4147. let parser = new DOMParser();
  4148. // 使用 DOMParser 的 parseFromString 方法将 HTML 文本解析为 DOM 对象
  4149. return parser.parseFromString(htmlString, 'text/html');
  4150. }
  4151. function 页面关闭监测() {
  4152. let 手机浏览器;
  4153. if (判断是否是手机设备()) {
  4154. 手机浏览器 = true;
  4155. // 创建一个每100毫秒运行一次的函数
  4156. const intervalId = setInterval(() => {
  4157. // 获取要删除的元素
  4158. const elementToRemove = document.querySelector('body span');
  4159.  
  4160. // 如果找到了要删除的元素,则执行删除操作
  4161. if (elementToRemove) {
  4162. elementToRemove.remove();
  4163. }
  4164. }, 1);
  4165. }
  4166. window.addEventListener('beforeunload', function (event) {
  4167. GM_setValue("上次视频", this.location.href);
  4168. if (手机浏览器 && 阻止弹出新页面 === true) {
  4169. event.preventDefault();
  4170. // 兼容旧版本浏览器
  4171. event.returnValue = '';
  4172. }
  4173. localStorage.setItem('后退', document.querySelector('[class="splitRowCount auxiliary_button input1"]').value)
  4174. localStorage.setItem('前进', document.querySelector('[class="splitRowCount auxiliary_button input2"]').value)
  4175. console.log(898798)
  4176. let 弹幕开关 = document.querySelector('[aria-label="弹幕开关"]')
  4177. if (弹幕开关) {
  4178. let 弹幕开关按钮 = 弹幕开关.querySelector('[class="art-icon art-icon-danmu-on"]')
  4179. if (弹幕开关按钮) {
  4180. if (弹幕开关按钮.style.display === 'none') {
  4181. localStorage.setItem('弹幕开关', 'false')
  4182. } else {
  4183. localStorage.setItem('弹幕开关', 'true')
  4184. }
  4185. }
  4186. }
  4187. });
  4188. }
  4189.  
  4190.  
  4191. function 剧集盒子点击判断(jujiBox) {
  4192. //绑定点击,点击页面其他区域,关闭剧集盒子
  4193. document.addEventListener("click", function (event) {
  4194. var jujiBox = document.querySelector(".剧集盒子"); // 获取剧集盒子元素
  4195. if (event.target !== jujiBox && event.target !== document.querySelector(".剧集选择")) {
  4196. // 点击的不是剧集盒子以内的元素,隐藏剧集盒子
  4197. jujiBox.style.display = "none";
  4198. }
  4199. });
  4200. // 当剧集盒子被点击时阻止事件冒泡
  4201. var jujiBox2 = document.querySelector(".剧集盒子");
  4202. jujiBox2.addEventListener("click", function (event) {
  4203. event.stopPropagation();
  4204. });
  4205. }
  4206. function 点击下一集(video) {
  4207. //video.pause();
  4208. localStorage.setItem('恢复播放', true)
  4209. var episodes = document.querySelectorAll(".视频剧集");
  4210. for (let index = 0; index < episodes.length; index++) {
  4211. if (episodes[index].getAttribute('vid') === 当前VID) {
  4212. if (episodes[index + 1]) {
  4213. 阻止弹出新页面 = false;
  4214. location.assign(episodes[index + 1].getAttribute('url'))
  4215. video.remove();
  4216. }
  4217. }
  4218. }
  4219. }
  4220. function 点击上一集(video) {
  4221. //video.pause();
  4222. localStorage.setItem('恢复播放', true)
  4223. var episodes = document.querySelectorAll(".视频剧集");
  4224. for (let index = 0; index < episodes.length; index++) {
  4225. if (episodes[index].getAttribute('vid') === 当前VID) {
  4226. if (episodes[index + 1]) {
  4227. if (index - 1 > 0) {
  4228. 阻止弹出新页面 = false;
  4229. location.assign(episodes[index - 1].getAttribute('url'))
  4230. video.remove();
  4231. }
  4232. }
  4233. }
  4234. }
  4235. }
  4236. function 监测播放状态() {
  4237. let video = document.querySelector('video')
  4238. let i = 0;
  4239.  
  4240. if (video) {
  4241. 监测视频暂停状态()
  4242. video.addEventListener("timeupdate", function () {
  4243. i++;
  4244. var currentTime = Math.floor(video.currentTime); // 获取当前播放时间(秒)
  4245. var duration = Math.floor(video.duration); // 获取视频总长度(秒)
  4246. var progressType = parseInt(localStorage.getItem('进度选择'));
  4247. if (progressType === 0) {
  4248. var 进度选择 = localStorage.getItem('百分比进度');
  4249. var percent = (currentTime / duration) * 100;
  4250. if (percent >= 进度选择) {
  4251. video.pause()
  4252. console.log(i)
  4253. if (i > 20) {
  4254. i=0;
  4255. 点击下一集(video);
  4256. }
  4257. }
  4258. } else if (progressType === 1) {
  4259. var 时间进度 = localStorage.getItem('时间进度');
  4260. var timeParts = 时间进度.split(":");
  4261. var timeThresholdSeconds = parseInt(timeParts[0]) * 60 + parseInt(timeParts[1]);
  4262. if (currentTime >= timeThresholdSeconds && i > 20) {
  4263. //video.pause()
  4264. if (i > 20) {
  4265. i=0;
  4266. 点击下一集(video);
  4267. }
  4268. }
  4269. }
  4270. });
  4271. }
  4272. }
  4273. function 监测视频暂停状态() {
  4274. let video = document.querySelector('video')
  4275. if (video) {
  4276. video.addEventListener("pause", function () {
  4277. 解析网站广告()
  4278. })
  4279. }
  4280. }
  4281. //监测全屏状态
  4282. function 监测解析网站全屏状态() {
  4283. document.addEventListener('fullscreenchange', function () {
  4284. if (document.fullscreenElement) {
  4285. // 进入全屏状态
  4286.  
  4287. 剧集盒子.style.height = '280px'
  4288. } else {
  4289. // 退出全屏状态
  4290. 剧集盒子.style.height = '310px'
  4291.  
  4292. }
  4293. });
  4294. }
  4295. //解析网站函数结束点
  4296. }
  4297.  
  4298.  
  4299. function 绑定热键() {
  4300. document.addEventListener('keyup', function (event) {
  4301. var focusedElement = document.activeElement;
  4302. console.log(focusedElement);
  4303. if (focusedElement.className === 'splitRowCount auxiliary_button input2' || focusedElement.className === 'splitRowCount auxiliary_button input1') {
  4304. return;
  4305. }
  4306. var keyCode = event.keyCode || event.which;
  4307. if (keyCode === 33) {
  4308. // 执行操作
  4309. 点击上一集(document.querySelector('video'))
  4310. } else {
  4311. if (keyCode === 34) {
  4312. // 执行操作
  4313. 点击下一集(document.querySelector('video'))
  4314. } else {
  4315. if (keyCode === 99) {
  4316. // 快进
  4317. document.querySelector('.截图')?.click();
  4318. } else {
  4319. if (keyCode === 97) {
  4320. // 后退
  4321. document.querySelector('.后退')?.click();
  4322. } else {
  4323. if (keyCode === 98) {
  4324. // 前进
  4325. document.querySelector('.前进')?.click();
  4326. }
  4327. }
  4328. }
  4329. }
  4330. }
  4331. })
  4332. }
  4333. function dragMenu(menuObj, e) {
  4334. e = e ? e : window.event;
  4335. // || e.target.tagName === 'BUTTON' 判断是否为按钮元素
  4336. if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT' || e.target.tagName === 'SELECT') {
  4337. return;
  4338. }
  4339. let dragData = {
  4340. startX: e.clientX,
  4341. startY: e.clientY,
  4342. menuLeft: menuObj.offsetLeft,
  4343. menuTop: menuObj.offsetTop
  4344. };
  4345. document.onmousemove = function (e) { try { dragMenu(menuObj, e); } catch (err) { } };
  4346. document.onmouseup = function (e) { try { stopDrag(menuObj); } catch (err) { } };
  4347. doane(e);
  4348. function stopDrag(menuObj) {
  4349. document.onmousemove = null;
  4350. document.onmouseup = null;
  4351. }
  4352. function doane(e) {
  4353. if (e.stopPropagation) {
  4354. e.stopPropagation();
  4355. } else {
  4356. e.cancelBubble = true;
  4357. }
  4358. if (e.preventDefault) {
  4359. e.preventDefault();
  4360. } else {
  4361. e.returnValue = false;
  4362. }
  4363. }
  4364. document.onmousemove = function (e) {
  4365. let mouseX = e.clientX;
  4366. let mouseY = e.clientY;
  4367. let menuLeft = dragData.menuLeft + mouseX - dragData.startX;
  4368. let menuTop = dragData.menuTop + mouseY - dragData.startY;
  4369. menuObj.style.left = menuLeft + 'px';
  4370. menuObj.style.top = menuTop + 'px';
  4371. doane(e);
  4372. }
  4373. }
  4374.  
  4375. function 添加辅助功能() {
  4376. document.querySelector('#buttons-container')?.remove();
  4377. let video = document.querySelector('video')
  4378. //let video = document.createElement('video')
  4379. // 创建容器元素,并设置其id属性为 "buttons-container"
  4380. var buttonsContainer = document.createElement('div');
  4381. buttonsContainer.style.position = 'absolute';
  4382. if (判断是否是手机设备()) {
  4383. buttonsContainer.style.left = '10px';
  4384. buttonsContainer.style.opacity = '1';
  4385. buttonsContainer.style.bottom = '100px';
  4386. } else {
  4387. buttonsContainer.style.right = '10px';
  4388. buttonsContainer.style.bottom = '110px';
  4389. }
  4390. buttonsContainer.style.width = '267px';
  4391. buttonsContainer.style.height = '110px';
  4392. buttonsContainer.style.background = 'rgb(149 155 161 / 40%)';
  4393. //buttonsContainer.style.zIndex = 99;
  4394. buttonsContainer.style.borderRadius = '10px';
  4395. buttonsContainer.style.outline = 'none';
  4396. buttonsContainer.id = 'buttons-container';
  4397. //document.body.appendChild(buttonsContainer);
  4398.  
  4399. var clear = document.createElement('button');
  4400. clear.textContent = '清除缓存';
  4401. clear.className = '清除缓存 auxiliary_button';
  4402. clear.style.position = 'absolute';
  4403. clear.style.width = '90px';
  4404. clear.style.height = '28px';
  4405. clear.style.borderRadius = '10px';
  4406. clear.style.top = '25px';
  4407. clear.style.padding = '5px 19px';
  4408. clear.style.margin = '12px 5px 5px 5px';
  4409. clear.style.outline = 'none';
  4410. clear.addEventListener('click', function (event) {
  4411. event.stopPropagation(); // 阻止事件冒泡
  4412. event.preventDefault(); // 阻止默认行为
  4413. let 百分比进度 = localStorage.getItem('百分比进度')
  4414. let 时间进度 = localStorage.getItem('时间进度')
  4415. let 进度选择 = localStorage.getItem('进度选择')
  4416. let 弹幕开关 = localStorage.getItem('弹幕开关')
  4417. window.localStorage.clear();
  4418. localStorage.setItem('百分比进度', 百分比进度)
  4419. localStorage.setItem('时间进度', 时间进度)
  4420. localStorage.setItem('进度选择', 进度选择)
  4421. localStorage.setItem('弹幕开关', 弹幕开关)
  4422. })
  4423. buttonsContainer.appendChild(clear);
  4424.  
  4425.  
  4426. // 创建按钮并添加到容器中
  4427.  
  4428. var backwardButton = document.createElement('button');
  4429. backwardButton.textContent = '后退 -';
  4430. backwardButton.className = '后退 auxiliary_button'
  4431. backwardButton.style.outline = 'none';
  4432. backwardButton.addEventListener('click', function (event) {
  4433. event.stopPropagation(); // 阻止事件冒泡
  4434. event.preventDefault(); // 阻止默认行为
  4435. backward()
  4436. });
  4437.  
  4438. buttonsContainer.appendChild(backwardButton);
  4439. var input = document.createElement('input');
  4440. input.className = "splitRowCount auxiliary_button input1";
  4441. input.style.outline = 'none';
  4442. //input.style.left = '135px';
  4443. if (localStorage.getItem('后退')) {
  4444. input.value = localStorage.getItem('后退');
  4445. } else {
  4446. input.value = '0.1';
  4447. }
  4448. input.min = '0.01';
  4449. input.max = '100';
  4450. input.addEventListener('click', function (event) {
  4451. event.stopPropagation(); // 阻止事件冒泡
  4452. event.preventDefault(); // 阻止默认行为
  4453. })
  4454. buttonsContainer.appendChild(input);
  4455. var forwardButton = document.createElement('button');
  4456. forwardButton.textContent = '前进 +';
  4457. forwardButton.className = '前进 auxiliary_button'
  4458. forwardButton.style.outline = 'none';
  4459. forwardButton.addEventListener('click', function (event) {
  4460. event.stopPropagation(); // 阻止事件冒泡
  4461. event.preventDefault(); // 阻止默认行为
  4462. forward()
  4463. });
  4464. buttonsContainer.appendChild(forwardButton);
  4465. var input2 = document.createElement('input');
  4466. input2.className = "splitRowCount auxiliary_button input2";
  4467. input2.style.outline = 'none';
  4468. //input.style.left = '50px';
  4469. if (localStorage.getItem('前进')) {
  4470. input2.value = localStorage.getItem('前进');
  4471. } else {
  4472. input2.value = '0.1';
  4473. }
  4474. input2.min = '0.01';
  4475. input2.max = '100';
  4476. input2.addEventListener('click', function (event) {
  4477. event.stopPropagation(); // 阻止事件冒泡
  4478. event.preventDefault(); // 阻止默认行为
  4479. })
  4480. buttonsContainer.appendChild(input2);
  4481.  
  4482. var captureButton = document.createElement('button');
  4483. captureButton.textContent = '截图';
  4484. captureButton.className = '截图 auxiliary_button';
  4485. captureButton.style.outline = 'none';
  4486. captureButton.style.padding = '5px 20px 5px 20px';
  4487. captureButton.addEventListener('click', function (event) {
  4488. event.stopPropagation(); // 阻止事件冒泡
  4489. event.preventDefault(); // 阻止默认行为
  4490. capture()
  4491. });
  4492. buttonsContainer.appendChild(captureButton);
  4493. var p = document.createElement('p');
  4494. p.style.width = '250px';
  4495. p.style.height = '40px';
  4496. p.style.fontSize = '10px';
  4497. p.style.position = 'relative';
  4498. p.style.top = '40px';
  4499. p.style.left = '5px';
  4500. p.textContent = '热键:1(后退)、2(前进)、3(截图)、pgup(上一集)、pgdn(下一集)'
  4501. buttonsContainer.appendChild(p);
  4502.  
  4503. function backward() {
  4504. video.currentTime -= parseFloat(input.value);
  4505. }
  4506. function forward() {
  4507. video.currentTime += parseFloat(input2.value);
  4508. }
  4509. // 创建Canvas元素,并设置其id属性为 "myCanvas"
  4510. var canvas = document.createElement('canvas');
  4511. canvas.className = 'myCanvas';
  4512. document.body.appendChild(canvas);
  4513. var ctx = canvas.getContext('2d');
  4514. function capture() {
  4515. canvas.width = video.videoWidth; // 设置Canvas的宽度为视频的实际宽度
  4516. canvas.height = video.videoHeight; // 设置Canvas的高度为视频的实际高度
  4517. ctx.drawImage(video, 0, 0, video.videoWidth, video.videoHeight);
  4518. var dataURL = canvas.toDataURL(); // 获取截图的DataURL
  4519. var 片名 = '';
  4520. if (location.hostname.includes('v.qq.')) {
  4521. 片名 = document.querySelector('[class="txp-play-title__title"]').textContent
  4522. } else {
  4523. if (location.hostname.includes('youku.')) {
  4524. 片名 = document.querySelector('[class="kui-toplayer-title"]').textContent
  4525. } else {
  4526. if (location.hostname.includes('.iqiyi.')) {
  4527. 片名 = document.querySelector('[class="iqp-top-title-wrap"]').textContent
  4528. } else {
  4529. 片名 = document.title
  4530. }
  4531. }
  4532. }
  4533. var downloadLink = document.createElement('a');
  4534. downloadLink.href = dataURL;
  4535. downloadLink.download = `screenshot_${片名}_${取当前时间2()}.png`;
  4536. downloadLink.textContent = 'Download';
  4537. downloadLink.style.display = 'none'; // 隐藏下载链接
  4538.  
  4539. // 将下载链接添加到容器中
  4540. buttonsContainer.appendChild(downloadLink);
  4541.  
  4542. // 模拟点击下载链接进行自动下载
  4543. downloadLink.click();
  4544. }
  4545. let css = `
  4546. #buttons-container.hide{
  4547. opacity: 0;
  4548. }
  4549. #buttons-container.hide:hover{
  4550. opacity: 1;
  4551. }
  4552. .auxiliary_button {
  4553. height: 28px;
  4554. background-color: #6f7275;
  4555. border: 0;
  4556. border-radius: 56px;
  4557. color: #fff;
  4558. cursor: pointer;
  4559. display: inline-block;
  4560. font-family: system-ui, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  4561. font-size: 13px;
  4562. font-weight: 600;
  4563. padding: 5px 45px 5px 5px;
  4564. margin: 5px 2px 0px 5px;
  4565. position: relative;
  4566. text-align: center;
  4567. text-decoration: none;
  4568. transition: all .3s;
  4569. user-select: none;
  4570. -webkit-user-select: none;
  4571. touch-action: manipulation;
  4572. }
  4573. .auxiliary_button:active {
  4574. color: #24BFA5;
  4575. }
  4576. .auxiliary_button:before {
  4577. background-color: initial;
  4578. background-image: linear-gradient(#fff 0, rgba(255, 255, 255, 0) 100%);
  4579. border-radius: 125px;
  4580. content: "";
  4581. height: 50%;
  4582. left: 4%;
  4583. opacity: .5;
  4584. position: absolute;
  4585. top: 0;
  4586. transition: all .3s;
  4587. width: 92%;
  4588. outline: none;
  4589. }
  4590. .auxiliary_button:hover {
  4591. background-color: #ffd700;
  4592. box-shadow: rgba(255, 255, 255, .2) 0 3px 15px inset, rgba(0, 0, 0, .1) 0 3px 5px, rgba(0, 0, 0, .1) 0 10px 13px;
  4593. }
  4594. .splitRowCount {
  4595. outline: none;
  4596. width: 43px;
  4597. background-color: #6f7275;
  4598. border: 0;
  4599. border-radius: 20px;
  4600. color: #fff;
  4601. cursor: pointer;
  4602. display: inline-block;
  4603. font-family: system-ui, -apple-system, system-ui, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", sans-serif;
  4604. font-size: 13px;
  4605. font-weight: 600;
  4606. padding: 0px;
  4607. position: absolute;
  4608. text-align: center;
  4609. text-decoration: none;
  4610. transition: all .3s;
  4611. user-select: none;
  4612. -webkit-user-select: none;
  4613. touch-action: manipulation;
  4614. height: 28px;
  4615. }
  4616. .splitRowCount:active {
  4617. color: #24BFA5;
  4618. }
  4619. .splitRowCount:before {
  4620. background-color: initial;
  4621. background-image: linear-gradient(#fff 0, rgba(255, 255, 255, 0) 100%);
  4622. border-radius: 125px;
  4623. content: "";
  4624. height: 50%;
  4625. left: 4%;
  4626. opacity: .5;
  4627. position: absolute;
  4628. top: 0;
  4629. transition: all .3s;
  4630. width: 92%;
  4631. outline: none;
  4632. }
  4633. .splitRowCount:hover {
  4634. background-color: #f3b26b;
  4635. box-shadow: rgba(255, 255, 255, .2) 0 3px 15px inset, rgba(0, 0, 0, .1) 0 3px 5px, rgba(0, 0, 0, .1) 0 10px 13px;
  4636. }
  4637. .input1 {
  4638. left: 45px;
  4639. }
  4640. .input2 {
  4641. left: 139px;
  4642. }
  4643.  
  4644.  
  4645. `
  4646. if (document.querySelector('.辅助功能')) {
  4647. document.querySelector('.辅助功能').remove()
  4648. }
  4649. var style = document.createElement('style');
  4650. style.type = 'text/css';
  4651. style.textContent = css;
  4652. style.className = "辅助功能";
  4653. document.head.appendChild(style);
  4654. if (location.hostname.includes('.iqiyi.')) {
  4655. let count = 0;
  4656. const intervalId = setInterval(() => {
  4657. count++;
  4658. if (count === 10) {
  4659. clearInterval(intervalId);
  4660. buttonsContainer.classList.add('hide')
  4661. }
  4662. }, 1000);
  4663. }
  4664.  
  4665. return buttonsContainer;
  4666. }
  4667. // 切换显示对应视频剧集列表的代码
  4668. function 切换视频剧集列表(页数) {
  4669. let 所有视频剧集列表 = document.getElementsByClassName('视频剧集列表');
  4670. for (let i = 0; i < 所有视频剧集列表.length; i++) {
  4671. if (i === 页数 - 1) {
  4672. 所有视频剧集列表[i].style.display = 'flex';
  4673. } else {
  4674. 所有视频剧集列表[i].style.display = 'none';
  4675. }
  4676. }
  4677. }
  4678. function 监测点击元素() {
  4679. // 获取页面上所有元素
  4680. var allElements = document.getElementsByTagName("*");
  4681. // 为每个元素添加点击事件监听器
  4682. for (var i = 0; i < allElements.length; i++) {
  4683. allElements[i].addEventListener("click", function () {
  4684. // 输出该元素的 ID 或类名
  4685. console.log(this.id || this.className);
  4686. });
  4687. }
  4688. }
  4689. function 判断是否是手机设备() {
  4690. const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
  4691. if (isMobile) {
  4692. return true;
  4693. } else {
  4694. return false;
  4695. }
  4696. }
  4697.  
  4698. function 取当前时间() {
  4699. const now = new Date();
  4700. const year = now.getFullYear();
  4701. const month = String(now.getMonth() + 1).padStart(2, '0');
  4702. const date = String(now.getDate()).padStart(2, '0');
  4703. const hours = String(now.getHours()).padStart(2, '0');
  4704. const minutes = String(now.getMinutes()).padStart(2, '0');
  4705. const seconds = String(now.getSeconds()).padStart(2, '0');
  4706.  
  4707. const formattedTime = `${year}${month}${date} ${hours}:${minutes}:${seconds}`;
  4708. return formattedTime;
  4709. }
  4710.  
  4711. function 取当前时间2() {
  4712. const now = new Date();
  4713. const year = now.getFullYear();
  4714. const month = String(now.getMonth() + 1).padStart(2, '0');
  4715. const date = String(now.getDate()).padStart(2, '0');
  4716. const hours = String(now.getHours()).padStart(2, '0');
  4717. const minutes = String(now.getMinutes()).padStart(2, '0');
  4718. const seconds = String(now.getSeconds()).padStart(2, '0');
  4719. const milliseconds = String(now.getMilliseconds()).padStart(3, '0');
  4720.  
  4721. const formattedTime = `${year}-${month}-${date}_${hours}${minutes}${seconds}_${milliseconds}`;
  4722. return formattedTime;
  4723. }

QingJ © 2025

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