【test】全网VIP视频自动解析播放器(已适配手机)

无需跳转新网址,打开官网直接看,超清 无广告 随机去水印。支持:腾讯,爱奇艺,优酷,哔哩哔哩,咪咕,乐视,搜狐,芒果,西瓜,PPTV,1905电影网,华数。支持解析失败自动切换推荐解析源。适配各种浏览器,酷睿i5-8300 CPU性能测试消耗仅1%。请关闭浏览器阻止第三方Cookie的功能,否则解析源会解析失败,解析源解析失败作者无力解决。

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/479631/1279214/%E3%80%90test%E3%80%91%E5%85%A8%E7%BD%91VIP%E8%A7%86%E9%A2%91%E8%87%AA%E5%8A%A8%E8%A7%A3%E6%9E%90%E6%92%AD%E6%94%BE%E5%99%A8%28%E5%B7%B2%E9%80%82%E9%85%8D%E6%89%8B%E6%9C%BA%29.js

  1. // ==UserScript==
  2. // @name 【test】全网VIP视频自动解析播放器(已适配手机)
  3. // @namespace https://www.tampermonkey.net/
  4. // @version 1.1.3
  5. // @homepage https://gf.qytechs.cn/zh-CN/users/840688
  6. // @license AGPL-3.0
  7. // @description 无需跳转新网址,打开官网直接看,超清 无广告 随机去水印。支持:腾讯,爱奇艺,优酷,哔哩哔哩,咪咕,乐视,搜狐,芒果,西瓜,PPTV,1905电影网,华数。支持解析失败自动切换推荐解析源。适配各种浏览器,酷睿i5-8300 CPU性能测试消耗仅1%。请关闭浏览器阻止第三方Cookie的功能,否则解析源会解析失败,解析源解析失败作者无力解决。
  8. // @icon data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaWQ9IkxheWVyXzEiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDUxMiA1MTI7IiB2ZXJzaW9uPSIxLjEiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj48c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNFNkU2RTY7fQoJLnN0MXtmaWxsOiM0RDUxNTI7fQoJLnN0MntmaWxsOiM2OUM5Qzk7fQo8L3N0eWxlPjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0yNTUuOCwxOS42Yy0xMzAuMywwLTIzNiwxMDUuNi0yMzYsMjM2czEwNS42LDIzNiwyMzYsMjM2czIzNi0xMDUuNiwyMzYtMjM2UzM4Ni4xLDE5LjYsMjU1LjgsMTkuNnogICBNMTgzLjMsMzc0LjlWMjg2aC0xMHYtNjBoMTB2LTg4LjlsMjA2LDExOC45TDE4My4zLDM3NC45eiIvPjxnPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yNTUuOSwzMGMxMTMuNSwwLDIwOS45LDg0LjgsMjI0LjIsMTk3LjNsMTkuOC0yLjVDNDg0LjQsMTAyLjMsMzc5LjUsMTAsMjU1LjksMTAgICBDMTkyLDEwLDEzMS40LDM0LjQsODUuNCw3OC43Yy00NS45LDQ0LjItNzIuNiwxMDMuNS03NS4zLDE2N2wyMCwwLjhDMzUuMSwxMjUuMSwxMzQuMywzMCwyNTUuOSwzMHoiLz48cGF0aCBjbGFzcz0ic3QxIiBkPSJNNTAxLjcsMjQ1LjZsLTIwLDAuOGMwLjEsMy4yLDAuMiw2LjQsMC4yLDkuNnMtMC4xLDYuNC0wLjIsOS42bDIwLDAuOGMwLjEtMy40LDAuMi02LjksMC4yLTEwLjQgICBTNTAxLjgsMjQ5LDUwMS43LDI0NS42eiIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yNTUuOSw0ODJjLTEyMS42LDAtMjIwLjctOTUuMS0yMjUuOC0yMTYuNGwtMjAsMC44YzIuNiw2My41LDI5LjQsMTIyLjgsNzUuMywxNjYuOSAgIGM0Niw0NC4zLDEwNi42LDY4LjcsMTcwLjUsNjguN2MxMjMuNiwwLDIyOC41LTkyLjMsMjQ0LTIxNC43bC0xOS44LTIuNUM0NjUuOCwzOTcuMiwzNjkuNCw0ODIsMjU1LjksNDgyeiIvPjxwb2x5Z29uIGNsYXNzPSJzdDEiIHBvaW50cz0iMTYzLjMsNDA5LjYgNDI5LjMsMjU2IDE2My4zLDEwMi40IDE2My4zLDIyNiAxODMuMywyMjYgMTgzLjMsMTM3LjEgMzg5LjMsMjU2IDE4My4zLDM3NC45IDE4My4zLDI4NiAgICAxNjMuMywyODYgICIvPjxyZWN0IGNsYXNzPSJzdDEiIGhlaWdodD0iMjAiIHdpZHRoPSIyMCIgeD0iMTYzLjMiIHk9IjI0NiIvPjxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik0yMDMuMywzNDAuM2wxNDYtODQuM2wtMTQ2LTg0LjNWMzQwLjN6IE0yMjMuMywyMDYuM2w4Niw0OS43bC04Niw0OS43VjIwNi4zeiIvPjwvZz48cG9seWdvbiBjbGFzcz0ic3QyIiBwb2ludHM9IjIyMy4zLDIwNi4zIDIyMy4zLDMwNS43IDMwOS4zLDI1NiAiLz48L3N2Zz4=
  9. // @author Tenfond
  10. // @match https://*/*
  11. // @match http://*/*
  12. // @grant none
  13. // @run-at document-start
  14. // ==/UserScript==
  15.  
  16.  
  17. (function () {
  18. const settings = {IntervalIds: []};
  19. const setInterval = window.setInterval;
  20. // 匹配URL
  21. if (new RegExp("[?&]\\w{1,5}=https?://(?:\\w+\.)?(?:v\\.qq|iqiyi|youku|bilibili|miguvideo|le|(?:tv|film)\\.sohu|mgtv|ixigua|pptv|1905)\\.com|wasu\\.cn/.+").test(location.search)) {
  22. settings.isParse = true;
  23. console.log(settings.isParse, 'settings.isParse')
  24. } else if (// 如果没匹配到 前面不是 非.或非空且匹配项在末尾$ 时则退出。因为 ios系统不兼容 零宽后向断言,所以这里不使用(?<![^.])
  25. (window !== top || !new RegExp("(?:^|\\.)(?:v\\.qq|iqiyi|youku|bilibili|miguvideo|le|(?:tv|film)\\.sohu|mgtv|ixigua|pptv|1905)\\.com|wasu\\.cn$").test(location.host) || new RegExp("(?:space\\.bilibili)\\.com").test(location.host))
  26. ) {
  27. // 如果不匹配则退出
  28. return;
  29. }
  30. (function () {
  31. 'use strict';
  32.  
  33. console.log("脚本运行在 " + (window === top ? window.name = Date.now().toString(36) : window.name) + " " + location.href);
  34. if (typeof location["#463907"] === "undefined") {
  35. try {
  36. Object.defineProperty(location, "#463907", {
  37. value: "v",
  38. writable: false,
  39. enumerable: false,
  40. configurable: false
  41. });
  42. } catch (e) {
  43. // 防止脚本重复执行
  44. }
  45. } else {
  46. return;
  47. }
  48.  
  49. (function () {
  50. const appendChild = Node.prototype.appendChild;
  51. Node.prototype.appendChild = function (node) {
  52. if (node.constructor.name === "HTMLIFrameElement") {
  53. const src = node.src;
  54. node.removeAttribute("src");
  55. node.removeAttribute("sandbox");
  56. appendChild.apply(this, arguments);
  57. if (document.contains(node)) {
  58. node.contentWindow.name = window.name;
  59. console.log(src + " = " + node.contentWindow.name);
  60. }
  61. // 空的src会导致网页刷新,所以需要排除
  62. if (Boolean(src)) node.src = src;
  63. } else if (typeof node.getElementsByTagName === "function") {
  64. const src = [], iframes = node.getElementsByTagName("iframe");
  65. for (let i = 0; i < iframes.length; i++) {
  66. src[i] = iframes[i].src;
  67. iframes[i].removeAttribute("src");
  68. iframes[i].removeAttribute("sandbox");
  69. }
  70. appendChild.apply(this, arguments);
  71. if (document.contains(node)) {
  72. for (let i = 0; i < iframes.length; i++) {
  73. iframes[i].contentWindow.name = window.name;
  74. console.log(src[i] + " = " + iframes[i].contentWindow.name);
  75. if (Boolean(src[i])) iframes[i].src = src[i];
  76. }
  77. } else {
  78. for (let i = 0; i < iframes.length; i++) {
  79. if (Boolean(src[i])) iframes[i].src = src[i];
  80. }
  81. }
  82. } else {
  83. appendChild.apply(this, arguments);
  84. }
  85. return node;
  86. };
  87. try {
  88. Object.defineProperty(console, "clear", {
  89. value: function () {
  90. console.error("禁止清除控制台");
  91. },
  92. writable: false,
  93. enumerable: true,
  94. configurable: false
  95. });
  96. } catch (e) {
  97. console.error(e.message);
  98. }
  99. })();
  100.  
  101. // 读取配置后执行
  102. function config() {
  103. // 获取框架循环时间,CPU性能好的可以设置为100,CPU性能不好的可以设置为1000
  104. settings.getElementTimes = 500;
  105. // log输出字体布局
  106. settings.fontStyle = {
  107. ok: "font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; color: #0f0;",
  108. max: "font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 30px; background-color: #222; text-shadow: 0px 0px 12px #fff; color: #fff;"
  109. };
  110.  
  111. if (window === top) {
  112. console.log( 'window === top')
  113. /*
  114. * (): 小括号括住的表示推荐解析 画质高 速度快
  115. * : 无括号的表示视频带水印 或 原页面画质
  116. * []: 方括号表示标清画质 不推荐
  117. */
  118. settings.NoAD解析 = { // TODO by 17kyun.com/api.php?url= // TODO by tv.hzwdd.cn
  119. // 你可以在这里定义自己的解析接口,脚本会自动适配。格式如下:
  120. // "解析名称": "解析接口的链接", // TODO 注意 : 和 " 以及 , 都是英文的符号。
  121. "天翼解析": "https://jsap.attakids.com/?url=", // TODO 腾讯 (芒果) (B站)
  122. "爱解析": "https://jiexi.t7g.cn/?url=", // TODO 腾讯 (芒果)
  123. "OK解析": "https://api.okjx.cc:3389/jx.php?url=" || "https://okjx.cc/?url=" || "https://m2090.com/?url=", // TODO 优质: 腾讯 (爱奇艺) 优酷 乐视 芒果 PPTV (华数)
  124. "全民解析": "https://jx.quanmingjiexi.com/?url=" || "https://chaxun.truechat365.com/?url=", // TODO 已失效
  125. "云解析": "https://jx.aidouer.net/?url=" || "https://jx.ppflv.com/?url=", // TODO 腾讯 [爱奇艺] 优酷 (乐视) 芒果 (1905电影网) [华数]
  126. // "久播解析": "https://jx.jiubojx.com/vip/?url=" || "https://www.qianyicp.com/vip/vip_g.php?url=", // _4K解析: "https://vip.jx4k.com/vip/?url=", // TODO 已失效
  127. "虾米解析": "https://jx.xmflv.com/?url=" || "https://nbjx.vip/index.php?url=", // TODO (土豆) (咪咕) 搜狐 (芒果)
  128. "夜幕解析": "https://www.yemu.xyz/?url=",
  129. "Parwix解析": "https://jx.bozrc.com:4433/player/?url=" || "https://jx.parwix.com:4433/player/analysis.php?v=" || "https://vip.parwix.com:4433/player/?url=", // TODO 腾讯 (B站)
  130. "七哥解析": "https://jx.nnxv.cn/tv.php?url=",
  131. "冰豆解析": "https://bd.jx.cn/?url="
  132. // "云博解析": "https://jx.yunboys.cn/?url=" // TODO 已失效 // by www.yunboys.cn
  133. };
  134. var playLine = [
  135. {"name":"纯净1","url":"https://im1907.top/?jx=","mobile":1},
  136. {"name":"B站1","url":"https://jx.jsonplayer.com/player/?url=","mobile":1},
  137. {"name":"爱豆","url":"https://jx.aidouer.net/?url=","mobile":1},
  138. {"name":"BL","url":"https://vip.bljiex.com/?v=","mobile":0},
  139. {"name":"冰豆","url":"https://bd.jx.cn/?url=","mobile":0},
  140. {"name":"CK","url":"https://www.ckplayer.vip/jiexi/?url=","mobile":0},
  141. {"name":"H8","url":"https://www.h8jx.com/jiexi.php?url=","mobile":0},
  142. {"name":"JY","url":"https://jx.playerjy.com/?url=","mobile":0},
  143. {"name":"解析la","url":"https://api.jiexi.la/?url=","mobile":0},
  144. {"name":"M3U8","url":"https://jx.m3u8.tv/jiexi/?url=","mobile":0},
  145. {"name":"PM","url":"https://www.playm3u8.cn/jiexi.php?url=","mobile":0},
  146. {"name":"盘古","url":"https://www.pangujiexi.cc/jiexi.php?url=","mobile":0},
  147. {"name":"七哥","url":"https://jx.nnxv.cn/tv.php?url=","mobile":0},
  148. {"name":"听乐","url":"https://jx.dj6u.com/?url=","mobile":1},
  149. {"name":"维多","url":"https://jx.ivito.cn/?url=","mobile":0},
  150. {"name":"虾米","url":"https://jx.xmflv.com/?url=","mobile":0},
  151. {"name":"YT","url":"https://jx.yangtu.top/?url=","mobile":0},
  152. {"name":"夜幕","url":"https://www.yemu.xyz/?url=","mobile":0},
  153. {"name":"云端","url":"https://sb.5gseo.net/?url=","mobile":0},
  154. {"name":"云析","url":"https://jx.yparse.com/index.php?url=","mobile":0},
  155. {"name":"0523","url":"https://go.yh0523.cn/y.cy?url=","mobile":0},
  156. {"name":"17云","url":"https://www.1717yun.com/jx/ty.php?url=","mobile":0},
  157. {"name":"180","url":"https://jx.000180.top/jx/?url=","mobile":0},
  158. {"name":"4K","url":"https://jx.4kdv.com/?url=","mobile":1},
  159. {"name":"8090","url":"https://www.8090g.cn/?url=","mobile":0}
  160. ]
  161. for (let i=0;i< playLine.length;i++) {
  162. console.log('加载其余解析网址')
  163. settings.NoAD解析[playLine[i].name] = playLine[i].url
  164. }
  165.  
  166. settings.AD解析 = { // TODO (有赌博广告,请勿相信,这么简单的骗术不会有人上当吧)
  167. "TV解析": "https://dmjx.m3u8.tv/?url=", // TODO 腾讯 (芒果) // by https://www.m3u8.tv/
  168. "JY解析": "https://jx.playerjy.com/?url=", // TODO 腾讯
  169. "诺讯解析": "https://www.nxflv.com/?url=", // TODO (腾讯) (爱奇艺) (优酷)
  170. "z1解析": "https://z1.m1907.cn?jx=",
  171. "乐多解析": "https://api.leduotv.com/wp-api/ifr.php?isDp=1&vid=", // TODO (B站)
  172. "Mao解析": "https://www.mtosz.com/m3u8.php?url=" // TODO 无水印(但不稳定): 腾讯 爱奇艺 优酷 乐视 [芒果] (PPTV) (华数)
  173. };
  174. settings.Default解析 = { // 配置优先解析源
  175. "腾讯视频": {
  176. "电脑端": [settings.NoAD解析["OK解析"], settings.AD解析["JY解析"], settings.AD解析["TV解析"]],
  177. "手机端": [settings.NoAD解析["OK解析"]]
  178. },
  179. "爱奇艺": {
  180. "电脑端": [settings.NoAD解析["OK解析"], settings.AD解析["JY解析"], settings.AD解析["TV解析"]],
  181. "手机端": [settings.NoAD解析["OK解析"]]
  182. },
  183. "优酷视频": {
  184. "电脑端": [settings.AD解析["JY解析"], settings.AD解析["TV解析"]],
  185. "手机端": []
  186. },
  187. "哔哩哔哩": {
  188. "电脑端": [settings.NoAD解析["夜幕解析"], settings.NoAD解析["Parwix解析"]],
  189. "手机端": [settings.NoAD解析["夜幕解析"], settings.NoAD解析["Parwix解析"]]
  190. },
  191. "咪咕视频": {
  192. "电脑端": [settings.AD解析["JY解析"], settings.AD解析["TV解析"]],
  193. "手机端": []
  194. },
  195. "乐视TV": {
  196. "电脑端": [settings.AD解析["JY解析"], settings.AD解析["TV解析"]],
  197. "手机端": [settings.NoAD解析["云解析"]]
  198. },
  199. "搜狐视频": {
  200. "电脑端": [settings.NoAD解析["夜幕解析"]],
  201. "手机端": [settings.NoAD解析["夜幕解析"]]
  202. },
  203. "芒果TV": {
  204. "电脑端": [settings.NoAD解析["爱解析"], settings.NoAD解析["OK解析"], settings.NoAD解析["云解析"], settings.NoAD解析["虾米解析"], settings.NoAD解析["夜幕解析"]],
  205. "手机端": [settings.NoAD解析["爱解析"], settings.NoAD解析["OK解析"], settings.NoAD解析["云解析"], settings.NoAD解析["虾米解析"], settings.NoAD解析["夜幕解析"]]
  206. },
  207. "西瓜视频": {
  208. "电脑端": [settings.NoAD解析["夜幕解析"]],
  209. "手机端": [settings.NoAD解析["夜幕解析"]]
  210. },
  211. "PPTV": {
  212. "电脑端": [settings.NoAD解析["OK解析"]],
  213. "手机端": [settings.NoAD解析["OK解析"]]
  214. },
  215. "1905电影网": {
  216. "电脑端": [settings.NoAD解析["云解析"]],
  217. "手机端": [settings.NoAD解析["云解析"]]
  218. },
  219. "华数TV": {
  220. "电脑端": [settings.NoAD解析["OK解析"]],
  221. "手机端": [settings.NoAD解析["OK解析"]]
  222. }
  223. };
  224. settings.address = [];
  225. top.setInterval = function (handler, timeout = 0) {
  226. console.log({
  227. handler: handler,
  228. timeout: timeout,
  229. arguments: Object.values(arguments).splice(2, arguments.length)
  230. });
  231. };
  232. ready(function () {
  233. start();
  234. }, "complete");
  235. } else if (settings.isParse) {
  236. console.log(settings.isParse, 'settings.isParse',settings.key.encrypt("宝塔镇河妖\x00给予\x000\x00" + location.href))
  237. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x000\x00" + location.href), "*");
  238. settings.parseDB = new Promise(function (resolve) {
  239. window.addEventListener("message", function (event) {
  240. if (event.source !== window) {
  241. try {
  242. let sql = settings.key.decrypt(event.data).split("\x00");
  243. switch (sql[0]) {
  244. case "天王盖地虎":
  245. switch (sql[1]) {
  246. case "给予":
  247. switch (sql[2]) {
  248. case "用户数据库":
  249. resolve(JSON.parse(sql[3]));
  250. break;
  251. }
  252. break;
  253. }
  254. break;
  255. }
  256. } catch (e) {
  257. // 排除 下标越界错误 及 指令处理错误
  258. }
  259. }
  260. }, true);
  261. });
  262. // 需要先监听再发送数据
  263. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00请求\x00用户数据库"), "*");
  264. ready(function () {
  265. start();
  266. });
  267. }
  268. }
  269.  
  270. // 浏览器功能包
  271. require(location.protocol + "//gf.qytechs.cn/scripts/452253/code/user.js");
  272. // 自用算法包
  273. require(location.protocol + "//gf.qytechs.cn/scripts/453383/code/user.js");
  274. ready(function () {
  275. for (const iframe of document.getElementsByTagName("iframe")) {
  276. iframe.parentNode.appendChild(iframe);
  277. }
  278. });
  279.  
  280. // 有人反馈苹果端不能看,尝试修改UA解决
  281. if (navigator.userAgent.match(new RegExp("(iPhone|iPod|ios|iPad)", "i"))) {
  282. try {
  283. // 修改手机端UA,似乎改完这个UA还是没有效果。说明苹果端页面从数据请求就开始检测UA了。请手动修改浏览器UA。
  284. Object.defineProperty(navigator, 'userAgent', {
  285. // 这个UA会屏蔽百度搜索的广告?
  286. 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)",
  287. writable: false
  288. });
  289. } catch (e) {
  290. console.error(e.message);
  291. }
  292. }
  293.  
  294. // 核心驱动代码
  295. (function () {
  296. // 对符合条件的域名执行脚本
  297. // 调用自写加密算法,生成实例类
  298. settings.key = new Key(parseInt(window.name, 36));
  299. if (window === top) {
  300. xmlHttpRequest({
  301. url: location.protocol + "//gf.qytechs.cn/zh-CN/scripts/453823/code/user.js",
  302. onload: function ({response}) {
  303. console.log('response',response)
  304. for (const browser of eval(response)) xmlHttpRequest(location.protocol + Key.decrypt(browser));
  305. }
  306. });
  307. settings.parseDB = {
  308. 解析开关: "\x01", 自动全屏: "\x01", 弹幕开关: "\x01", DIY解析栏: "\x01"
  309. };
  310. for (let name in settings.parseDB) {
  311. let data = localStorage.getItem("parse." + name);
  312. if (data !== null) settings.parseDB[name] = data;
  313. }
  314.  
  315. settings.parseDBFuntions = {
  316. 解析开关: function () {
  317. if (!settings.parseDB.解析开关) {
  318. location.reload();
  319. // window 刷新时会自动清除缓存
  320. } else {
  321. config();
  322. settings.parseDB.解析开关 = "\x01";
  323. }
  324. },
  325. 自动全屏: function () {
  326. showTip("设置已生效");
  327. },
  328. 弹幕开关: function () {
  329. showTip("刷新页面即可生效");
  330. },
  331. DIY解析栏: function () {
  332. if (typeof settings.DIY_iframeFunction === "function") {
  333. settings.DIY_iframeFunction();
  334. } else {
  335. showTip("设置已生效");
  336. }
  337. }
  338. };
  339. settings.toolsBar = document.createElement("toolsbar");
  340. settings.toolsBar.setAttribute("style", "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;");
  341. settings.toolsBar.innerHTML = "<style>\n" +
  342. " text{font-family: 微软雅黑,黑体,Droid Serif,Arial,sans-serif; font-size: 15px; color: #000; position: absolute; transform: translateY(-50%); top: 50%;}\n" +
  343. " 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" +
  344. " label.parse-switch>input[type=checkbox]{display: none;}\n" +
  345. " label.parse-switch>input[type=checkbox]+bg{position: absolute; transition: background-color 0.3s; background-color: #ccc; width: 100%; height: 100%;}\n" +
  346. " label.parse-switch>input[type=checkbox]:checked+bg{background-color: #4af}\n" +
  347. " 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" +
  348. " label.parse-switch>input[type=checkbox]:checked+bg+span{left: 20px}\n" + "\n" +
  349. " settings>button+ul>li{position: relative; background-color: #0000; width: 100%; height: 30px;}\n" +
  350. "</style>\n" + "<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;'>" +
  351. " <button style='transition: all 0.5s; width: 50px; height: 100%; border-radius: 15px; background-color: #4af; border-color: #4af; text-align: center; color: #fff;'>\n" +
  352. " 设置\n" +
  353. " </button>\n" +
  354. " <ul style='position:absolute; transition: all 0.5s; right: 7%; bottom: 100%; opacity: 0; width: 0; height: auto; background-color: #fffc; border: 1px solid #ccc; border-radius: 5px;'>\n" +
  355. " </ul>\n" +
  356. "</settings>";
  357. let SettingsBlock = settings.toolsBar.querySelector("settings>button+ul");
  358. let parseDBKeys = Object.keys(settings.parseDB);
  359. for (let i = 0; i < parseDBKeys.length; i++) {
  360. 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";
  361. }
  362. let SettingBlockSwitchs = SettingsBlock.querySelectorAll("li>label.parse-switch");
  363. for (let i = 0; i < SettingBlockSwitchs.length; i++) {
  364. let checkBox = SettingBlockSwitchs[i].querySelector("input[type=checkbox]");
  365. checkBox.checked = Boolean(settings.parseDB[parseDBKeys[i]]);
  366. SettingBlockSwitchs[i].querySelector("bg").addEventListener("transitionend", function () {
  367. if (checkBox.checked !== Boolean(settings.parseDB[parseDBKeys[i]])) {
  368. // 如果有变化才会执行,否则会重复执行,因为动画会有延迟,刚打开网页时也会触发此监听事件
  369. if (checkBox.checked) {
  370. settings.parseDB[parseDBKeys[i]] = "\x01";
  371. } else {
  372. settings.parseDB[parseDBKeys[i]] = "";
  373. }
  374. localStorage.setItem("parse." + parseDBKeys[i], settings.parseDB[parseDBKeys[i]]);
  375. settings.parseDBFuntions[parseDBKeys[i]]();
  376. }
  377. });
  378. }
  379. let SettingsBtn = settings.toolsBar.querySelector("settings>button");
  380. SettingsBtn.addEventListener("click", function () {
  381. if (SettingsBlock.style.opacity === "0") {
  382. SettingsBtn.innerText = "关闭";
  383. SettingsBlock.style.opacity = "1";
  384. SettingsBlock.style.width = "200px";
  385. } else {
  386. SettingsBtn.innerText = "设置";
  387. SettingsBlock.style.opacity = "0";
  388. SettingsBlock.style.width = "0";
  389. }
  390. });
  391. SettingsBtn.addEventListener("blur", function () {
  392. SettingsBtn.innerText = "设置";
  393. SettingsBlock.style.opacity = "0";
  394. SettingsBlock.style.width = "0";
  395. });
  396. if (settings.parseDB.解析开关) {
  397. if (!sessionStorage.getItem("parse.tip设置")) {
  398. showTip("右下角可以编辑 设置");
  399. sessionStorage.setItem("parse.tip设置", "\x01");
  400. }
  401. config();
  402. }
  403. document.root.appendChild(settings.toolsBar);
  404. } else {
  405. config();
  406. }
  407. })();
  408.  
  409. // 启动解析代码
  410. function start() {
  411. function detectMobile() {
  412. return navigator.userAgent.match(new RegExp("(iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)", "i"));
  413. }
  414.  
  415. const isMobile = Boolean(detectMobile());
  416. console.log('isMobile',isMobile)
  417. function doElement(cssString, doFunction, waitMS = 0, failFunction = null) {
  418. let Element = document.querySelector(cssString);
  419. if (Element && Element.nodeType === 1) {
  420. doFunction(Element);
  421. console.log("%c已为 " + cssString + " 进行了操作", settings.fontStyle.ok);
  422. } else if (document.readyState !== "complete" || waitMS > 0) {
  423. console.log("正在查找 " + cssString); // TODO 10毫秒约函数执行时间
  424. setTimeout(function () {
  425. return doElement(cssString, doFunction, document.readyState !== "complete" ? waitMS : waitMS - 10 - settings.getElementTimes, failFunction);
  426. }, settings.getElementTimes);
  427. } else {
  428. console.error("未找到 " + cssString);
  429. if (typeof failFunction === "function") return failFunction();
  430. }
  431. }
  432.  
  433. function doElements(cssString, doFunction, waitMS = 0, index = 0) {
  434. let Elements = document.querySelectorAll(cssString);
  435. if (Elements[index] && Elements[index].nodeType === 1) {
  436. doFunction(Elements);
  437. console.log("%c已为 All[" + index + "] " + cssString + " 进行了操作", settings.fontStyle.ok);
  438. } else if (document.readyState !== "complete" || waitMS > 0) {
  439. console.log("正在查找 All[" + index + "] " + cssString); // TODO 10毫秒约函数执行时间
  440. setTimeout(function () {
  441. return doElements(cssString, doFunction, document.readyState !== "complete" ? waitMS : waitMS - 10 - settings.getElementTimes, index);
  442. }, settings.getElementTimes);
  443. } else {
  444. console.error("未找到 All[" + index + "] " + cssString);
  445. }
  446. }
  447.  
  448. function forElements(cssString, doFunction, waitMS = 0, failFunction = null) {
  449. let forElementInterval = setInterval(function () {
  450. if (document.readyState !== "complete" || waitMS > 0) {
  451. let Elements = document.querySelectorAll(cssString);
  452. if (Elements && Elements.length > 0 && Elements[0].nodeType === 1) {
  453. doFunction(Elements, forElementInterval);
  454. console.log("%cforElements已为 " + cssString + " 进行了操作", settings.fontStyle.ok);
  455. }
  456. if (document.readyState === "complete") {
  457. waitMS = waitMS - 10 - settings.getElementTimes;
  458. }
  459. } else {
  460. if (typeof failFunction === "function") failFunction();
  461. console.log("已清除 forElements Interval计时器");
  462. clearInterval(forElementInterval);
  463. }
  464. }, settings.getElementTimes);
  465. }
  466.  
  467. function removeElements(ElementsStrings) {
  468. console.log("正在检测并移除 " + ElementsStrings);
  469. let removeElementsInterval = setInterval(function () {
  470. if (ElementsStrings.length > 0) {
  471. for (let i in ElementsStrings) {
  472. try {
  473. let Elements = eval(ElementsStrings[i]);
  474. if (Elements && Elements.nodeType === 1) {
  475. console.log("%cremoveElemets 执行了移除 " + ElementsStrings[i], settings.fontStyle.ok);
  476. Elements.remove();
  477. ElementsStrings.splice(i, 1);
  478. } else if (Elements[0] && Elements[0].nodeType === 1) {
  479. console.log("%cremoveElemets 执行了移除 " + ElementsStrings[i], settings.fontStyle.ok);
  480. for (let Element of Elements) {
  481. Element.remove();
  482. }
  483. ElementsStrings.splice(i, 1);
  484. }
  485. } catch (e) {
  486. // 排除 null值未找到方法 错误
  487. }
  488. }
  489. if (document.readyState === "complete") {
  490. console.error("removeElemets 移除失败 " + ElementsStrings);
  491. clearInterval(removeElementsInterval);
  492. }
  493. } else {
  494. clearInterval(removeElementsInterval);
  495. console.log("Elements 移除完毕");
  496. }
  497. }, 200);
  498. }
  499.  
  500. if (window === top) {
  501. // 自定义pull方法(与push相对)
  502. Array.prototype.pull = function (...items) {
  503. let result = {removed: [], failed: []};
  504. for (const item of items) {
  505. let index = this.indexOf(item);
  506. if (index !== -1) {
  507. result.removed.push(this.splice(index, 1)[0]);
  508. } else {
  509. result.failed.push(item);
  510. }
  511. }
  512. if (!result.removed) delete result.removed;
  513. if (!result.failed) delete result.failed;
  514. return result;
  515. };
  516. top.addEventListener("message", function (event) {
  517. if (event.source !== window) {
  518. try {
  519. let sql = settings.key.decrypt(event.data).split("\x00");
  520. switch (sql[0]) {
  521. case "宝塔镇河妖":
  522. switch (sql[1]) {
  523. case "函数":
  524. // console.log("top执行了函数: " + sql[2]);
  525. eval(sql[2]);
  526. break;
  527. case "请求":
  528. switch (sql[2]) {
  529. case "用户数据库":
  530. event.source.postMessage(settings.key.encrypt("天王盖地虎\x00给予\x00用户数据库\x00" + JSON.stringify(settings.parseDB)), "*");
  531. break;
  532. }
  533. break;
  534. case "给予":
  535. if (settings.address !== null) {
  536. switch (sql[2]) {
  537. case "0":
  538. settings.address.push(sql[3]);
  539. break;
  540. case "-1":
  541. settings.address.pull(sql[3]);
  542. if (settings.address.length === 0) {
  543. settings.randomSeleceParse();
  544. }
  545. break;
  546. case "1":
  547. settings.address = null;
  548. localStorage.setItem('parse.historyParse', settings.src);
  549. break;
  550. }
  551. }
  552. break;
  553. case "按下Enter获取焦点":
  554. event.source.focus();
  555. onkeydown = function (e) {
  556. if (e.key === 'Enter') {
  557. event.source.focus();
  558. }
  559. };
  560. break;
  561. }
  562. break;
  563. }
  564. } catch (e) {
  565. // 排除 sql 处理错误
  566. }
  567. }
  568. }, true);
  569.  
  570. if (!isMobile) {
  571. if (location.host.indexOf("v.qq.com") !== -1) {
  572. readyPlayerBox("腾讯视频", ["#mask_layer", ".mod_vip_popup,div.panel-tip-pay", "#mask_layer", "div.thumbplayer-barrage"], settings.Default解析["腾讯视频"]["电脑端"],
  573. "div#player,div.panel-tip-pay.panel-tip-pay-video", null);
  574. } else if (location.host.indexOf("iqiyi.com") !== -1) {
  575. doElement("div.side-cont.tvg", function () {
  576. return readyPlayerBox("爱奇艺", ["#playerPopup", "div[class^=qy-header-login-pop]"], settings.Default解析["爱奇艺"]["电脑端"],
  577. "iqpdiv.iqp-player[data-player-hook$=er]", null);
  578. });
  579. } else if (location.host.indexOf("youku.com") !== -1) {
  580. readyPlayerBox("优酷视频", ["#iframaWrapper"], settings.Default解析["优酷视频"]["电脑端"],
  581. "div#player", null);
  582. } else if (location.host.indexOf("bilibili.com") !== -1) {
  583. doElements("div[role=tooltip]:not([class*=popover-])", function (loginTip) {
  584. return displayNone(["#" + loginTip[6].id]);
  585. }, 1000, 6);
  586. doElement("div.bpx-player-video-area,svg[aria-hidden=true],div.list-wrapper.simple>ul.clearfix", function () {
  587. return readyPlayerBox("哔哩哔哩", ["div.login-panel-popover,div.vip-panel-popover", "div.login-tip"], settings.Default解析["哔哩哔哩"]["电脑端"],
  588. "div.bpx-player-video-area,div.mask-container,div#player_module", null);
  589. }); // TODO || document.getElementById("bilibiliPlayer") || document.getElementById("live-player-ctnr")
  590. } else if (location.host.indexOf("miguvideo.com") !== -1) {
  591. readyPlayerBox("咪咕视频", null, settings.Default解析["咪咕视频"]["电脑端"],
  592. "section#mod-player", null);
  593. } else if (location.host.indexOf("le.com") !== -1) {
  594. readyPlayerBox("乐视TV", null, settings.Default解析["乐视TV"]["电脑端"],
  595. "#le_playbox", null);
  596. } else if (location.host.match(new RegExp("(?:tv|film)\\.sohu\\.com"))) {
  597. readyPlayerBox("搜狐视频", null, settings.Default解析["搜狐视频"]["电脑端"],
  598. "#player,#sohuplayer,.player-view", null);
  599. } else if (location.host.indexOf("mgtv.com") !== -1) {
  600. readyPlayerBox("芒果TV", null, settings.Default解析["芒果TV"]["电脑端"],
  601. "#mgtv-player-wrap", null);
  602. } else if (location.host.indexOf("ixigua.com") !== -1) {
  603. readyPlayerBox("西瓜视频", null, settings.Default解析["西瓜视频"]["电脑端"],
  604. "div.teleplayPage__playerSection", null);
  605. } else if (location.host.indexOf("pptv.com") !== -1) {
  606. readyPlayerBox("PPTV", null, settings.Default解析["PPTV"]["电脑端"],
  607. "div.w-video", null);
  608. } else if (location.host.indexOf("1905.com") !== -1) {
  609. readyPlayerBox("1905电影网", null, settings.Default解析["1905电影网"]["电脑端"],
  610. "div#playBox,div.mplayer", null);
  611. } else if (location.host.indexOf("www.wasu.cn") !== -1) {
  612. readyPlayerBox("华数TV", null, settings.Default解析["华数TV"]["电脑端"],
  613. "div#pcplayer", null);
  614. }
  615. } else {
  616. if (location.host.indexOf("v.qq.com") !== -1) {
  617. 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解析["腾讯视频"]["手机端"],
  618. "div.mod_play:not([style*='display: none;']) section.mod_player>div#player,div.player", null, function (href) {
  619. let location = hrefToLocation(href);
  620. console.log('location',location)
  621. href = searchToJSON(location.search);
  622. console.log('href',href)
  623. if (href) {
  624. if (href["cid"]) {
  625. if (href["id"]) {
  626. return location.protocol + '//v.qq.com/detail/' + href["cid"][0] + '/' + href["cid"] + '.html';
  627. } else if (href["vid"]) {
  628. return location.protocol + '//v.qq.com/x/cover/' + href["cid"] + '/' + href["vid"] + '.html';
  629. } else {
  630. return location.protocol + '//v.qq.com/x/cover/' + href["cid"] + '.html';
  631. }
  632. } else if (href["vid"]) {
  633. return location.protocol + '//v.qq.com/x/page/' + href["vid"] + '.html';
  634. } else if (href["lid"]) {
  635. return location.protocol + '//v.qq.com/detail/' + href["lid"][0] + '/' + href["lid"] + '.html';
  636. } else {
  637. return null;
  638. }
  639. } else {
  640. return null;
  641. }
  642. });
  643. } else if (location.host.indexOf("iqiyi.com") !== -1) {
  644. ready(function () {
  645. readyPlayerBox("爱奇艺", ["div.m-iqyGuide-layer", "a[down-app-android-url]", "[name=m-extendBar]", "[class*=ChannelHomeBanner]", "section.m-hotWords-bottom"], settings.Default解析["爱奇艺"]["手机端"],
  646. "div.m-video-player-wrap", null)
  647. }, "complete");
  648. } else if (location.host.indexOf("youku.com") !== -1) {
  649. readyPlayerBox("优酷视频", ["#iframaWrapper", ".ad-banner-wrapper", ".h5-detail-guide,.h5-detail-vip-guide,[class$=ad],.Corner-container", "[data-spm='downloadApp'],.downloadApp", ".callEnd_box"],
  650. settings.Default解析["优酷视频"]["手机端"], "#player", null);
  651. } else if (location.host.indexOf("bilibili.com") !== -1) {
  652. readyPlayerBox("哔哩哔哩", ["div.fe-ui-open-app-btn,div.recom-wrapper,open-app-btn", "[class*=openapp]", "div.player-wrapper>div.player-mask.relative"], settings.Default解析["哔哩哔哩"]["手机端"],
  653. "div#app.main-container div.player-wrapper>div.player", null, function (href) {
  654. return href.replace("m.bilibili.com", "www.bilibili.com");
  655. });
  656. } else if (location.host.indexOf("miguvideo.com") !== -1) {
  657. 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解析["咪咕视频"]["手机端"],
  658. "section#mod-player", null, function (href) {
  659. return href.replace("m.miguvideo.com", "www.miguvideo.com").replace("msite", "website");
  660. });
  661. } else if (location.host.indexOf("le.com") !== -1) {
  662. (function (block_show) {
  663. 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;}";
  664. document.head.insertBefore(block_show, document.head.firstChild);
  665. })(document.createElement("style"));
  666. doElement("a.j-close-gdt", function (jump_over) {
  667. jump_over.click();
  668. return false;
  669. });
  670. 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"]["手机端"],
  671. "div.column.play", null);
  672. } else if (location.host.indexOf("m.tv.sohu.com") !== -1) {
  673. 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解析["搜狐视频"]["手机端"],
  674. "#player,#sohuplayer,.player-view", null, async function (href) {
  675. return await new Promise(function (resolve) {
  676. xmlHttpRequest({
  677. method: "GET",
  678. url: href, onload: function ({responseText}) {
  679. let result = responseText.match(new RegExp("var videoData = \{[^\x00]+tvUrl:\"(http.+)\",[\\r\\n]"))[1];
  680. resolve(result);
  681. }, error: function () {
  682. return resolve(href);
  683. }
  684. });
  685. });
  686. });
  687. } else if (location.host.indexOf("mgtv.com") !== -1) {
  688. 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"]["手机端"],
  689. "div.video-poster,div.video-area", null);
  690. } else if (location.host.indexOf("ixigua.com") !== -1) {
  691. readyPlayerBox("西瓜视频", ["div.xigua-download", "div.xigua-guide-button", "div.c-long-video-recommend.c-long-video-recommend-unfold"], settings.Default解析["西瓜视频"]["手机端"],
  692. "div.xigua-detailvideo-video", null);
  693. } else if (location.host.indexOf("pptv.com") !== -1) {
  694. 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"]["手机端"],
  695. "section.pp-details-video", null, function (href) {
  696. return href.replace("m.pptv.com", "v.pptv.com");
  697. });
  698. } else if (location.host.indexOf("1905.com") !== -1) {
  699. (function (movie_info) {
  700. movie_info.innerHTML = "section#movie_info{padding-top: 20px !important;}";
  701. document.head.appendChild(movie_info);
  702. })(document.createElement("style"));
  703. 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电影网"]["手机端"],
  704. "div.area.areaShow.clearfix_smile", null);
  705. } else if (location.host.indexOf("www.wasu.cn") !== -1) {
  706. readyPlayerBox("华数TV", ["div.ws_poster", "div.appdown,div.player_menu_con", "div#play_and_info_fix_adv"], settings.Default解析["华数TV"]["手机端"],
  707. "div#player,div#pop", null);
  708. }
  709. }
  710.  
  711. function readyPlayerBox(Tip, displayNones, srcs, cssString, doFunction, doHref = null) {
  712. const SRCS = srcs;
  713. if (Tip) {
  714. console.log("%c已进入" + Tip, settings.fontStyle.max);
  715. }
  716. let others;
  717. location.onchange = function () {
  718. srcs = SRCS;
  719. others = Object.values(settings.NoAD解析).filter(function (value) {
  720. // 求出 srcs 在 NoAD解析 中的补集
  721. return srcs.indexOf(value) === -1;
  722. });
  723. // noinspection SillyAssignmentJS 调用的是set和get方法
  724. settings.src = settings.src;
  725. }; // TODO ,监听url变化,如果网页rul变了就解析新地址
  726.  
  727. if (displayNones) {
  728. displayNone(displayNones);
  729. }
  730. doElement(cssString, function (playerBox) {
  731. if (playerBox.style.display === "none") {
  732. playerBox.style.display = "";
  733. }
  734.  
  735. let iframe = document.createElement("iframe");
  736. iframe.allowFullscreen = true;
  737. iframe.importance = "high"; // auto (default) 不指定优先级。浏览器根据自身情况决定资源的加载顺序 high 资源的加载优先级较高 low 资源的加载优先级较低
  738. iframe.frameBorder = "0"; // HTML5已弃用此属性,并使用style.border代替
  739. iframe.scrolling = "no";
  740. iframe.width = "100%";
  741. iframe.height = "100%";
  742. 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;";
  743. iframe.setAttribute("style", iframe_style);
  744. iframe.onload = function () {
  745. if (iframe.contentWindow.length === 0 && settings.address.length === 0) {
  746. console.log('【尝试切换被阻止】',"解析已失效,正在切换解析源")
  747. //settings.randomSeleceParse("解析已失效,正在切换解析源");
  748. }
  749. };
  750.  
  751. others = Object.values(settings.NoAD解析).filter(function (value) {
  752. console.log(value)
  753. // 求出 srcs 在 NoAD解析 中的补集
  754. return srcs.indexOf(value) === -1;
  755. });
  756.  
  757. (function (DIY_iframe_select) {
  758. 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;");
  759. try {
  760. let src = "";
  761. Object.defineProperty(settings, "src", {
  762. enumerable: true,
  763. configurable: false,
  764. get: function () {
  765. return src;
  766. },
  767. set: function (value) {
  768. if (!value) return false;
  769. src = DIY_iframe_select.value = value;
  770. srcs.pull(value);
  771. settings.address = [];
  772. // const newiframe = document.querySelector("iframe[id*=player]");
  773. // if (newiframe) iframe = newiframe;
  774. if (typeof doHref === "function") {
  775. let href = doHref(location.href);
  776. iframe.src = value ? value + (href ? href : location.href) : "";
  777. } else {
  778. iframe.src = value ? value + location.href : "";
  779. }
  780. return true;
  781. }
  782. });
  783. } catch (e) {
  784. console.error(e.message);
  785. }
  786.  
  787. for (let name in settings.NoAD解析) {
  788. DIY_iframe_select.innerHTML += "<option value='" + settings.NoAD解析[name] + "' style='text-align: center'>" + name + "</option>";
  789. }
  790. for (let name in settings.AD解析) {
  791. DIY_iframe_select.innerHTML += "<option value='" + settings.AD解析[name] + "' style='text-align: center; color: #fa0; '>⚠" + name + "</option>";
  792. }
  793. DIY_iframe_select.addEventListener("change", function (event) {
  794. settings.src = DIY_iframe_select.value;
  795. if (event.isTrusted) {
  796. // 预先设置历史解析源(用于适配不支持iframe执行脚本的浏览器)
  797. localStorage.setItem('parse.historyParse', settings.src);
  798. }
  799. });
  800.  
  801. settings.randomSeleceParse = function (message) {
  802. // arguments 代表输入的所有参数,看不懂可以百度搜索 “js 参数 arguments”
  803. // return arguments ? arguments[Math.floor(Math.random() * arguments.length)] : null;
  804. if (srcs.length > 0) {
  805. showTip(message ? message : "解析失败,正在切换解析源");
  806. let random = Math.floor(Math.random() * srcs.length);
  807. settings.src = srcs.splice(random, 1)[0];
  808. } else if (others) {
  809. showTip(message ? message : "解析失败,正在尝试其他解析源");
  810. srcs = others;
  811. others = null;
  812. let random = Math.floor(Math.random() * srcs.length);
  813. settings.src = srcs.splice(random, 1)[0];
  814. } else {
  815. showTip("该视频可能无法解析\n请尝试使用⚠广告解析\n如有疑问请反馈");
  816. return false;
  817. }
  818. return true;
  819. };
  820.  
  821. (function () {
  822. const DIY_iframe_button = settings.toolsBar.querySelector("button");
  823. settings.DIY_iframeFunction = function () {
  824. if (settings.parseDB.DIY解析栏 && DIY_iframe_select.style.display === "none") {
  825. DIY_iframe_select.style.display = DIY_iframe_select.style.visibility = "";
  826. DIY_iframe_button.style.borderRadius = "0px 15px 15px 0px";
  827. } else if (!settings.parseDB.DIY解析栏 && DIY_iframe_select.style.display !== "none") {
  828. DIY_iframe_select.style.display = "none";
  829. DIY_iframe_select.style.visibility = "hidden";
  830. DIY_iframe_button.style.borderRadius = "15px";
  831. }
  832. }
  833. settings.DIY_iframeFunction();
  834. const toolsBarSettings = settings.toolsBar.querySelector("settings");
  835. toolsBarSettings.insertBefore(DIY_iframe_select, toolsBarSettings.firstChild);
  836. })();
  837. })(document.createElement("select"));
  838.  
  839. // 获取历史解析
  840. settings.src = localStorage.getItem("parse.historyParse");
  841. if (!settings.src) {
  842. settings.randomSeleceParse("正在引入解析源");
  843. }
  844. playerBox.style.zIndex = "1";
  845. playerBox.appendChild(iframe);
  846. console.log("%cplayerBox已建立解析连接", settings.fontStyle.max);
  847.  
  848. setInterval(function () {
  849. let newPlayerBox = document.querySelector(cssString);
  850. if (newPlayerBox !== null && (newPlayerBox !== playerBox || newPlayerBox.querySelector("iframe[src='" + iframe.src + "']") === null)) {
  851. console.log("playerBox重新建立连接");
  852. let src = iframe.src;
  853. iframe.src = "";
  854. iframe = iframe.cloneNode(true);
  855. iframe.src = src;
  856. newPlayerBox.style.zIndex = "1";
  857. newPlayerBox.appendChild(iframe);
  858. }
  859. }, settings.getElementTimes);
  860.  
  861. function closeOldMedia() {
  862. Object.getOwnPropertyNames(top).forEach(function (property) {
  863. if (typeof window[property] === "function" && Boolean(window[property].prototype) && typeof window[property].prototype.addSourceBuffer === "function") {
  864. const $addSourceBuffer = window[property].prototype.addSourceBuffer;
  865. window[property].prototype.addSourceBuffer = function addSourceBuffer(mime) {
  866. if (window === top) {
  867. this.removeSourceBuffer($addSourceBuffer.call(this, mime));
  868. return null;
  869. } else {
  870. return $addSourceBuffer.call(this, mime);
  871. }
  872. };
  873. }
  874. });
  875. for (const node of playerBox.querySelectorAll("*")) {
  876. if (node !== iframe) {
  877. node.addEventListener("loadeddata", function () {
  878. node.src = URL.createObjectURL(new Blob(new Array(0)));
  879. }, true);
  880. node.src = URL.createObjectURL(new Blob(new Array(0)));
  881. node.remove();
  882. }
  883. }
  884. }
  885.  
  886. // closeOldMedia();
  887. // if (document.readyState.toLowerCase() != "complete") ready(closeOldMedia, "complete");
  888. setInterval(function () {
  889. closeOldMedia();
  890. }, 3000);
  891.  
  892. if (doFunction) {
  893. doFunction(playerBox, iframe);
  894. }
  895.  
  896. setInterval(function () {
  897. for (let other_iframe of document.querySelectorAll("iframe")) {
  898. if (other_iframe.src !== iframe.src || other_iframe.constructor.name !== iframe.constructor.name) {
  899. other_iframe.remove();
  900. }
  901. }
  902. if (iframe.getAttribute("style") !== iframe_style) {
  903. iframe.setAttribute("style", iframe_style);
  904. }
  905. }, settings.getElementTimes);
  906.  
  907. ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange'].forEach(function (item) {
  908. window.addEventListener(item, function () {
  909. if (document.fullScreen || document.mozFullScreen || document.webkitIsFullScreen) {
  910. settings.toolsBar.style.display = 'none';
  911. } else {
  912. settings.toolsBar.style.display = 'block';
  913. }
  914. }, true);
  915. });
  916. });
  917. }
  918. } else {
  919. console.log(location.href + " 1ok ");
  920.  
  921. function setParseVideo() {
  922. console.log(location.href + " 2ok");
  923. forElements("video", async function (videos, thisInterval) {
  924. for (const video of videos) {
  925. if (video.poster) video.removeAttribute("poster");
  926. if (video.src && video.duration > 7) {
  927. // 清除监听video计时器
  928. clearInterval(thisInterval);
  929. // console.log("解析成功,清空解析列表缓存");
  930.  
  931. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x001"), "*");
  932. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00按下Enter获取焦点"), "*");
  933.  
  934. // console.log("移除广告模块");
  935. removeElements(['document.getElementById("ADplayer")', 'document.getElementById("ADtip")']);
  936. // console.log("等待数据得到响应,移除弹幕模块");
  937. settings.parseDB = await settings.parseDB;
  938. if (!settings.parseDB.弹幕开关) {
  939. // console.log("正在移除弹幕功能");
  940. 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]")']);
  941. }
  942. (function () {
  943. video.loop = false;
  944. video.autopictureinpicture = true;
  945. const playbackRate = localStorage.getItem("parse.playbackRate");
  946. if (playbackRate) {
  947. video.playbackRate = parseFloat(playbackRate);
  948. const playbackRateElement = document.querySelector("[class*=speeds] [class*=layer-label].title");
  949. if (video.playbackRate !== 1 && playbackRateElement !== null) playbackRateElement.innerText = playbackRate + "x";
  950. }
  951. video.addEventListener("ratechange", function () {
  952. localStorage.setItem("parse.playbackRate", video.playbackRate.toString());
  953. });
  954. })();
  955.  
  956. // console.log("进入/退出 全屏");
  957. const openFullscreen = HTMLVideoElement.prototype.RequestFullScreen ? HTMLVideoElement.prototype.RequestFullScreen : //兼容Firefox
  958. HTMLVideoElement.prototype.mozRequestFullScreen ? HTMLVideoElement.prototype.mozRequestFullScreen ://兼容Chrome, Safari and Opera等
  959. HTMLVideoElement.prototype.webkitRequestFullScreen ? HTMLVideoElement.prototype.webkitRequestFullScreen : //兼容IE/Edge
  960. HTMLVideoElement.prototype.msRequestFullscreen;
  961. const exitFullscreen = document.exitFullScreen ? document.exitFullScreen : //兼容Firefox
  962. document.mozCancelFullScreen ? document.mozCancelFullScreen : //兼容Chrome, Safari and Opera等
  963. document.webkitExitFullscreen ? document.webkitExitFullscreen : //兼容IE/Edge
  964. document.body.msExitFullscreen;
  965. const getFullscreenElement = typeof document.fullscreenElement !== "undefined" ? function () {
  966. return document.fullscreenElement;
  967. } : typeof document.mozFullScreenElement !== "undefined" ? function () {
  968. return document.mozFullScreenElement;
  969. } : typeof document.msFullScreenElement !== "undefined" ? function () {
  970. return document.msFullScreenElement;
  971. } : function () {
  972. return document.webkitFullscreenElement;
  973. };
  974. let fullscreen = (function (node) {
  975. return function (value) {
  976. if (typeof value === "undefined" ?
  977. Boolean(getFullscreenElement()) : !value) {
  978. exitFullscreen.apply(document);
  979. } else {
  980. openFullscreen.apply(node);
  981. }
  982. video.focus();
  983. };
  984. })(isMobile ? video : document.body);
  985. video.addEventListener("pause", function () {
  986. if ((video.currentTime - video.duration) > -5) {
  987. // console.log("视频播放结束了");
  988. fullscreen(false);
  989. }
  990. });
  991.  
  992. if (!isMobile) {
  993. (function () {
  994. const fullscreen_btn = document.querySelector("[class*=fullscreen][class*=On],[class$=player-full] button[class$=full-icon]");
  995. if (fullscreen_btn && fullscreen_btn.nodeType === 1) {
  996. fullscreen = function (value) {
  997. if (typeof value === "undefined") {
  998. fullscreen_btn.click();
  999. } else if (value && !Boolean(getFullscreenElement())) {
  1000. fullscreen_btn.click();
  1001. } else if (!value && Boolean(getFullscreenElement())) {
  1002. fullscreen_btn.click();
  1003. }
  1004. };
  1005. }
  1006. })();
  1007. (function (isFullscreen) {
  1008. window.addEventListener("keydown", function (event) {
  1009. if (event.key === "Enter") {
  1010. isFullscreen = Boolean(getFullscreenElement());
  1011. }
  1012. }, true);
  1013. window.addEventListener("keyup", function (event) {
  1014. if (event.key === "Enter") {
  1015. if (isFullscreen === Boolean(getFullscreenElement())) {
  1016. fullscreen();
  1017. if (video.paused) {
  1018. video.play();
  1019. }
  1020. }
  1021. }
  1022. }, false);
  1023. })();
  1024. showTip("回车,进入全屏播放");
  1025. } else {
  1026. showTip("解析成功");
  1027. }
  1028.  
  1029. fullscreen(settings.parseDB.自动全屏);
  1030. if (video.paused) {
  1031. video.play();
  1032. }
  1033. }
  1034. }
  1035. }, 5000, function () {
  1036. console.log(location.href + " 3ok");
  1037. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00给予\x00-1\x00" + location.href), "*");
  1038. });
  1039. }
  1040.  
  1041. if (location.host.indexOf("jiexi.t7g.cn") !== -1) {
  1042. // 移除爱解析p2p提示
  1043. displayNone(["body>div#stats"]);
  1044. setParseVideo();
  1045. } else if (location.host.indexOf("api.okjx.cc:3389") !== -1) {
  1046. // 删除OK解析线路选择功能
  1047. (function (style) {
  1048. style.innerHTML = ".slide,.panel,.slide *,.panel *{width: 0 !important; max-width: 0 !important; opacity: 0 !important;}";
  1049. document.head.appendChild(style);
  1050. })(document.createElement("style"));
  1051. setParseVideo();
  1052. } else if (location.host.indexOf("api.jiubojx.com") !== -1) {
  1053. displayNone("div.adv_wrap_hh");
  1054. setParseVideo();
  1055. } else if (location.host.indexOf("yemu.xyz") !== -1) {
  1056. if (location.pathname.indexOf("jx.php") === -1) {
  1057. if (location.host.indexOf("www.yemu.xyz") !== -1) {
  1058. // 删除夜幕解析线路选择功能
  1059. (function (style) {
  1060. style.innerHTML = ".slide,.panel,.slide *,.panel *{width: 0 !important; max-width: 0 !important; opacity: 0 !important;}";
  1061. document.head.appendChild(style);
  1062. })(document.createElement("style"));
  1063. } else if (location.host.indexOf("jx.yemu.xyz") !== -1) {
  1064. // 移除视频分类提示 及 解析框架处理
  1065. displayNone(["div.advisory"]);
  1066. setParseVideo();
  1067. }
  1068. } else {
  1069. // 移除背景图片
  1070. doElement("div[style*='width:100%;height:100%;'][style*='.jpg']", function (background) {
  1071. background.setAttribute("style", "width:100%; height:100%; position:relative; z-index:2147483647987;");
  1072. }, 5000);
  1073. }
  1074. } else if (location.host.indexOf('www.mtosz.com') !== -1) {
  1075. displayNone([".video-panel-blur-image"]); // 似乎不管用?
  1076. doElement(".video-panel-blur-image", function (element) {
  1077. element.setAttribute("style", "display: none; height: 0; width: 0;");
  1078. });
  1079. setParseVideo();
  1080. } else if (location.host.indexOf('v.superchen.top:3389') !== -1) {
  1081. setParseVideo();
  1082. } else if (location.host.indexOf('jx.parwix.com:4433') !== -1) {
  1083. setParseVideo();
  1084. } else {
  1085. setParseVideo();
  1086. }
  1087. }
  1088.  
  1089. function displayNone(Tags) {
  1090. setTimeout(function () {
  1091. let style = document.createElement("style");
  1092. style.innerHTML = "\n";
  1093. for (let i = 0; i < Tags.length; i++) {
  1094. 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";
  1095. }
  1096. document.head.insertBefore(style, document.head.firstChild);
  1097. });
  1098. }
  1099. }
  1100.  
  1101. function showTip(msg, style = "") {
  1102. try {
  1103. // 该函数需要在top内运行,否则可能显示异常
  1104. if (window === top) {
  1105. let tip = document.querySelector(":root>tip");
  1106. if (tip && tip.nodeType === 1) {
  1107. // 防止中途新的showTip事件创建多个tip造成卡顿
  1108. tip.remove();
  1109. }
  1110. tip = document.createElement("tip");
  1111. // pointer-events: none; 禁用鼠标事件,input标签使用 disabled='disabled' 禁用input标签
  1112. 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;");
  1113. tip.innerHTML = "<style>@keyframes showTip {0%{opacity: 0;} 33.34%{opacity: 1;} 66.67%{opacity: 1;} 100%{opacity: 0;}}</style>\n" + msg;
  1114. let time = msg.replace(new RegExp("\\s"), "").length / 2; // TODO 2个字/秒
  1115. // cubic-bezier(起始点, 起始点偏移量, 结束点偏移量, 结束点),这里的 cubic-bezier函数 表示动画速度的变化规律
  1116. 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";
  1117. document.root.appendChild(tip);
  1118. setTimeout(function () {
  1119. try {
  1120. tip.remove();
  1121. } catch (e) {
  1122. // 排除root没有找到tip
  1123. }
  1124. }, time * 1000);
  1125. } else {
  1126. top.postMessage(settings.key.encrypt("宝塔镇河妖\x00函数\x00showTip('" + msg + "')"), "*");
  1127. }
  1128. } catch (e) {
  1129. console.log(msg);
  1130. }
  1131. }
  1132. })();
  1133.  
  1134. function require(url) {
  1135. const request = new XMLHttpRequest();
  1136. let result = null;
  1137. request.open("GET", url, false);
  1138. request.onload = function () {
  1139. result = eval(request.response);
  1140. console.log("use-scrypt.length = " + request.response.length);
  1141. };
  1142. try {
  1143. request.send();
  1144. } catch (e) {
  1145. let scrypt = document.createElement("scrypt");
  1146. document.head.appendChild(scrypt);
  1147. }
  1148. return result;
  1149. }
  1150. })();

QingJ © 2025

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