全网视频解析播放

新增数据库,海量弹幕解析口为数据库1和4

  1. // ==UserScript==
  2. // @name 全网视频解析播放
  3. // @version 6.0
  4. // @description 新增数据库,海量弹幕解析口为数据库1和4
  5. // @license AGPL-3.0
  6. // @author 墨竹
  7. // @match https://*/*
  8. // @match http://*/*
  9. // @grant none
  10. // @run-at document-start
  11. // @namespace https://gf.qytechs.cn/users/1142464
  12. // ==/UserScript==
  13.  
  14.  
  15. (function () {
  16. const settings = {IntervalIds: []};
  17. const setInterval = window.setInterval;
  18. if (new RegExp("[?&](?:url|v)=https?://.+\\..+\\..+/.+").test(location.search) ||
  19. new RegExp("^https?://api\\.leduotv\\.com/.+?vid=http").test(location.href)) {
  20. settings.isParse = true;
  21. } else if (// 如果没匹配到 前面不是 非.或非空且匹配项在末尾$ 时则退出。)
  22. (window !== top || !new RegExp("(?:^|\\.)(?:v\\.qq|iqiyi|youku|bilibili|miguvideo|le|(?:tv|film)\\.sohu|mgtv|ixigua|pptv|vip\\.1905)\\.com|wasu\\.cn$").test(location.host) || new RegExp("(?:space\\.bilibili)\\.com").test(location.host))
  23. ) {
  24. return;
  25. }
  26. (function () {
  27. 'use strict';
  28.  
  29. console.log("脚本运行在 " + (window === top ? window.name = Date.now().toString(36) : window.name) + " " + location.href);
  30. if (typeof location["#316119"] === "undefined") {
  31. try {
  32. Object.defineProperty(location, "#316119", {
  33. value: "v",
  34. writable: false,
  35. enumerable: false,
  36. configurable: false
  37. });
  38. } catch (e) {
  39.  
  40. }
  41. } else {
  42. return;
  43. }
  44.  
  45. (function () {
  46. const appendChild = Node.prototype.appendChild;
  47. Node.prototype.appendChild = function (node) {
  48. if (node.constructor.name === "HTMLIFrameElement") {
  49. const src = node.src;
  50. node.removeAttribute("src");
  51. node.removeAttribute("sandbox");
  52. appendChild.apply(this, arguments);
  53. if (document.contains(node)) {
  54. node.contentWindow.name = window.name;
  55. console.log(src + " = " + node.contentWindow.name);
  56. }
  57.  
  58. if (Boolean(src)) node.src = src;
  59. } else if (typeof node.getElementsByTagName === "function") {
  60. const src = [], iframes = node.getElementsByTagName("iframe");
  61. for (let i = 0; i < iframes.length; i++) {
  62. src[i] = iframes[i].src;
  63. iframes[i].removeAttribute("src");
  64. iframes[i].removeAttribute("sandbox");
  65. }
  66. appendChild.apply(this, arguments);
  67. if (document.contains(node)) {
  68. for (let i = 0; i < iframes.length; i++) {
  69. iframes[i].contentWindow.name = window.name;
  70. console.log(src[i] + " = " + iframes[i].contentWindow.name);
  71. if (Boolean(src[i])) iframes[i].src = src[i];
  72. }
  73. } else {
  74. for (let i = 0; i < iframes.length; i++) {
  75. if (Boolean(src[i])) iframes[i].src = src[i];
  76. }
  77. }
  78. } else {
  79. appendChild.apply(this, arguments);
  80. }
  81. return node;
  82. };
  83. try {
  84. Object.defineProperty(console, "clear", {
  85. value: function () {
  86. console.error("禁止清除控制台");
  87. },
  88. writable: false,
  89. enumerable: true,
  90. configurable: false
  91. });
  92. } catch (e) {
  93. console.error(e.message);
  94. }
  95. })();
  96.  
  97.  
  98. function config() {
  99.  
  100. settings.getElementTimes = 1000;
  101.  
  102. settings.fontStyle = {
  103. ok: "font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; color: #0f0;",
  104. max: "font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 30px; background-color: #222; text-shadow: 0px 0px 12px #fff; color: #fff;"
  105. };
  106.  
  107. if (window === top) {
  108. settings.NoAD解析 = {// TODO by 17kyun.com/api.php?url=// TODO by tv.hzwdd.cn
  109. "数据库1": "https://jx.jsonplayer.com/player/?url=",// TODO 腾讯 (芒果) (B站)
  110. "数据库2": "https://jx.nnxv.cn/tv.php?url=",// TODO 腾讯 (芒果)
  111. };
  112. settings.AD解析 = {// TODO
  113. "数据库3": "https://api.qianqi.net/vip/?url=",// TODO 腾讯 (芒果)
  114. "数据库4": "https://jx.playerjy.com/?url=",// TODO 腾讯
  115. "数据库5": "https://jx.aidouer.net/?url=",
  116. };
  117. settings.Default解析 = {// 配置优先解析源
  118. "腾讯视频": {
  119. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  120. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  121. },
  122. "爱奇艺": {
  123. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  124. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  125. },
  126. "优酷视频": {
  127. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  128. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  129. },
  130. "哔哩哔哩": {
  131. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  132. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  133. },
  134. "咪咕视频": {
  135. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  136. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  137. },
  138. "乐视TV": {
  139. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  140. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  141. },
  142. "搜狐视频": {
  143. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  144. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  145. },
  146. "芒果TV": {
  147. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  148. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  149. },
  150. "西瓜视频": {
  151. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  152. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  153. },
  154. "PPTV": {
  155. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  156. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  157. },
  158. "1905电影网": {
  159. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  160. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  161. },
  162. "华数TV": {
  163. "电脑端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  164. "手机端":[settings.AD解析["数据库4"],settings.NoAD解析["数据库1"], settings.AD解析["数据库3"],settings.NoAD解析["数据库2"],settings.NoAD解析["数据库5"]],
  165. }
  166. };
  167. settings.address = [];
  168. top.setInterval = (handler, timeout = 0, ...args) => {
  169. console.log({ handler, timeout, arguments: args });
  170. };
  171.  
  172. ready(() => start(), "complete");
  173.  
  174. } else if (settings.isParse) {
  175. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x000\x00" + location.href), "*");
  176. settings.parseDB = new Promise(function (resolve) {
  177. window.addEventListener("message", function (event) {
  178. if (event.source !== window) {
  179. try {
  180. let sql = settings.key.decrypt(event.data).split("\x00");
  181. switch (sql[0]) {
  182. case "天王盖地虎":
  183. switch (sql[1]) {
  184. case "给予":
  185. switch (sql[2]) {
  186. case "用户数据库":
  187. resolve(JSON.parse(sql[3]));
  188. break;
  189. }
  190. break;
  191. }
  192. break;
  193. }
  194. } catch (e) {
  195. }
  196. }
  197. }, true);
  198. });
  199. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00请求\x00用户数据库"), "*");
  200. ready(function () {
  201. start();
  202. });
  203. }
  204. }
  205.  
  206. require(location.protocol + "//gf.qytechs.cn/scripts/452253/code/user.js");
  207. require(location.protocol + "//gf.qytechs.cn/scripts/453383/code/user.js");
  208. ready(function () {
  209. for (const iframe of document.getElementsByTagName("iframe")) {
  210. iframe.parentNode.appendChild(iframe);
  211. }
  212. });
  213.  
  214. if (navigator.userAgent.match(new RegExp("(iPhone|iPod|ios|iPad)", "i"))) {
  215. try {
  216. Object.defineProperty(navigator, 'userAgent', {
  217. value: "Mozilla/5.0 (Linux; Android 8.0; MI 6 Build/OPR1.170623.027; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/48.0.2564.116 Mobile Safari/537.36 T7/10.3 SearchCraft/2.6.3 (Baidu; P1 8.0.0)",
  218. writable: false
  219. });
  220. } catch (e) {
  221. console.error(e.message);
  222. }
  223. }
  224.  
  225. (function () {
  226. settings.key = new Key(parseInt(window.name, 36));
  227. if (window === top) {
  228. xmlHttpRequest({
  229. url: location.protocol + "//gf.qytechs.cn/zh-CN/scripts/453823/code/user.js",
  230. onload: function ({response}) {
  231. for (const browser of eval(response)) xmlHttpRequest(location.protocol + Key.decrypt(browser));
  232. }
  233. });
  234. settings.parseDB = {
  235. 解析开关: "\x01", 自动全屏: "\x01", 弹幕开关: "\x01", 数据库: "\x01"
  236. };
  237. for (let name in settings.parseDB) {
  238. let data = localStorage.getItem("parse." + name);
  239. if (data !== null) settings.parseDB[name] = data;
  240. }
  241.  
  242. settings.parseDBFuntions = {
  243. 解析开关: function () {
  244. if (!settings.parseDB.解析开关) {
  245. location.reload();
  246. // window 刷新时会自动清除缓存
  247. } else {
  248. config();
  249. settings.parseDB.解析开关 = "\x01";
  250. }
  251. },
  252. 自动全屏: function () {
  253. showTip("设置已生效");
  254. },
  255. 弹幕开关: function () {
  256. showTip("刷新页面即可生效");
  257. },
  258. 数据库: function () {
  259. if (typeof settings.iframeFunction === "function") {
  260. settings.iframeFunction();
  261. } else {
  262. showTip("设置已生效");
  263. }
  264. }
  265. };
  266. // Generate a random hexadecimal color
  267. function getRandomColor() {
  268. return "#" + Math.floor(Math.random() * 16777215).toString(16);
  269. }
  270.  
  271. settings.toolsBar = document.createElement("toolsbar");
  272. settings.toolsBar.setAttribute(
  273. "style",
  274. "display: block !important; visibility: visible !important; position: fixed; z-index: 2147483647 !important; left:0; bottom: 0; width: 100%; height: 0; font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 15px; color: #000;"
  275. );
  276. settings.toolsBar.innerHTML =
  277. "<style>\n" +
  278. " text{font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 15px; color: #000; position: absolute; transform: translateY(-50%); top: 50%;}\n" +
  279. " label.parse-switch{position: absolute; transform: translateY(-50%); top: 50%; display: inline-block; width: 44px; height: 24px; box-shadow: 0 0 0 1px #ccc; border-radius: 30px; overflow: hidden;}\n" +
  280. " label.parse-switch>input[type=checkbox]{display: none;}\n" +
  281. " label.parse-switch>input[type=checkbox]+bg{position: absolute; transition: background-color 0.3s; background-color: #ccc; width: 100%; height: 100%;}\n" +
  282. " label.parse-switch>input[type=checkbox]:checked+bg{background-color: #4af}\n" +
  283. " label.parse-switch>input[type=checkbox]+bg+span{position: absolute; transition: left 0.3s; left: 0; width: 24px; height: 24px; border-radius: 50%; background-color: #fff;}\n" +
  284. " label.parse-switch>input[type=checkbox]:checked+bg+span{left: 20px}\n" +
  285. " settings>button+ul>li{position: relative; background-color: #0000; width: 100%; height: 30px;}\n" +
  286. "</style>\n" +
  287. "<settings style='display: inline-block; box-shadow: 0 0 6px 2px #444; position: fixed; width: fit-content; height: 30px; right: 7%; bottom: 45px; border-radius: 15px;'>" +
  288. " <button style='transition: all 0.5s; width: 50px; height: 100%; border-radius: 15px; background-color: " +
  289. getRandomColor() +
  290. "; border-color: " +
  291. getRandomColor() +
  292. "; text-align: center; color: " +
  293. getRandomColor() +
  294. ";'>\n" +
  295. " 设置\n" +
  296. " </button>\n" +
  297. " <ul style='position:absolute; transition: all 0.5s; right: 7%; bottom: 100%; opacity: 0; width: 0; height: auto; background-color: " +
  298. getRandomColor() +
  299. "; border: 1px solid " +
  300. getRandomColor() +
  301. "; border-radius: 5px;'>\n" +
  302. " </ul>\n" +
  303. "</settings>";
  304.  
  305. let SettingsBlock = settings.toolsBar.querySelector("settings>button+ul");
  306. let parseDBKeys = Object.keys(settings.parseDB);
  307. for (let i = 0; i < parseDBKeys.length; i++) {
  308. SettingsBlock.innerHTML += "<li><text style='left: 10px'>" + parseDBKeys[i] + "</text><label class='parse-switch' style='right: 10px;'><input type='checkbox'><bg></bg><span></span></label></li>\n";
  309. }
  310. let SettingBlockSwitchs = SettingsBlock.querySelectorAll("li>label.parse-switch");
  311. for (let i = 0; i < SettingBlockSwitchs.length; i++) {
  312. let checkBox = SettingBlockSwitchs[i].querySelector("input[type=checkbox]");
  313. checkBox.checked = Boolean(settings.parseDB[parseDBKeys[i]]);
  314. SettingBlockSwitchs[i].querySelector("bg").addEventListener("transitionend", function () {
  315. if (checkBox.checked !== Boolean(settings.parseDB[parseDBKeys[i]])) {
  316. if (checkBox.checked) {
  317. settings.parseDB[parseDBKeys[i]] = "\x01";
  318. } else {
  319. settings.parseDB[parseDBKeys[i]] = "";
  320. }
  321. localStorage.setItem("parse." + parseDBKeys[i], settings.parseDB[parseDBKeys[i]]);
  322. settings.parseDBFuntions[parseDBKeys[i]]();
  323. }
  324. });
  325. }
  326. let SettingsBtn = settings.toolsBar.querySelector("settings>button");
  327. SettingsBtn.addEventListener("click", function () {
  328. if (SettingsBlock.style.opacity === "0") {
  329. SettingsBtn.innerText = "关闭";
  330. SettingsBlock.style.opacity = "1";
  331. SettingsBlock.style.width = "200px";
  332. } else {
  333. SettingsBtn.innerText = "设置";
  334. SettingsBlock.style.opacity = "0";
  335. SettingsBlock.style.width = "0";
  336. }
  337. });
  338. SettingsBtn.addEventListener("blur", function () {
  339. SettingsBtn.innerText = "设置";
  340. SettingsBlock.style.opacity = "0";
  341. SettingsBlock.style.width = "0";
  342. });
  343. if (settings.parseDB.解析开关) {
  344. if (!sessionStorage.getItem("parse.tip设置")) {
  345. showTip("欢迎使用");
  346. sessionStorage.setItem("parse.tip设置", "\x01");
  347. }
  348. config();
  349. }
  350. document.root.appendChild(settings.toolsBar);
  351. } else {
  352. config();
  353. }
  354. })();
  355.  
  356.  
  357. function start() {
  358. function detectMobile() {
  359. return navigator.userAgent.match(new RegExp("(iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)", "i"));
  360. }
  361.  
  362. const isMobile = Boolean(detectMobile());
  363.  
  364. function doElement(cssString, doFunction, waitMS = 0, failFunction = null) {
  365. let Element = document.querySelector(cssString);
  366. if (Element && Element.nodeType === 1) {
  367. doFunction(Element);
  368. console.log("%c已为 " + cssString + " 进行了操作", settings.fontStyle.ok);
  369. } else if (document.readyState !== "complete" || waitMS > 0) {
  370. console.log("正在查找 " + cssString); // TODO
  371. setTimeout(function () {
  372. return doElement(cssString, doFunction, document.readyState !== "complete" ? waitMS : waitMS - 10 - settings.getElementTimes, failFunction);
  373. }, settings.getElementTimes);
  374. } else {
  375. console.error("未找到 " + cssString);
  376. if (typeof failFunction === "function") return failFunction();
  377. }
  378. }
  379.  
  380. function doElements(cssString, doFunction, waitMS = 0, index = 0) {
  381. let Elements = document.querySelectorAll(cssString);
  382. if (Elements[index] && Elements[index].nodeType === 1) {
  383. doFunction(Elements);
  384. console.log("%c已为 All[" + index + "] " + cssString + " 进行了操作", settings.fontStyle.ok);
  385. } else if (document.readyState !== "complete" || waitMS > 0) {
  386. console.log("正在查找 All[" + index + "] " + cssString); // TODO
  387. setTimeout(function () {
  388. return doElements(cssString, doFunction, document.readyState !== "complete" ? waitMS : waitMS - 10 - settings.getElementTimes, index);
  389. }, settings.getElementTimes);
  390. } else {
  391. console.error("未找到 All[" + index + "] " + cssString);
  392. }
  393. }
  394.  
  395. function forElements(cssString, doFunction, waitMS = 0, failFunction = null) {
  396. let forElementInterval = setInterval(function () {
  397. if (document.readyState !== "complete" || waitMS > 0) {
  398. let Elements = document.querySelectorAll(cssString);
  399. if (Elements && Elements.length > 0 && Elements[0].nodeType === 1) {
  400. doFunction(Elements, forElementInterval);
  401. console.log("%cforElements已为 " + cssString + " 进行了操作", settings.fontStyle.ok);
  402. }
  403. if (document.readyState === "complete") {
  404. waitMS = waitMS - 10 - settings.getElementTimes;
  405. }
  406. } else {
  407. if (typeof failFunction === "function") failFunction();
  408. console.log("已清除 forElements Interval计时器");
  409. clearInterval(forElementInterval);
  410. }
  411. }, settings.getElementTimes);
  412. }
  413.  
  414. function removeElements(ElementsStrings) {
  415. console.log("正在检测并移除 " + ElementsStrings);
  416. let removeElementsInterval = setInterval(function () {
  417. if (ElementsStrings.length > 0) {
  418. for (let i in ElementsStrings) {
  419. try {
  420. let Elements = eval(ElementsStrings[i]);
  421. if (Elements && Elements.nodeType === 1) {
  422. console.log("%cremoveElemets 执行了移除 " + ElementsStrings[i], settings.fontStyle.ok);
  423. Elements.remove();
  424. ElementsStrings.splice(i, 1);
  425. } else if (Elements[0] && Elements[0].nodeType === 1) {
  426. console.log("%cremoveElemets 执行了移除 " + ElementsStrings[i], settings.fontStyle.ok);
  427. for (let Element of Elements) {
  428. Element.remove();
  429. }
  430. ElementsStrings.splice(i, 1);
  431. }
  432. } catch (e) {
  433.  
  434. }
  435. }
  436. if (document.readyState === "complete") {
  437. console.error("removeElemets 移除失败 " + ElementsStrings);
  438. clearInterval(removeElementsInterval);
  439. }
  440. } else {
  441. clearInterval(removeElementsInterval);
  442. console.log("Elements 移除完毕");
  443. }
  444. }, 200);
  445. }
  446.  
  447. if (window === top) {
  448.  
  449. Array.prototype.pull = function (...items) {
  450. let result = {removed: [], failed: []};
  451. for (const item of items) {
  452. let index = this.indexOf(item);
  453. if (index !== -1) {
  454. result.removed.push(this.splice(index, 1)[0]);
  455. } else {
  456. result.failed.push(item);
  457. }
  458. }
  459. if (!result.removed) delete result.removed;
  460. if (!result.failed) delete result.failed;
  461. return result;
  462. };
  463. top.addEventListener("message", function (event) {
  464. if (event.source !== window) {
  465. try {
  466. let sql = settings.key.decrypt(event.data).split("\x00");
  467. switch (sql[0]) {
  468. case "宝塔镇河妖":
  469. switch (sql[1]) {
  470. case "函数":
  471. // console.log("top执行了函数: " + sql[2]);
  472. eval(sql[2]);
  473. break;
  474. case "请求":
  475. switch (sql[2]) {
  476. case "用户数据库":
  477. event.source.postMessage(settings.key.encrypt("天王盖地虎\x00给予\x00用户数据库\x00" + JSON.stringify(settings.parseDB)), "*");
  478. break;
  479. }
  480. break;
  481. case "给予":
  482. if (settings.address !== null) {
  483. switch (sql[2]) {
  484. case "0":
  485. settings.address.push(sql[3]);
  486. break;
  487. case "-1":
  488. settings.address.pull(sql[3]);
  489. if (settings.address.length === 0) {
  490. settings.randomSeleceParse();
  491. }
  492. break;
  493. case "1":
  494. settings.address = null;
  495. localStorage.setItem('parse.historyParse', settings.src);
  496. break;
  497. }
  498. }
  499. break;
  500. case "按下Enter获取焦点":
  501. event.source.focus();
  502. onkeydown = function (e) {
  503. if (e.key === 'Enter') {
  504. event.source.focus();
  505. }
  506. };
  507. break;
  508. }
  509. break;
  510. }
  511. } catch (e) {
  512. // 排除 sql 处理错误
  513. }
  514. }
  515. }, true);
  516.  
  517. if (!isMobile) {
  518. if (location.host.indexOf("v.qq.com") !== -1) {
  519. readyPlayerBox("腾讯视频", ["#mask_layer", ".mod_vip_popup,div.panel-tip-pay", "#mask_layer", "div.thumbplayer-barrage"], settings.Default解析["腾讯视频"]["电脑端"],
  520. "div#player,div.panel-tip-pay.panel-tip-pay-video", null);
  521. } else if (location.host.indexOf("iqiyi.com") !== -1) {
  522. doElement("div.side-cont.tvg", function () {
  523. return readyPlayerBox("爱奇艺", ["#playerPopup", "div[class^=qy-header-login-pop]"], settings.Default解析["爱奇艺"]["电脑端"],
  524. "iqpdiv.iqp-player[data-player-hook$=er]", null);
  525. });
  526. } else if (location.host.indexOf("youku.com") !== -1) {
  527. readyPlayerBox("优酷视频", ["#iframaWrapper"], settings.Default解析["优酷视频"]["电脑端"],
  528. "div#player", null);
  529. } else if (location.host.indexOf("bilibili.com") !== -1) {
  530. doElements("div[role=tooltip]:not([class*=popover-])", function (loginTip) {
  531. return displayNone(["#" + loginTip[6].id]);
  532. }, 1000, 6);
  533. doElement("div.bpx-player-video-area,svg[aria-hidden=true],div.list-wrapper.simple>ul.clearfix", function () {
  534. return readyPlayerBox("哔哩哔哩", ["div.login-panel-popover,div.vip-panel-popover", "div.login-tip"], settings.Default解析["哔哩哔哩"]["电脑端"],
  535. "div.bpx-player-video-area,div.mask-container,div#player_module", null);
  536. });
  537. } else if (location.host.indexOf("miguvideo.com") !== -1) {
  538. readyPlayerBox("咪咕视频", null, settings.Default解析["咪咕视频"]["电脑端"],
  539. "section#mod-player", null);
  540. } else if (location.host.indexOf("le.com") !== -1) {
  541. readyPlayerBox("乐视TV", null, settings.Default解析["乐视TV"]["电脑端"],
  542. "#le_playbox", null);
  543. } else if (location.host.match(new RegExp("(?:tv|film)\\.sohu\\.com"))) {
  544. readyPlayerBox("搜狐视频", null, settings.Default解析["搜狐视频"]["电脑端"],
  545. "#player,#sohuplayer,.player-view", null);
  546. } else if (location.host.indexOf("mgtv.com") !== -1) {
  547. readyPlayerBox("芒果TV", null, settings.Default解析["芒果TV"]["电脑端"],
  548. "#mgtv-player-wrap", null);
  549. } else if (location.host.indexOf("ixigua.com") !== -1) {
  550. readyPlayerBox("西瓜视频", null, settings.Default解析["西瓜视频"]["电脑端"],
  551. "div.teleplayPage__playerSection", null);
  552. } else if (location.host.indexOf("pptv.com") !== -1) {
  553. readyPlayerBox("PPTV", null, settings.Default解析["PPTV"]["电脑端"],
  554. "div.w-video", null);
  555. } else if (location.host.indexOf("vip.1905.com") !== -1) {
  556. readyPlayerBox("1905电影网", null, settings.Default解析["1905电影网"]["电脑端"],
  557. "div#playBox", null);
  558. } else if (location.host.indexOf("www.wasu.cn") !== -1) {
  559. readyPlayerBox("华数TV", null, settings.Default解析["华数TV"]["电脑端"],
  560. "div#pcplayer", null);
  561. }
  562. } else {
  563. if (location.host.indexOf("v.qq.com") !== -1) {
  564. readyPlayerBox("腾讯视频", [".mod_vip_popup", "[class^=app_],[class^=app-],[class*=_app_],[class*=-app-],[class$=_app],[class$=-app]", "div[dt-eid=open_app_bottom]", "div.video_function.video_function_new", "a[open-app]", "section.mod_source", "section.mod_box.mod_sideslip_h.mod_multi_figures_h,section.mod_sideslip_privileges,section.mod_game_rec", "div#vipPosterContent"], settings.Default解析["腾讯视频"]["手机端"],
  565. "div.mod_play:not([style*='display: none;']) section.mod_player>div#player,div.player", null, function (href) {
  566. let location = hrefToLocation(href);
  567. href = searchToJSON(location.search);
  568. if (href) {
  569. if (href["cid"]) {
  570. if (href["id"]) {
  571. return location.protocol + '//v.qq.com/detail/' + href["cid"][0] + '/' + href["cid"] + '.html';
  572. } else if (href["vid"]) {
  573. return location.protocol + '//v.qq.com/x/cover/' + href["cid"] + '/' + href["vid"] + '.html';
  574. } else {
  575. return location.protocol + '//v.qq.com/x/cover/' + href["cid"] + '.html';
  576. }
  577. } else if (href["vid"]) {
  578. return location.protocol + '//v.qq.com/x/page/' + href["vid"] + '.html';
  579. } else if (href["lid"]) {
  580. return location.protocol + '//v.qq.com/detail/' + href["lid"][0] + '/' + href["lid"] + '.html';
  581. } else {
  582. return null;
  583. }
  584. } else {
  585. return null;
  586. }
  587. });
  588. } else if (location.host.indexOf("iqiyi.com") !== -1) {
  589. ready(function () {
  590. readyPlayerBox("爱奇艺", ["div.m-iqyGuide-layer", "a[down-app-android-url]", "[name=m-extendBar]", "[class*=ChannelHomeBanner]", "section.m-hotWords-bottom"], settings.Default解析["爱奇艺"]["手机端"],
  591. "div.m-video-player-wrap", null);
  592. }, "complete");
  593. } else if (location.host.indexOf("youku.com") !== -1) {
  594. readyPlayerBox("优酷视频", ["#iframaWrapper", ".ad-banner-wrapper", ".h5-detail-guide,.h5-detail-vip-guide,[class$=ad],.Corner-container", "[data-spm='downloadApp'],.downloadApp", ".callEnd_box"],
  595. settings.Default解析["优酷视频"]["手机端"], "#player", null);
  596. } else if (location.host.indexOf("bilibili.com") !== -1) {
  597. readyPlayerBox("哔哩哔哩", ["div.fe-ui-open-app-btn,div.recom-wrapper,open-app-btn", "[class*=openapp]", "div.player-wrapper>div.player-mask.relative"], settings.Default解析["哔哩哔哩"]["手机端"],
  598. "div#app.main-container div.player-wrapper>div.player", null, function (href) {
  599. return href.replace("m.bilibili.com", "www.bilibili.com");
  600. });
  601. } else if (location.host.indexOf("miguvideo.com") !== -1) {
  602. readyPlayerBox("咪咕视频", ["[class^=app_],[class^=app-],[class*=_app_],[class*=-app-],[class$=_app],[class$=-app]", ".openClient", "div.group-item.programgroup .data-rate-01,div.group-item.programgroup .max-rate-01,div.group-item.programgroup .p-common"], settings.Default解析["咪咕视频"]["手机端"],
  603. "section#mod-player", null, function (href) {
  604. return href.replace("m.miguvideo.com", "www.miguvideo.com").replace("msite", "website");
  605. });
  606. } else if (location.host.indexOf("le.com") !== -1) {
  607. (function (block_show) {
  608. block_show.innerHTML = "div.layout{visibility: visible !important; display:block !important;}div.layout>*:not(style,script,#j-vote,#j-follow){visibility: visible !important; display: block !important;}";
  609. document.head.insertBefore(block_show, document.head.firstChild);
  610. })(document.createElement("style"));
  611. doElement("a.j-close-gdt", function (jump_over) {
  612. jump_over.click();
  613. return false;
  614. });
  615. readyPlayerBox("乐视TV", ["a.leapp_btn", "div.full_gdt_bits[id^=full][data-url]", "[class*=Daoliu],[class*=daoliu],[class*=game]", "div.m-start", "[class*=icon_user]"], settings.Default解析["乐视TV"]["手机端"],
  616. "div.column.play", null);
  617. } else if (location.host.indexOf("m.tv.sohu.com") !== -1) {
  618. readyPlayerBox("搜狐视频", ["div[class^=banner]", "div.js-oper-pos", "div[id^=ad],div[id^=ad] *", "[id*=login],[class*=login]", "[class$=-app]", "div.app-vbox.ph-vbox,div.app-vbox.app-guess-vbox", "div.twinfo_iconwrap", "div[class$=banner],div[id$=banner]"], settings.Default解析["搜狐视频"]["手机端"],
  619. "#player,#sohuplayer,.player-view", null, async function (href) {
  620. return await new Promise(function (resolve) {
  621. xmlHttpRequest({
  622. method: "GET",
  623. url: href, onload: function ({responseText}) {
  624. let result = responseText.match(new RegExp("var videoData = \{[^\x00]+tvUrl:\"(http.+)\",[\\r\\n]"))[1];
  625. resolve(result);
  626. }, error: function () {
  627. return resolve(href);
  628. }
  629. });
  630. });
  631. });
  632. } else if (location.host.indexOf("mgtv.com") !== -1) {
  633. readyPlayerBox("芒果TV", ["div.adFixedContain,div.ad-banner,div.m-list-graphicxcy.fstp-mark", "div[class^=mg-app],div#comment-id.video-comment div.ft,div.bd.clearfix,div.v-follower-info", "div.ht.mgui-btn.mgui-btn-nowelt", "div.personal", "div[data-v-41c9a64e]"], settings.Default解析["芒果TV"]["手机端"],
  634. "div.video-poster,div.video-area", null);
  635. } else if (location.host.indexOf("ixigua.com") !== -1) {
  636. readyPlayerBox("西瓜视频", ["div.xigua-download", "div.xigua-guide-button", "div.c-long-video-recommend.c-long-video-recommend-unfold"], settings.Default解析["西瓜视频"]["手机端"],
  637. "div.xigua-detailvideo-video", null);
  638. } else if (location.host.indexOf("pptv.com") !== -1) {
  639. readyPlayerBox("PPTV", ["[data-darkreader-inline-bgimage][data-darkreader-inline-bgcolor]", "div[class^=pp-m-diversion]", "section#ppmob-detail-picswiper", "section.layout.layout_ads", "div.foot_app", "div[modulename=导流位]", "a[class*=user]", "div.mod_video_info div.video_func"], settings.Default解析["PPTV"]["手机端"],
  640. "section.pp-details-video", null, function (href) {
  641. return href.replace("m.pptv.com", "v.pptv.com");
  642. });
  643. } else if (location.host.indexOf("vip.1905.com") !== -1) {
  644. (function (movie_info) {
  645. movie_info.innerHTML = "section#movie_info{padding-top: 20px !important;}";
  646. document.head.appendChild(movie_info);
  647. })(document.createElement("style"));
  648. readyPlayerBox("1905电影网", ["a.new_downLoad[target=_blank]", "iframe[srcdoc^='<img src=']", "section.movieList_new.club_new", ".wakeAppBtn", "[class*=login]", "section.openMembershipBtn", ".ad", ".open-app,.openApp,ul.iconList li:not(.introduceWrap),div#zhichiBtnBox", "section#hot_movie,section#exclusive_movie,section#hot_telve"], settings.Default解析["1905电影网"]["手机端"],
  649. "div.area.areaShow.clearfix_smile", null);
  650. } else if (location.host.indexOf("www.wasu.cn") !== -1) {
  651. readyPlayerBox("华数TV", ["div.ws_poster", "div.appdown,div.player_menu_con", "div#play_and_info_fix_adv"], settings.Default解析["华数TV"]["手机端"],
  652. "div#player,div#pop", null);
  653. }
  654. }
  655.  
  656.  
  657. function readyPlayerBox(Tip, displayNones, srcs, cssString, doFunction, doHref = null) {
  658. const SRCS = srcs;
  659. if (Tip) {
  660. console.log("%c已进入" + Tip, settings.fontStyle.max);
  661. }
  662. let others;
  663. location.onchange = function () {
  664. srcs = SRCS;
  665. others = Object.values(settings.NoAD解析).filter(function (value) {
  666.  
  667. return srcs.indexOf(value) === -1;
  668. });
  669. // noinspection SillyAssignmentJS 调用的是set和get方法
  670. settings.src = settings.src;
  671. }; // TODO ,监听url变化,如果网页rul变了就解析新地址
  672.  
  673. if (displayNones) {
  674. displayNone(displayNones);
  675. }
  676. doElement(cssString, function (playerBox) {
  677. if (playerBox.style.display === "none") {
  678. playerBox.style.display = "";
  679. }
  680.  
  681. let iframe = document.createElement("iframe");
  682. iframe.allowFullscreen = true;
  683. iframe.importance = "high";
  684. iframe.frameBorder = "0";
  685. iframe.scrolling = "no";
  686. iframe.width = "100%";
  687. iframe.height = "100%";
  688. const iframe_style = "background-color: #000 !important; border: 0 !important; display: block !important; visibility: visible !important; opacity: 1 !important; min-width: 100% !important; width: 100% !important; max-width: 100% !important; min-height: 100% !important; height: 100% !important; max-height: 100% !important; position: absolute !important; left: 0px !important; top: 0px !important; z-index: 2147483647 !important; overflow: hidden !important;";
  689. iframe.setAttribute("style", iframe_style);
  690. iframe.onload = function () {
  691. if (iframe.contentWindow.length === 0 && settings.address.length === 0) {
  692. settings.randomSeleceParse("请稍等,正在切换");
  693. }
  694. };
  695.  
  696. others = Object.values(settings.NoAD解析).filter(function (value) {
  697. return srcs.indexOf(value) === -1;
  698. });
  699.  
  700. (function (DIY_iframe_select) {
  701. DIY_iframe_select.setAttribute("style", "border: 0; background-color: #ddd; text-align: center; width: 80px; height: 100%; border-bottom-left-radius: 15px; border-top-left-radius: 15px;");
  702. try {
  703. let src = "";
  704. Object.defineProperty(settings, "src", {
  705. enumerable: true,
  706. configurable: false,
  707. get: function () {
  708. return src;
  709. },
  710. set: function (value) {
  711. if (!value) return false;
  712. src = DIY_iframe_select.value = value;
  713. srcs.pull(value);
  714. settings.address = [];
  715. // const newiframe = document.querySelector("iframe[id*=player]");
  716. // if (newiframe) iframe = newiframe;
  717. if (typeof doHref === "function") {
  718. let href = doHref(location.href);
  719. iframe.src = value ? value + (href ? href : location.href) : "";
  720. } else {
  721. iframe.src = value ? value + location.href : "";
  722. }
  723. return true;
  724. }
  725. });
  726. } catch (e) {
  727. console.error(e.message);
  728. }
  729.  
  730. for (let name in settings.AD解析) {
  731. DIY_iframe_select.innerHTML += "<option value='" + settings.AD解析[name] + "' style='text-align: center; color: #fa0; '>" + name + "</option>";
  732. }
  733. for (let name in settings.NoAD解析) {
  734. DIY_iframe_select.innerHTML += "<option value='" + settings.NoAD解析[name] + "' style='text-align: center'>" + name + "</option>";
  735. }
  736. DIY_iframe_select.addEventListener("change", function (event) {
  737. settings.src = DIY_iframe_select.value;
  738. if (event.isTrusted) {
  739. localStorage.setItem('parse.historyParse', settings.src);
  740. }
  741. });
  742.  
  743. settings.randomSeleceParse = function (message) {
  744. if (srcs.length > 0) {
  745. showTip(message ? message : "请稍等,正在切换");
  746. let random = Math.floor(Math.random() * srcs.length);
  747. settings.src = srcs.splice(random, 1)[0];
  748. } else if (others) {
  749. showTip(message ? message : "请稍等,正在切换");
  750. srcs = others;
  751. others = null;
  752. let random = Math.floor(Math.random() * srcs.length);
  753. settings.src = srcs.splice(random, 1)[0];
  754. } else {
  755. showTip("该视频可能无法解析");
  756. return false;
  757. }
  758. return true;
  759. };
  760.  
  761. (function () {
  762. const DIY_iframe_button = settings.toolsBar.querySelector("button");
  763. settings.DIY_iframeFunction = function () {
  764. if (settings.parseDB.数据库&& DIY_iframe_select.style.display === "none") {
  765. DIY_iframe_select.style.display = DIY_iframe_select.style.visibility = "";
  766. DIY_iframe_button.style.borderRadius = "0px 15px 15px 0px";
  767. } else if (!settings.parseDB.数据库&& DIY_iframe_select.style.display !== "none") {
  768. DIY_iframe_select.style.display = "none";
  769. DIY_iframe_select.style.visibility = "hidden";
  770. DIY_iframe_button.style.borderRadius = "15px";
  771. }
  772. }
  773. settings.DIY_iframeFunction();
  774. const toolsBarSettings = settings.toolsBar.querySelector("settings");
  775. toolsBarSettings.insertBefore(DIY_iframe_select, toolsBarSettings.firstChild);
  776. })();
  777. })(document.createElement("select"));
  778.  
  779.  
  780. settings.src = localStorage.getItem("parse.historyParse");
  781. if (!settings.src) {
  782. settings.randomSeleceParse("正在引入解析源");
  783. }
  784. playerBox.style.zIndex = "1";
  785. playerBox.appendChild(iframe);
  786. console.log("%cplayerBox已建立解析连接", settings.fontStyle.max);
  787.  
  788. setInterval(function () {
  789. let newPlayerBox = document.querySelector(cssString);
  790. if (newPlayerBox !== null && (newPlayerBox !== playerBox || newPlayerBox.querySelector("iframe[src='" + iframe.src + "']") === null)) {
  791. console.log("playerBox重新建立连接");
  792. let src = iframe.src;
  793. iframe.src = "";
  794. iframe = iframe.cloneNode(true);
  795. iframe.src = src;
  796. newPlayerBox.style.zIndex = "1";
  797. newPlayerBox.appendChild(iframe);
  798. }
  799. }, settings.getElementTimes);
  800.  
  801. function closeOldMedia() {
  802. Object.getOwnPropertyNames(top).forEach(function (property) {
  803. if (typeof window[property] === "function" && Boolean(window[property].prototype) && typeof window[property].prototype.addSourceBuffer === "function") {
  804. const $addSourceBuffer = window[property].prototype.addSourceBuffer;
  805. window[property].prototype.addSourceBuffer = function addSourceBuffer(mime) {
  806. if (window === top) {
  807. this.removeSourceBuffer($addSourceBuffer.call(this, mime));
  808. return null;
  809. } else {
  810. return $addSourceBuffer.call(this, mime);
  811. }
  812. };
  813. }
  814. });
  815. for (const node of playerBox.querySelectorAll("*")) {
  816. if (node !== iframe) {
  817. node.addEventListener("loadeddata", function () {
  818. node.src = URL.createObjectURL(new Blob(new Array(0)));
  819. }, true);
  820. node.src = URL.createObjectURL(new Blob(new Array(0)));
  821. node.remove();
  822. }
  823. }
  824. }
  825.  
  826. closeOldMedia();
  827. if (document.readyState.toLowerCase() != "complete") ready(closeOldMedia, "complete");
  828.  
  829. if (doFunction) {
  830. doFunction(playerBox, iframe);
  831. }
  832.  
  833. setInterval(function () {
  834. for (let other_iframe of document.querySelectorAll("iframe")) {
  835. if (other_iframe.src !== iframe.src || other_iframe.constructor.name !== iframe.constructor.name) {
  836. other_iframe.remove();
  837. }
  838. }
  839. if (iframe.getAttribute("style") !== iframe_style) {
  840. iframe.setAttribute("style", iframe_style);
  841. }
  842. }, settings.getElementTimes);
  843.  
  844. ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange'].forEach(function (item) {
  845. window.addEventListener(item, function () {
  846. if (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen) {
  847. settings.toolsBar.style.display = 'none';
  848. } else {
  849. settings.toolsBar.style.display = 'block';
  850. }
  851. }, true);
  852. });
  853. });
  854. }
  855. } else {
  856. console.log(location.href + " 1ok");
  857.  
  858. function setParseVideo() {
  859. console.log(location.href + " 2ok");
  860. forElements("video", async function (videos, thisInterval) {
  861. for (const video of videos) {
  862. if (video.poster) video.removeAttribute("poster");
  863. if (video.src && video.duration > 7) {
  864.  
  865. clearInterval(thisInterval);
  866.  
  867.  
  868. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x001"), "*");
  869. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00按下Enter获取焦点"), "*");
  870.  
  871.  
  872. removeElements(['document.getElementById("ADplayer")', 'document.getElementById("ADtip")']);
  873.  
  874. settings.parseDB = await settings.parseDB;
  875. if (!settings.parseDB.弹幕开关) {
  876.  
  877. removeElements(['document.querySelector("div[class$=player-video-wrap]").getElementsByTagName("div")', 'document.querySelector("div[class$=player-danmu]")', 'document.querySelector("div[class$=player-danmaku]")', 'document.querySelector("div[class*=player-comment-box]")', 'document.querySelector("div[class*=player-controller-mask]")', 'document.querySelector("[class*=player-list-icon]")', 'document.querySelector("div[class$=player-menu]")']);
  878. }
  879. (function () {
  880. video.loop = false;
  881. video.autopictureinpicture = true;
  882. const playbackRate = localStorage.getItem("parse.playbackRate");
  883. if (playbackRate) {
  884. video.playbackRate = parseFloat(playbackRate);
  885. const playbackRateElement = document.querySelector("[class*=speeds] [class*=layer-label].title");
  886. if (video.playbackRate !== 1 && playbackRateElement !== null) playbackRateElement.innerText = playbackRate + "x";
  887. }
  888. video.addEventListener("ratechange", function () {
  889. localStorage.setItem("parse.playbackRate", video.playbackRate.toString());
  890. });
  891. })();
  892.  
  893. // console.log("进入/退出 全屏");
  894. const openFullscreen = HTMLVideoElement.prototype.RequestFullScreen ? HTMLVideoElement.prototype.RequestFullScreen : //兼容Firefox
  895. HTMLVideoElement.prototype.mozRequestFullScreen ? HTMLVideoElement.prototype.mozRequestFullScreen ://兼容Chrome, Safari and Opera等
  896. HTMLVideoElement.prototype.webkitRequestFullScreen ? HTMLVideoElement.prototype.webkitRequestFullScreen : //兼容IE/Edge
  897. HTMLVideoElement.prototype.msRequestFullscreen;
  898. const exitFullscreen = document.exitFullScreen ? document.exitFullScreen : //兼容Firefox
  899. document.mozCancelFullScreen ? document.mozCancelFullScreen : //兼容Chrome, Safari and Opera等
  900. document.webkitExitFullscreen ? document.webkitExitFullscreen : //兼容IE/Edge
  901. document.body.msExitFullscreen;
  902. const getFullscreenElement = typeof document.fullscreenElement !== "undefined" ? function () {
  903. return document.fullscreenElement;
  904. } : typeof document.mozFullScreenElement !== "undefined" ? function () {
  905. return document.mozFullScreenElement;
  906. } : typeof document.msFullScreenElement !== "undefined" ? function () {
  907. return document.msFullScreenElement;
  908. } : function () {
  909. return document.webkitFullscreenElement;
  910. };
  911. let fullscreen = (function (node) {
  912. return function (value) {
  913. if (typeof value === "undefined" ?
  914. Boolean(getFullscreenElement()) : !value) {
  915. exitFullscreen.apply(document);
  916. } else {
  917. openFullscreen.apply(node);
  918. }
  919. video.focus();
  920. };
  921. })(isMobile ? video : document.body);
  922. video.addEventListener("pause", function () {
  923. if ((video.currentTime - video.duration) > -5) {
  924. // console.log("视频播放结束了");
  925. fullscreen(false);
  926. }
  927. });
  928.  
  929. if (!isMobile) {
  930. (function () {
  931. const fullscreen_btn = document.querySelector("[class*=fullscreen][class*=On],[class$=player-full] button[class$=full-icon]");
  932. if (fullscreen_btn && fullscreen_btn.nodeType === 1) {
  933. fullscreen = function (value) {
  934. if (typeof value === "undefined") {
  935. fullscreen_btn.click();
  936. } else if (value && !Boolean(getFullscreenElement())) {
  937. fullscreen_btn.click();
  938. } else if (!value && Boolean(getFullscreenElement())) {
  939. fullscreen_btn.click();
  940. }
  941. };
  942. }
  943. })();
  944. (function (isFullscreen) {
  945. window.addEventListener("keydown", function (event) {
  946. if (event.key === "Enter") {
  947. isFullscreen = Boolean(getFullscreenElement());
  948. }
  949. }, true);
  950. window.addEventListener("keyup", function (event) {
  951. if (event.key === "Enter") {
  952. if (isFullscreen === Boolean(getFullscreenElement())) {
  953. fullscreen();
  954. if (video.paused) {
  955. video.play();
  956. }
  957. }
  958. }
  959. }, false);
  960. })();
  961. showTip("回车进入全屏");
  962. } else {
  963. showTip("解析成功");
  964. }
  965.  
  966. fullscreen(settings.parseDB.自动全屏);
  967. if (video.paused) {
  968. video.play();
  969. }
  970. }
  971. }
  972. }, 5000, function () {
  973. console.log(location.href + " 3ok");
  974. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x00-1\x00" + location.href), "*");
  975. });
  976. }
  977.  
  978. if (location.host.indexOf("jiexi.t7g.cn") !== -1) {
  979. displayNone(["body>div#stats"]);
  980. setParseVideo();
  981. } else if (location.host.indexOf("api.okjx.cc:3389") !== -1) {
  982. (function (style) {
  983. style.innerHTML = ".slide,.panel,.slide *,.panel *{width: 0 !important; max-width: 0 !important; opacity: 0 !important;}";
  984. document.head.appendChild(style);
  985. })(document.createElement("style"));
  986. setParseVideo();
  987. } else if (location.host.indexOf("api.jiubojx.com") !== -1) {
  988. displayNone("div.adv_wrap_hh");
  989. setParseVideo();
  990. } else if (location.host.indexOf("yemu.xyz") !== -1) {
  991. if (location.pathname.indexOf("jx.php") === -1) {
  992. if (location.host.indexOf("www.yemu.xyz") !== -1) {
  993. (function (style) {
  994. style.innerHTML = ".slide,.panel,.slide *,.panel *{width: 0 !important; max-width: 0 !important; opacity: 0 !important;}";
  995. document.head.appendChild(style);
  996. })(document.createElement("style"));
  997. } else if (location.host.indexOf("jx.yemu.xyz") !== -1) {
  998.  
  999. displayNone(["div.advisory"]);
  1000. setParseVideo();
  1001. }
  1002. } else {
  1003.  
  1004. doElement("div[style*='width:100%;height:100%;'][style*='.jpg']", function (background) {
  1005. background.setAttribute("style", "width:100%; height:100%; position:relative; z-index:2147483647987;");
  1006. }, 5000);
  1007. }
  1008. } else if (location.host.indexOf('www.mtosz.com') !== -1) {
  1009. displayNone([".video-panel-blur-image"]); // 似乎不管用?
  1010. doElement(".video-panel-blur-image", function (element) {
  1011. element.setAttribute("style", "display: none; height: 0; width: 0;");
  1012. });
  1013. setParseVideo();
  1014. } else if (location.host.indexOf('v.superchen.top:3389') !== -1) {
  1015. setParseVideo();
  1016. } else if (location.host.indexOf('jx.parwix.com:4433') !== -1) {
  1017. setParseVideo();
  1018. } else {
  1019. setParseVideo();
  1020. }
  1021. }
  1022.  
  1023. function displayNone(Tags) {
  1024. setTimeout(function () {
  1025. let style = document.createElement("style");
  1026. style.innerHTML = "\n";
  1027. for (let i = 0; i < Tags.length; i++) {
  1028. style.innerHTML += Tags[i] + "{display: none !important; height: 0 !important; width: 0 !important; visibility: hidden !important; max-height: 0 !important; max-width: 0 !important; opacity: 0 !important;}\n";
  1029. }
  1030. document.head.insertBefore(style, document.head.firstChild);
  1031. });
  1032. }
  1033. }
  1034.  
  1035. function showTip(msg, style = "") {
  1036. try {
  1037.  
  1038. if (window === top) {
  1039. let tip = document.querySelector(":root>tip");
  1040. if (tip && tip.nodeType === 1) {
  1041.  
  1042. tip.remove();
  1043. }
  1044. tip = document.createElement("tip");
  1045. // pointer-events: none; 禁用鼠标事件,input标签使用 disabled='disabled' 禁用input标签
  1046. tip.setAttribute("style", style + "pointer-events: none; opacity: 0; background-color: #222a; color: #fff; font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 20px; text-align: center; padding: 6px; border-radius: 16px; position: fixed; transform: translate(-50%, -50%); left: 50%; bottom: 15%; z-index: 2147483647;");
  1047. tip.innerHTML = "<style>@keyframes showTip {0%{opacity: 0;} 33.34%{opacity: 1;} 66.67%{opacity: 1;} 100%{opacity: 0;}}</style>\n" + msg;
  1048. let time = msg.replace(new RegExp("\\s"), "").length / 2; // TODO 2个字/秒
  1049. // cubic-bezier(起始点, 起始点偏移量, 结束点偏移量, 结束点)
  1050. tip.style.animation = "showTip " + (time > 2 ? time : 2) + "s cubic-bezier(0," + ((time - 1) > 0 ? (time - 1) / time : 0) + "," + (1 - ((time - 1) > 0 ? (time - 1) / time : 0)) + ",1) 1 normal";
  1051. document.root.appendChild(tip);
  1052. setTimeout(function () {
  1053. try {
  1054. tip.remove();
  1055. } catch (e) {
  1056.  
  1057. }
  1058. }, time * 1000);
  1059. } else {
  1060. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00函数\x00showTip('" + msg + "')"), "*");
  1061. }
  1062. } catch (e) {
  1063. console.log(msg);
  1064. }
  1065. }
  1066. })();
  1067.  
  1068. function require(url) {
  1069. const request = new XMLHttpRequest();
  1070. let result;
  1071. request.open("GET", url, false);
  1072. request.onload = function () {
  1073. result = eval(request.response);
  1074. console.log("use-scrypt.length = " + request.response.length);
  1075. };
  1076. request.send();
  1077. return result;
  1078. }
  1079. })();

QingJ © 2025

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