🏠 Home 

糖心Vlog

🔥不限次看站内所有付费视频,下载视频(日限),复制播放链接,屏蔽广告


安装此脚本?
  1. // ==UserScript==
  2. // @name 糖心Vlog
  3. // @version 1.0.2
  4. // @description 🔥不限次看站内所有付费视频,下载视频(日限),复制播放链接,屏蔽广告
  5. // @icon https://cdn.luckychajian.com/image/boy.jpeg
  6. // @namespace 糖心Vlog
  7. // @author lucky
  8. // @include */pages/hjsq*
  9. // @include *://tx*.*/*
  10. // @include *://*.tx*.*/*
  11. // @include *://blog.luckly-mjw.cn/*
  12. // @include *://tools.thatwind.com/*
  13. // @include *://tools.bugscaner.com/*
  14. // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js
  15. // @require https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.5.8/hls.min.js
  16. // @run-at document-start
  17. // @grant unsafeWindow
  18. // @grant GM_addStyle
  19. // @grant GM_getValue
  20. // @grant GM_setValue
  21. // @grant GM_getResourceText
  22. // @grant GM_xmlhttpRequest
  23. // @charset UTF-8
  24. // @antifeature payment
  25. // @license MIT
  26. // ==/UserScript==
  27. function init($){
  28. 'use strict';
  29. if(unsafeWindow.wt_tangxin_script){
  30. return;
  31. }
  32. unsafeWindow.wt_tangxin_script = true;
  33. if (location.href.includes('tools.bugscaner.com')) {
  34. util.findTargetElement('.input-group input').then(res => {
  35. const url = location.search.replace('?m3u8=', '').replace(/\s*/g, "")
  36. if (url && url.startsWith('http')) {
  37. $(res).val(url)
  38. }
  39. })
  40. return
  41. }
  42. if (location.href.includes('tools.thatwind.com')) {
  43. GM_addStyle(`.top-ad{display: none !important;}`)
  44. util.findTargetElement('.bx--text-input__field-outer-wrapper input', 10).then(res => {
  45. $(res).val(Date.now())
  46. res.dispatchEvent(new Event("input"))
  47. })
  48. return
  49. }
  50. if (location.href.includes('blog.luckly-mjw.cn')) {
  51. GM_addStyle(`
  52. #m-app a,.m-p-temp-url,.m-p-cross,.m-p-input-container div:nth-of-type(1){display: none !important;}
  53. .m-p-input-container{ display: block;}
  54. .m-p-input-container input{ width: 100%;font-size: 12px;margin-bottom: 5px;}
  55. .m-p-input-container div{ height: 45px;line-height: 45px;font-size: 15px;margin-top: 3px;}
  56. .m-p-stream{line-height: normal;font-size: 12px;}
  57. `)
  58. return
  59. }
  60. const loadScript = function(url) {
  61. const script = document.createElement('script');
  62. script.type = 'text/javascript';
  63. script.src = url;
  64. document.head.appendChild(script);
  65. }
  66. if(typeof Hls === "undefined"){
  67. loadScript('https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.5.8/hls.min.js')
  68. }
  69. const checkLogin = function(){
  70. try{
  71. if (superVip._CONFIG_.user.login_date != new Date().setHours(0, 0, 0,0) || md5x(superVip._CONFIG_.user.ver, 'de').code != md5x(md5x(), 'de').code) {
  72. superVip._CONFIG_.user = ''
  73. GM_setValue('jsxl_user', '')
  74. util.logouted('登录已失效,请重新登录')
  75. $("#wt-my").click()
  76. return false
  77. }
  78. return true
  79. }catch(e){
  80. superVip._CONFIG_.user = ''
  81. GM_setValue('jsxl_user', '')
  82. util.logouted(e.message || '登录已失效,请重新登录')
  83. $("#wt-my").click()
  84. return false
  85. }
  86. }
  87. const initPlayerUrl = async function(that, url, params){
  88. if (superVip._CONFIG_.user && superVip._CONFIG_.user.token) {
  89. if(!checkLogin()){
  90. return;
  91. }
  92. if(!params || params.length < 1){
  93. superVip._CONFIG_.videoUrl.requestErrMsg = '参数错误'
  94. util.showTips({ title: '参数错误'})
  95. return
  96. }
  97. try{
  98. let res = await util.asyncHttp(superVip._CONFIG_.apiBaseUrl + '/s' + (Math.floor(Math.random() * 3) + 1) + '00/tangxinSign?code=' + encodeURIComponent(params[0]) + '&version=' + superVip._CONFIG_.version)
  99. if(res.errMsg != 'success' || !res.responseText){
  100. throw new Error('asyncHttp request fail')
  101. }
  102. const result = JSON.parse(res.responseText)
  103. if(result.errCode != 0){
  104. throw new Error(result.errMsg)
  105. }
  106. params[0] = result.data
  107. if(result.newToken){
  108. if(result.newToken) superVip._CONFIG_.user.token = result.newToken;
  109. GM_setValue('jsxl_user', superVip._CONFIG_.user)
  110. }
  111. }catch(e){
  112. superVip._CONFIG_.videoUrl.requestErrMsg = e.message || '请求api失败'
  113. util.showTips({ title: e.message || '请求api失败'})
  114. }
  115. }
  116. }
  117. const md5x = function(s, type) {
  118. try {
  119. if (!type) {
  120. const date = new Date().setHours(0, 0, 0, 0) + '';
  121. const day = new Date().getDate();
  122. const code = date.substring(4, 8) * new Date().getDate() + '';
  123. return ec.swaqbt(JSON.stringify({
  124. date: date,
  125. code: code,
  126. day: day
  127. }));
  128. } else {
  129. if(type == 'decode'){
  130. s = ec.cskuecede(s)
  131. }
  132. const token = JSON.parse(ec.sfweccat(s));
  133. if ((new Date(Number(token.date)).getTime() + 86400000) < Date.now()) {
  134. throw Error('md5x expire');
  135. }
  136. if (token.day != new Date(Number(token.date)).getDate()) {
  137. throw Error('md5x err');
  138. }
  139. const code = (new Date(Number(token.date)).setHours(0, 0, 0, 0) + '').substring(4, 8) * token.day;
  140. if (code != token.code) {
  141. throw Error('md5x err2');
  142. }
  143. return token;
  144. }
  145. } catch (e) {
  146. return '';
  147. }
  148. }
  149. const ec = {
  150. b64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  151. b64re: /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,
  152. swaqbt: (string, flag = true) => {
  153. string = String(string);
  154. var bitmap, a, b, c, result = "",
  155. i = 0,
  156. rest = string.length % 3;
  157. for (; i < string.length;) {
  158. if ((a = string.charCodeAt(i++)) > 255 || (b = string.charCodeAt(i++)) > 255 || (c = string
  159. .charCodeAt(i++)) > 255) {
  160. return "Failed to execute swaqbt"
  161. }
  162. bitmap = (a << 16) | (b << 8) | c;
  163. result += ec.b64.charAt(bitmap >> 18 & 63) + ec.b64.charAt(bitmap >> 12 & 63) +
  164. ec.b64.charAt(bitmap >> 6 & 63) + ec.b64.charAt(bitmap & 63);
  165. }
  166. if (flag) return ec.swaqbt(rest ? result.slice(0, rest - 3) + "===".substring(rest) : result,
  167. false)
  168. else return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result;
  169. },
  170. sfweccat: (string, flag = true) => {
  171. string = String(string).replace(/[\t\n\f\r ]+/g, "");
  172. if (!ec.b64re.test(string)) {
  173. return 'Failed to execute sfweccat'
  174. }
  175. string += "==".slice(2 - (string.length & 3));
  176. var bitmap, result = "",
  177. r1, r2, i = 0;
  178. for (; i < string.length;) {
  179. bitmap = ec.b64.indexOf(string.charAt(i++)) << 18 | ec.b64.indexOf(string.charAt(i++)) <<
  180. 12 |
  181. (r1 = ec.b64.indexOf(string.charAt(i++))) << 6 | (r2 = ec.b64.indexOf(string.charAt(
  182. i++)));
  183. result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) :
  184. r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) :
  185. String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255);
  186. }
  187. if (flag) return ec.sfweccat(result, false)
  188. else return result
  189. },
  190. knxkbxen: (s) => {
  191. s = ec.swaqbt(encodeURIComponent(JSON.stringify(s)), false);
  192. const n = Math.round(Math.random() * (s.length > 11 ? 8 : 1) + 1);
  193. const l = s.split('');
  194. const f = l.filter(i => {
  195. i == '=';
  196. })
  197. for (let i = 0; i < l.length; i++) {
  198. if (i == n) l[i] = l[i] + 'JS';
  199. if (l[i] == '=') l[i] = '';
  200. }
  201. return ec.b64[Math.floor(Math.random() * 62)] + (l.join('') + n) + f.length;
  202. },
  203. cskuecede: (s) => {
  204. if (s.startsWith('JSXL')) s = s.replace('JSXL', '');
  205. s = s.substring(ec.sfweccat('TVE9PQ=='));
  206. const n = s.substring(s.length - 2, s.length - 1);
  207. const d = s.substring(s.length - 1);
  208. const l = s.substring(0, s.length - 2).split('');
  209. for (let i = 0; i < l.length; i++) {
  210. if (i == (Number(n) + 1)) {
  211. l[i] = '';
  212. l[i + 1] = '';
  213. break;
  214. }
  215. }
  216. for (let i = 0; i < Number(d); i++) {
  217. l.plus('=')
  218. }
  219. return JSON.parse(decodeURIComponent((ec.sfweccat(l.join(''), false))))
  220. }
  221. }
  222. const util = {
  223. initAppDate: (haveBox = true)=>{
  224. let roles = '';
  225. if(superVip._CONFIG_.user && superVip._CONFIG_.user.roles){
  226. if(superVip._CONFIG_.user.roles.length > 0 && superVip._CONFIG_.user.roles[0].e){
  227. superVip._CONFIG_.user.roles.sort((a,b) =>{
  228. return a.e < b.e? 1: -1
  229. })
  230. }
  231. superVip._CONFIG_.user.roles.forEach(item => {
  232. if(item.e){
  233. if(item.e > 2047980427789){
  234. item.vip_day = '永久'
  235. }else{
  236. const time = item.e - Date.now()
  237. if(time < 86400000 && time > 0){
  238. if(time > 3600000){
  239. item.vip_day = parseInt(time / 3600000) + '小时'
  240. }else{
  241. item.vip_day = parseInt(time / 60000) + '分钟'
  242. }
  243. }else if(time <= 0){
  244. item.vip_day = '已过期'
  245. item.expire = true
  246. }else{
  247. item.vip_day = parseInt(time / 86400000) + '天'
  248. const d = time % 86400000
  249. if(d > 3600000){
  250. item.vip_day += parseInt(d / 3600000) + '小时'
  251. }
  252. }
  253. }
  254. }
  255. roles += `
  256. <div class="info-box ${item.expire?'expire':''}" data-l="${item.l}">
  257. <div class="avatar-box">
  258. <img class="avatar" src="${superVip._CONFIG_.cdnBaseUrl + '/image/boy.jpeg'}"/>
  259. </div>
  260. <div class="desc">
  261. <div style="font-size: 11px;">${item.n}</div>
  262. </div>
  263. <div class="vip-day">
  264. <div style="font-size: 10px;"></div>
  265. <div style="font-size: 10px;"></div>
  266. </div>
  267. </div>
  268. `;
  269. })
  270. if(haveBox){
  271. $('#wt-set-box .user-box-container .user-box .apps-container').empty()
  272. $('#wt-set-box .user-box-container .user-box .apps-container').append(roles)
  273. }
  274. $('#wt-set-box .user-box-container .user-box .info-box').on('click', function(e) {
  275. const l = e.currentTarget.attributes['data-l']?.value
  276. if(l && l.startsWith('http')){
  277. window.location.href = l
  278. }
  279. })
  280. }
  281. return haveBox? '': roles
  282. },
  283. copyText: (text) => {
  284. if (navigator.clipboard && window.isSecureContext) {
  285. return navigator.clipboard.writeText(text);
  286. } else if (document.execCommand) {
  287. const textArea = document.createElement('textarea');
  288. textArea.style.position = 'fixed';
  289. textArea.style.top = textArea.style.left = '-100vh';
  290. textArea.style.opacity = '0';
  291. textArea.value = text;
  292. document.body.appendChild(textArea);
  293. textArea.focus();
  294. textArea.select();
  295. try {
  296. const success = document.execCommand('copy');
  297. return success ? Promise.resolve() : Promise.reject();
  298. } catch (err) {
  299. return Promise.reject(err);
  300. } finally {
  301. textArea.remove();
  302. }
  303. } else {
  304. return Promise.reject(new Error('Clipboard API not supported and execCommand not available.'));
  305. }
  306. },
  307. logined: () => {
  308. $("#wt-my img").addClass('margin-left')
  309. $('#wt-my img').attr('src', superVip._CONFIG_.user.avatar)
  310. $('#wt-set-box .user-box-container .user-info').css('display', 'flex')
  311. $('#wt-set-box .user-box-container .user-info img').attr('src', superVip._CONFIG_.user.avatar)
  312. $('#wt-set-box .user-box-container .user-info .nickname').html(superVip._CONFIG_.user.nickname)
  313. $('#wt-set-box .user-box-container .user-info .username').html(superVip._CONFIG_.user.username)
  314. },
  315. logouted: (msg) => {
  316. superVip._CONFIG_.user = '';
  317. $("#wt-my img").removeClass('margin-left')
  318. $('#wt-my img').attr('src',superVip._CONFIG_.cdnBaseUrl + '/image/app.png')
  319. $('#wt-set-box .user-box-container .user-info').css('display', 'none')
  320. GM_setValue('jsxl_user', '')
  321. if(msg){
  322. util.showTips({
  323. title: '请重新登录,errMsg:' + msg
  324. })
  325. }
  326. },
  327. showAndHidTips: (name, op = 'set', val = true) => {
  328. let tips = GM_getValue('wt_tips', {})
  329. if (!tips) tips = {}
  330. if (op == 'set') {
  331. tips[name] = val
  332. GM_setValue('wt_tips', tips)
  333. if (val) $('.' + name).addClass('tips-yuan')
  334. else $('.' + name).removeClass('tips-yuan')
  335. return true
  336. } else {
  337. return tips[name] ? true : false
  338. }
  339. },
  340. addLogin: () => {
  341. if ($('#wt-login-box').length > 0) {
  342. $("#wt-login-box input").val('');
  343. return;
  344. }
  345. $('body').append(`
  346. <div id="wt-login-mask"></div>
  347. <div id="wt-login-box">
  348. <div class="logo">
  349. <p>@${superVip._CONFIG_.homeUrl}</p>
  350. <p>v ${superVip._CONFIG_.version}</p>
  351. </div>
  352. <div class="close"></div>
  353. <div class="title">账号登录</div>
  354. <div class="input-box">
  355. <input type="text" placeholder="请输入账号" maxLength="15"/>
  356. </div>
  357. <div class="input-box" style="margin-top:10px;">
  358. <input type="text" placeholder="请输入密码" maxLength="15"/>
  359. </div>
  360. <div class="j-login-btn">
  361. <button >登录</button>
  362. </div>
  363. <div class="to-index" style="display: flex;justify-content: space-between;color: #00bcd4; height: 40px;line-height: 40px;font-size: 11px;font-weight: 500;">
  364. <div class="wt-register">注册账号</div>
  365. <div class="wt-index">去发电获取权限?</div>
  366. </div>
  367. </div>
  368. `)
  369. GM_addStyle(`
  370. #wt-login-mask{ display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 11000;background-color: #0000004d;}
  371. #wt-login-box{position: fixed;margin-top: 3%;top: 50%;left: 50%;transform: translate(-50%,-50%) scale(0);overflow: hidden;background-color: white;padding: 30px;padding-bottom: 0;border-radius: 10px;z-index: 11010;}
  372. #wt-login-box::before{display:none; content:'';position: absolute;width: 250px;height: 250px;border-radius: 200px;background-color: #00bcd4;z-index: -1;opacity: 0.7;bottom: 110px;right: 100px;}
  373. #wt-login-box::after{display:none;content:'';position: absolute;width: 250px;height: 250px;border-radius: 200px;background-color: #2196F3;z-index: -1;opacity: 0.7;top: 115px;right: -112px;}
  374. #wt-login-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;}
  375. #wt-login-box .close::before,#wt-login-box .close::after{position: absolute;left: 50%;top: 50%;content: '';width: 16px;height: 2px;border-radius: 1px;background-color: #222;transform: translate(-50%,-50%) rotate(45deg);}
  376. #wt-login-box .close::after,#wt-set-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);}
  377. #wt-login-box .input-box{display: flex;background-color: #f5f5f5;width: 160px;height: 35px;border-radius: 30px;overflow: hidden;font-size: 12px;}
  378. #wt-login-box .input-box input{width: 100%;height: 100%;padding-left: 15px;box-sizing: border-box;outline: none;border: none;background-color: #f5f5f5;font-size: 11px;color: black;letter-spacing: 1px;}
  379. #wt-login-box input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none !important; }
  380. #wt-login-box .title{font-weight: 600;font-size: 16px;color: #3a3a3a;text-align: center;margin-bottom: 20px;}
  381. #wt-login-box .j-login-btn{width: 100px;padding: 2px;height: 40px;font-size: 12px;margin: 15px auto;}
  382. #wt-login-box .j-login-btn button{width: 100%;height: 100%;border-radius: 30px;border: none;color: white;transition: all 0.3s ease;background-color: #00bcd4;}
  383. #wt-login-box .logo{position: absolute;top: 5%;left: 1%; color: #dbdbdb; font-size: 11px;transform: rotate(-15deg);text-align: center;z-index: -10;}
  384. `)
  385. $("#wt-login-mask").on("click", () => {
  386. $('#wt-login-mask').css('display', 'none')
  387. $("#wt-login-box").removeClass('show-set-box')
  388. $("#wt-login-box").addClass('hid-set-box')
  389. })
  390. $("#wt-login-box .close").on("click", () => {
  391. $('#wt-login-mask').css('display', 'none')
  392. $("#wt-login-box").removeClass('show-set-box')
  393. $("#wt-login-box").addClass('hid-set-box')
  394. })
  395. $("#wt-login-box .to-index .wt-register").on("click", () => {
  396. window.open(superVip._CONFIG_.homeUrl + '/#/pages/login/login')
  397. })
  398. $("#wt-login-box .to-index .wt-index").on("click", () => {
  399. window.open(superVip._CONFIG_.homeUrl +'/#/')
  400. })
  401. $("#wt-login-box .j-login-btn button").on("click", async () => {
  402. try{
  403. $('#wt-loading-box').css('display', 'block')
  404. await util.sleep(300);
  405. $("#wt-login-box .j-login-btn button").addClass('btn-anima')
  406. setTimeout(() => {
  407. $("#wt-login-box .j-login-btn button").removeClass('btn-anima')
  408. }, 500)
  409. const username = $("#wt-login-box input")[0].value;
  410. let pwd = $("#wt-login-box input")[1].value;
  411. if(!username || username.length < 5 || username.length > 15 || !/^[A-Za-z0-9]+$/.test(username)){
  412. setTimeout(() => {
  413. $('#wt-loading-box').css('display', 'none')
  414. util.showTips({
  415. title: '账号错误,请使用' + superVip._CONFIG_.homeUrl + '网站注册的账号密码登入插件</br>' + superVip._CONFIG_.guide
  416. })
  417. }, 2000)
  418. return
  419. }
  420. if(!pwd || pwd.length < 5 || pwd.length > 15){
  421. setTimeout(() => {
  422. $('#wt-loading-box').css('display', 'none')
  423. util.showTips({
  424. title: '密码错误,请使用' + superVip._CONFIG_.homeUrl + '网站注册的账号密码登入插件</br>' + superVip._CONFIG_.guide
  425. })
  426. }, 2000)
  427. return
  428. }
  429. $.ajax({
  430. url: superVip._CONFIG_.apiBaseUrl + '/l' + (Math.floor(Math.random() * 2) + 1) + '00/ls',
  431. method: "POST",
  432. timeout: 12000,
  433. data: {
  434. username: username,
  435. password: pwd,
  436. ap: 'HJtFoJUU3JUIzJTk2JUU1JUJGJTgzKYioG',
  437. version: superVip._CONFIG_.version
  438. },
  439. dataType: 'json',
  440. success: function(response) {
  441. if (response.errCode != 0) {
  442. $('#wt-loading-box').css('display', 'none');
  443. util.showTips({
  444. title: response.errMsg + ',' + superVip._CONFIG_.guide
  445. })
  446. } else {
  447. response.data = ec.cskuecede(response.data)
  448. const res = {
  449. avatar: response.data.user.avatar,
  450. username: response.data.user.username,
  451. nickname: response.data.user.nickname,
  452. login_date: new Date().setHours(0,0,0,0),
  453. token: response.data.token,
  454. role: response.data.user.current_role,
  455. roles: response.data.user.roles,
  456. downloadTips: response.data.utilObj.downloadTips
  457. }
  458. superVip._CONFIG_.user = res
  459. superVip._CONFIG_.user.ver = md5x(superVip)
  460. util.logined()
  461. GM_setValue('jsxl_user', res)
  462. GM_setValue('jsxl_login_code', JSON.stringify({u: username, p: pwd}))
  463. if(response.data?.utilObj?.notify){
  464. const historyNotify = GM_getValue('notify')
  465. if (!historyNotify || historyNotify != response.data.utilObj.notify) {
  466. GM_setValue('notifyShow', true);
  467. util.showAndHidTips('wt_my_notify')
  468. GM_setValue('notify', response.data.utilObj.notify)
  469. }
  470. }
  471. $('#wt-loading-box').css('display', 'none')
  472. $('#wt-login-mask').css('display','none')
  473. $("#wt-login-box").removeClass('show-set-box')
  474. $("#wt-login-box").addClass('hid-set-box')
  475. util.showTips({
  476. title: response.errMsg,
  477. success: (e) => {
  478. window.location.reload()
  479. }
  480. })
  481. }
  482. },
  483. error: function(e) {
  484. $('#wt-loading-box').css('display', 'none')
  485. console.log(e)
  486. util.showTips({
  487. title: '网络延迟登录失败,请关掉梯子(vpn)再试或梯子尝试换港台地区节点再试,一般关掉梯子多试几次登录就行,' + superVip._CONFIG_.guide
  488. })
  489. }
  490. });
  491. }catch(e){
  492. $('#wt-loading-box').css('display', 'block')
  493. alert(e)
  494. util.showTips({
  495. title: '网络延迟登录失2,请关掉梯子(vpn)再试或梯子尝试换港台地区节点再试,一般关掉梯子多试几次登录就行,' + superVip._CONFIG_.guide
  496. })
  497. }
  498. })
  499. },
  500. asyncHttp: async (url, timeout = 6000, isHeader = true) => {
  501. return new Promise((resolve, reject) => {
  502. var request = new XMLHttpRequest();
  503. request.open('GET', url, true);
  504. if(isHeader){
  505. request.setRequestHeader('luckyToken', superVip._CONFIG_.user.token);
  506. }
  507. request.timeout = timeout;
  508. request.onload = function() {
  509. if (request.readyState == 4) {
  510. if (request.status === 200) {
  511. resolve({
  512. errMsg: 'success',
  513. responseText: request.responseText
  514. });
  515. } else {
  516. resolve({
  517. errMsg: 'err1',
  518. responseText: ''
  519. });
  520. }
  521. }
  522. };
  523. request.onerror = function() {
  524. resolve({
  525. errMsg: 'err2',
  526. responseText: ''
  527. });
  528. };
  529. request.ontimeout = function() {
  530. resolve({
  531. errMsg: 'timeout',
  532. responseText: ''
  533. });
  534. };
  535. request.send();
  536. });
  537. },
  538. findTargetElement: (targetContainer, maxTryTime = 30) => {
  539. const body = window.document;
  540. let tabContainer;
  541. let tryTime = 0;
  542. let startTimestamp;
  543. return new Promise((resolve, reject) => {
  544. function tryFindElement(timestamp) {
  545. if (!startTimestamp) {
  546. startTimestamp = timestamp;
  547. }
  548. const elapsedTime = timestamp - startTimestamp;
  549. if (elapsedTime >= 500) {
  550. console.log("find element:" + targetContainer + ",this" + tryTime + "num")
  551. tabContainer = body.querySelector(targetContainer)
  552. if (tabContainer) {
  553. resolve(tabContainer)
  554. } else if (++tryTime === maxTryTime) {
  555. reject()
  556. } else {
  557. startTimestamp = timestamp
  558. }
  559. }
  560. if (!tabContainer && tryTime < maxTryTime) {
  561. requestAnimationFrame(tryFindElement);
  562. }
  563. }
  564. requestAnimationFrame(tryFindElement);
  565. });
  566. },
  567. findTargetElementByVideoSrc: (maxTryTime = 60) => {
  568. const body = window.document;
  569. let videoSrc;
  570. let tryTime = 0;
  571. let startTimestamp;
  572. return new Promise((resolve, reject) => {
  573. function tryFindElement(timestamp) {
  574. if (!startTimestamp) {
  575. startTimestamp = timestamp;
  576. }
  577. const elapsedTime = timestamp - startTimestamp;
  578. if (elapsedTime >= 500) {
  579. const video = document.querySelector('video')
  580. if(video && video.src) videoSrc = video.src
  581. if (videoSrc) {
  582. resolve(videoSrc)
  583. } else if (++tryTime === maxTryTime) {
  584. reject()
  585. } else {
  586. startTimestamp = timestamp
  587. }
  588. }
  589. if (!videoSrc && tryTime < maxTryTime) {
  590. requestAnimationFrame(tryFindElement);
  591. }
  592. }
  593. requestAnimationFrame(tryFindElement);
  594. });
  595. },
  596. sleep: (time) => {
  597. return new Promise((res, rej) => {
  598. setTimeout(() => {
  599. res()
  600. }, time)
  601. })
  602. },
  603. showTips: (item = {}) => {
  604. $('#wt-maxindex-mask').css('display', 'block');
  605. $("#wt-tips-box").removeClass('hid-set-box');
  606. $("#wt-tips-box").addClass('show-set-box');
  607. $('#wt-tips-box .btn-box').empty()
  608. $('#wt-tips-box .btn-box').append(`
  609. <button class='cancel'>取消</button>
  610. <button class='submit'>确定</button>
  611. `)
  612. if (item.title) $('#wt-tips-box .content').html(item.title);
  613. if (item.doubt) $('#wt-tips-box .btn-box .cancel').css('display', 'block');
  614. if (item.confirm) $('#wt-tips-box .btn-box .submit').html(item.confirm);
  615. if (item.hidConfirm) {
  616. $('#wt-tips-box .submit').css('display', 'none');
  617. } else {
  618. $('#wt-tips-box .submit').css('display', 'block');
  619. }
  620. $('#wt-tips-box .btn-box .submit').on('click', () => {
  621. $('#wt-maxindex-mask').css('display', 'none');
  622. $("#wt-tips-box").removeClass('show-set-box');
  623. $("#wt-tips-box").addClass('hid-set-box');
  624. if (item.success) item.success(true);
  625. })
  626. $('#wt-tips-box .btn-box .cancel').on('click', () => {
  627. $('#wt-maxindex-mask').css('display', 'none');
  628. $("#wt-tips-box").removeClass('show-set-box');
  629. $("#wt-tips-box").addClass('hid-set-box');
  630. if (item.success) item.success(false);
  631. })
  632. },
  633. showDownLoadWindow: (show = true, msg) => {
  634. if (!show) {
  635. $('#wt-mask-box').css('display', 'none');
  636. $("#wt-download-box").removeClass('show-set-box');
  637. $("#wt-download-box").addClass('hid-set-box');
  638. return
  639. }
  640. $('#wt-mask-box').css('display', 'block');
  641. const downloadUrl = superVip._CONFIG_.videoUrl.downloadUrlSign;
  642. if (!document.querySelector('#wt-download-box')) {
  643. let items = `<li class="item" data-url="${downloadUrl}" data-type="copy" style="background-color: #00bcd4;color:#e0e0e0;">复制链接</li>`
  644. superVip._CONFIG_.downUtils.forEach((item, index) => {
  645. items += `
  646. <li class="item" data-url="${item.url + (item.isAppend?'':'?m3u8=') + downloadUrl}">${item.title}</li>
  647. `
  648. })
  649. $('body').append(`
  650. <div id="wt-download-box">
  651. <div class="close"></div>
  652. <div class="tips">* ${msg?msg + '(刷新页面或打开其它帖子链接将丢失,链接有效期60分钟)': '视频链接有效期60分钟,请尽快使用。'}</div>
  653. <ul>${items}</ul>
  654. </div>
  655. `)
  656. } else {
  657. $('#wt-download-box').empty()
  658. let items = `<li class="item" data-url="${downloadUrl}" data-type="copy" style="background-color: #00bcd4;color:#e0e0e0;">复制链接</li>`
  659. superVip._CONFIG_.downUtils.forEach((item, index) => {
  660. items += `
  661. <li class="item" data-url="${item.url + (item.isAppend?'':'?m3u8=') + downloadUrl}">${item.title}</li>
  662. `
  663. })
  664. $('#wt-download-box').append(`<view class="close"></view><div class="tips">* ${msg?msg + '(刷新页面或打开其它帖子链接将丢失,链接有效期60分钟)': '刷新页面或打开其它帖子链接将丢失,链接有效期60分钟'}</div><ul>${items}</ul>`)
  665. }
  666. if(superVip._CONFIG_.isMobile && superVip._CONFIG_.isMobile[0] == 'iPhone'){
  667. $('#wt-download-box ul')[0].innerHTML += `<li class="item" data-open="1" data-url="https://apps.apple.com/cn/app/m3u8-mpjex/id6449724938">苹果视频下载软件</li>`
  668. }
  669. if(superVip._CONFIG_.isMobile && superVip._CONFIG_.isMobile[0] == 'Android'){
  670. $('#wt-download-box ul')[0].innerHTML += `<li class="item" data-open="1" data-url="https://wwjf.lanzoul.com/isifQ18id4fa">安卓视频下载软件(密3y3a)</li>`
  671. }
  672. $("#wt-download-box").removeClass('hid-set-box');
  673. $("#wt-download-box").addClass('show-set-box');
  674. $("#wt-download-box .item").on('click', function(e) {
  675. const url = e.target.dataset.url
  676. if(e.target.dataset.type == 'copy'){
  677. if(url){
  678. util.copyText(url).then(res => {
  679. util.showTips({
  680. title: '视频地址复制成功,请尽快使用'
  681. })
  682. }).catch(err =>{
  683. util.showTips({
  684. title: '复制失败,请通过下面在线下载再复制输入框内的视频地址'
  685. })
  686. })
  687. }else{
  688. util.showTips({
  689. title: '抱歉,未检测到视频'
  690. })
  691. }
  692. return;
  693. }
  694. if (!url || !url.includes('.m3u8') && e.target.dataset.open != 1) {
  695. util.showTips({
  696. title: '抱歉,未检测到视频,还继续前往吗?',
  697. doubt: true,
  698. success: (res) => {
  699. if (res) {
  700. window.open(url)
  701. }
  702. }
  703. })
  704. } else {
  705. window.open(url);
  706. }
  707. })
  708. $("#wt-download-box .close").on('click', function() {
  709. $("#wt-mask-box").click()
  710. })
  711. },
  712. showNotify: (item = {}) => {
  713. $("#wt-notify-box").removeClass('hid-notify-box')
  714. $("#wt-notify-box").addClass('show-notify-box')
  715. let version = superVip._CONFIG_.version
  716. const v = /当前插件版本 (\d\.\d\.\d\.{0,1}\d{0,2})/.exec(item.title)
  717. if (v) item.title = item.title.replace(v[1], version)
  718. if (item.title) $('#wt-notify-box .content').html(item.title + (version ?
  719. '<div style="text-align: right;color: #ccc;font-size: 10px;margin-top: 10px;">v ' +
  720. version + '</div>' : ''))
  721. superVip._CONFIG_.showNotify = true
  722. $('#wt-notify-box a').on('click', (e) => {
  723. e.stopPropagation()
  724. })
  725. $('#wt-notify-box').on('click', () => {
  726. $("#wt-notify-box").removeClass('show-notify-box')
  727. $("#wt-notify-box").addClass('hid-notify-box')
  728. superVip._CONFIG_.showNotify = false
  729. if (item.success) item.success(true)
  730. })
  731. }
  732. }
  733. const superVip = (function() {
  734. const _CONFIG_ = {
  735. homeUrl: 'https://vip.luckychajian.cn',
  736. apiBaseUrl: 'https://api.luckychajian.com',
  737. cdnBaseUrl: 'https://cdn.luckychajian.com',
  738. guide: '如长时间无法登录请前往以下网站查看公告或尝试联系客服</br></br>Lucky公告网址</br></br><a href="http://luckychajian.3vhost.work?pwd=lucky">luckychajian.3vhost.work?pwd=lucky</a>',
  739. isMobile: navigator.userAgent.match(
  740. /(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i),
  741. vipBoxId: 'wt-vip-jx-box' + Math.ceil(Math.random() * 100000000),
  742. version: '1.0.2',
  743. videoUrl: {},
  744. downUtils: [
  745. {
  746. title: '在线下载1(适合电脑)',
  747. url: 'http://tools.bugscaner.com/m3u8.html',
  748. isAppend: false
  749. },
  750. {
  751. title: '在线下载2(适合电脑)',
  752. url: 'https://tools.thatwind.com/tool/m3u8downloader#m3u8=',
  753. isAppend: true
  754. },
  755. {
  756. title: '在线下载3(适合电脑)',
  757. url: 'https://blog.luckly-mjw.cn/tool-show/m3u8-downloader/index.html?source=',
  758. isAppend: true
  759. }
  760. ]
  761. }
  762. class BaseConsumer {
  763. constructor(body) {
  764. this.parse = () => {
  765. this.interceptHttp()
  766. util.findTargetElement('body').then(container => {
  767. this.generateElement(container).then(
  768. container => this.bindEvent(container))
  769. })
  770. }
  771. }
  772. interceptHttp() {
  773. if(location.href.includes('/pages/hjsq')){
  774. const interceptMedia = (element) => {
  775. if(element.src && element.src.match(/\.mp4$/)){
  776. if(!superVip._CONFIG_.videoUrl.playerUrl || superVip._CONFIG_.videoUrl.playerUrl != element.src){
  777. superVip._CONFIG_.videoUrl.downloadUrlSign = element.src
  778. superVip._CONFIG_.videoUrl.playerUrl = element.src
  779. superVip._CONFIG_.videoUrl.type = 0
  780. superVip._CONFIG_.videoUrl.playerType = 'mp4'
  781. util.showAndHidTips('wt_player_haijiao');
  782. }
  783. }
  784. };
  785. setInterval(()=>{
  786. document.querySelectorAll('#myVideo source').forEach(interceptMedia);
  787. },700)
  788. }
  789. const originOpen = XMLHttpRequest.prototype.open;
  790. XMLHttpRequest.prototype.open = function(method, url) {
  791. if(url.endsWith('movie/detail') || url.endsWith('album/search') || url.endsWith('album/photoList') || url.endsWith('post/search')){
  792. this.requestUrl = url
  793. _CONFIG_.videoUrl = {}
  794. util.showAndHidTips('wt_player_haijiao', 'set', false);
  795. if (_CONFIG_.isMobile && _CONFIG_.isMobile[0] == 'iPhone') {
  796. const xhr = this;
  797. const getter = Object.getOwnPropertyDescriptor(
  798. XMLHttpRequest.prototype,
  799. "response"
  800. ).get;
  801. Object.defineProperty(xhr, "responseText", {
  802. get: () => {
  803. let result = getter.call(xhr);
  804. try {
  805. _CONFIG_.videoUrl.aes = result
  806. return result;
  807. } catch (e) {
  808. console.log('发生异常! 解析失败!');;
  809. return result;
  810. }
  811. },
  812. });
  813. util.findTargetElementByVideoSrc().then(res =>{
  814. if(!_CONFIG_.videoUrl.playerUrl || !_CONFIG_.videoUrl.playerUrl.startsWith('http')){
  815. _CONFIG_.videoUrl.playerUrl = res
  816. util.showAndHidTips('wt_player_haijiao');
  817. }
  818. })
  819. }
  820. }
  821. if(url.endsWith('.m3u8')){
  822. if(!superVip._CONFIG_.videoUrl.requestErrMsg){
  823. superVip._CONFIG_.videoUrl = {
  824. playerUrl: url,
  825. downloadUrl: url
  826. }
  827. util.showAndHidTips('wt_player_haijiao');
  828. }
  829. }
  830. if(url.endsWith('movie/block')){
  831. util.findTargetElement('.van-dialog', 20).then(res =>{
  832. if(res.__vue__){
  833. if(res.__vue__.touchMove){
  834. res.__vue__.touchMove = null
  835. }else{
  836. res.__vue__.$parent.touchMove = null
  837. }
  838. }
  839. })
  840. }
  841. return originOpen.call(this, method, url);
  842. }
  843. const oldSend = XMLHttpRequest.prototype.send;
  844. XMLHttpRequest.prototype.send = async function (...args) {
  845. if(this.requestUrl){
  846. await initPlayerUrl(this, this.requestUrl, args)
  847. }
  848. return oldSend.call(this, ...args)
  849. };
  850. }
  851. generateElement(container) {
  852. GM_addStyle(`
  853. @font-face {
  854. font-family: 'iconfont'; /* Project id 4784633 */
  855. src: url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.woff2?t=1734418085047') format('woff2'),
  856. url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.woff?t=1734418085047') format('woff'),
  857. url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.ttf?t=1734418085047') format('truetype');
  858. }
  859. .iconfont {
  860. font-family: "iconfont" !important;
  861. font-size: 16px;
  862. font-style: normal;
  863. font-weight: 400 !important;
  864. -webkit-font-smoothing: antialiased;
  865. -moz-osx-font-smoothing: grayscale;
  866. }
  867. @keyframes showSetBox {
  868. 0% {
  869. transform: translate(-50%,-50%) scale(0);
  870. }
  871. 80% {
  872. transform: translate(-50%,-50%) scale(1.1);
  873. }
  874. 100% {
  875. transform: translate(-50%,-50%) scale(1);
  876. }
  877. }
  878. @keyframes hidSetBox {
  879. 0% {
  880. transform: translate(-50%,-50%) scale(1);
  881. }
  882. 80% {
  883. transform: translate(-50%,-50%) scale(1.1);
  884. }
  885. 100% {
  886. transform: translate(-50%,-50%) scale(0);
  887. }
  888. }
  889. @keyframes colorAnima {
  890. 0%{
  891. background-color: #f0f0f0;
  892. color: #5d5d5d;
  893. transform: scale(1);
  894. }
  895. 50%{
  896. transform: scale(1.1);
  897. }
  898. 100%{
  899. background-color: #ff6022;;
  900. color: white;
  901. transform: scale(1);
  902. }
  903. }
  904. @keyframes showNotifyBox {
  905. 0% {
  906. transform: translate(-50%,-100%) scale(0);
  907. }
  908. 80% {
  909. transform: translate(-50%,35px) scale(1.1);
  910. }
  911. 100% {
  912. transform: translate(-50%,35px) scale(1);
  913. }
  914. }
  915. @keyframes hidNotifyBox {
  916. 0% {
  917. transform: translate(-50%,35px) scale(1.1);
  918. }
  919. 80% {
  920. transform: translate(-50%,35px) scale(1);
  921. }
  922. 100% {
  923. transform: translate(-50%,-100%) scale(0);
  924. }
  925. }
  926. @keyframes scale {
  927. 0%{
  928. transform: scale(1);
  929. }
  930. 50%{
  931. transform: scale(1.1);
  932. }
  933. 100%{
  934. transform: scale(1);
  935. }
  936. }
  937. @keyframes circletokLeft {
  938. 0%,100% {
  939. left: 0px;
  940. width: 12px;
  941. height: 12px;
  942. z-index: 0;
  943. }
  944. 25% {
  945. height: 15px;
  946. width: 15px;
  947. z-index: 1;
  948. left: 8px;
  949. transform: scale(1)
  950. }
  951. 50% {
  952. width: 12px;
  953. height: 12px;
  954. left: 22px;
  955. }
  956. 75% {
  957. width: 10px;
  958. height: 10px;
  959. left: 8px;
  960. transform: scale(1)
  961. }
  962. }
  963. @keyframes circletokRight {
  964. 0%,100% {
  965. top: 3px;
  966. left: 22px;
  967. width: 12px;
  968. height: 12px;
  969. z-index: 0
  970. }
  971. 25% {
  972. height: 15px;
  973. width: 15px;
  974. z-index: 1;
  975. left: 24px;
  976. transform: scale(1)
  977. }
  978. 50% {
  979. width: 12px;
  980. height: 12px;
  981. left: 0px;
  982. }
  983. 75% {
  984. width: 10px;
  985. height: 10px;
  986. left: 24px;
  987. transform: scale(1)
  988. }
  989. }
  990. .color-anima{
  991. animation: colorAnima .3s ease 1 forwards;
  992. }
  993. .btn-anima{
  994. animation: scale .3s ease 1 forwards;
  995. }
  996. html .van-overflow-hidden, body{ overflow: auto !important;}
  997. .bg-page .main.blur{ filter: blur(0px) !important;}
  998. .ad-apps,.new,.van-dialog,.van-overlay,.my-swipe,.drag-area,.control,.android-ad{display:none !important;z-index:-99999 !important;opacity: 0!important;width :0 !important;}
  999. #wt-resources-box{position: relative; border: 1px dashed #ec8181;background: #fff4f4;}
  1000. .sell-btn{border:none !important;margin-top:20px;}
  1001. .margin-left{ margin-left: 0 !important;}
  1002. .show-set-box{ animation: showSetBox 0.3s ease 1 forwards;}
  1003. .hid-set-box{ animation: hidSetBox 0.3s ease 1 forwards;}
  1004. .show-notify-box{ animation: showNotifyBox 0.3s ease 1 forwards;}
  1005. .hid-notify-box{ animation: hidNotifyBox 0.3s ease 1 forwards;}
  1006. #wt-loading-box{display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 100000;background-color: #0000004d;}
  1007. #wt-loading-box .loading{position: absolute;width: 35px;height: 17px;top: 50%;left: 50%;transform: translate(-50%,-50%);}
  1008. #wt-loading-box .loading::before,
  1009. #wt-loading-box .loading::after{position: absolute;content: "";top: 3px;background-color: #ffe60f;width: 14px;height: 14px;border-radius: 20px;mix-blend-mode: multiply;animation: circletokLeft 1.2s linear infinite;}
  1010. #wt-loading-box .loading::after{animation: circletokRight 1.2s linear infinite;background-color: #4de8f4;}
  1011. #wt-left-show{ position: fixed;left: 20px;top: 50%;transform: translateY(-50%);z-index: 99999;transition: all 0.3s ease;}
  1012. #wt-left-show i {color: #5f5b5b;font-size: 27px;color: #e91e63;text-shadow: #e91e63 2px 2px 12px;font-size: 25px;margin-left: -1px;}
  1013. #wt-${_CONFIG_.vipBoxId}{
  1014. position: fixed;
  1015. top: 50%;
  1016. transform: translate(0, -50%);
  1017. right: 10px;
  1018. width: 46px;
  1019. border-radius: 30px;
  1020. background: rgb(64 64 64 / 81%);
  1021. box-shadow: 1px 1px 8px 1px rgb(98 99 99 / 34%);
  1022. z-index: 99999;
  1023. transition: all 0.3s ease;
  1024. }
  1025. #wt-${_CONFIG_.vipBoxId} .item{position: relative;height: 60px;}
  1026. .tips-yuan::before{ position: absolute; content: '';top: 12px; right: 6px;width: 8px;height: 8px; border-radius: 10px; background-color: #5ef464;}
  1027. .tips-yuan-err::before{ position: absolute; content: '';top: 12px; right: 6px;width: 8px;height: 8px; border-radius: 10px; background-color: #f83f32;}
  1028. #wt-${_CONFIG_.vipBoxId} .item .iconfont,#wt-${_CONFIG_.vipBoxId} .item img{position: absolute;top:50%;left:50%;transform: translate(-50%,-50%)}
  1029. #wt-login-box .close,#wt-set-box .close,#wt-notify-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;z-index: 100;}
  1030. #wt-login-box .close::before,#wt-login-box .close::after,#wt-set-box .close::before,#wt-set-box .close::after,#wt-notify-box .close::before,#wt-notify-box .close::after{position: absolute;left: 50%;top: 50%;content: '';width: 12px;height: 2px;border-radius: 1px;background-color: #6a6a6a;transform: translate(-50%,-50%) rotate(45deg);visibility: visible;}
  1031. #wt-login-box .close::after,#wt-set-box .close::after,#wt-notify-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);}
  1032. #wt-${_CONFIG_.vipBoxId} .absolute-center{ position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);}
  1033. #wt-${_CONFIG_.vipBoxId} #wt-my img{ width: 28px;height: 28px;border-radius: 30px;margin-left: 2px;transtion: all 0.3s ease;}
  1034. #wt-${_CONFIG_.vipBoxId} #wt-my-set i {color: white;font-size: 24px;text-shadow: 2px 2px 14px #ffffff;font-family: 'iconfont';}
  1035. #wt-${_CONFIG_.vipBoxId} #wt-my-down i {color: white;font-size: 24px;text-shadow: 2px 2px 15px #ffffff;font-family: 'iconfont';}
  1036. #wt-${_CONFIG_.vipBoxId} #wt-my-notify i {color: white;font-size: 27px;padding: 10px 1px;text-shadow: 2px 2px 12px #ffffff;}
  1037. #wt-${_CONFIG_.vipBoxId} #wt-hid-box i {color: white;font-size: 21px;text-shadow: 2px 2px 12px #ffffff;margin-left: -1px;}
  1038. .wt-player-btn-box .player-btn{ position:absolute;top:42%;left:50%;transform:translate(-50%,-50%);width: 20%}
  1039. .wt-player-btn-box .tips{ position: absolute;bottom: 20px;left:50%;transform: translateX(-50%);color: #FFC107;width: 80%;text-align: center;font-size: 15px;font-weight: 500;}
  1040. #wt-mask-box,#wt-maxindex-mask{display:none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background-color: #00000057;}
  1041. #wt-maxindex-mask{z-index: 90000;display:none;}
  1042. #wt-set-box{ position:fixed; top:50%;left:50%; transform: translate(-50%,-50%) scale(0);overflow: hidden;background-color: white;box-shadow: 0 15px 30px rgba(0, 0, 0, .15);border-radius: 12px;z-index: 10010;padding: 10px 15px;padding-right: 5px;box-sizing: border-box;width: 300px;}
  1043. #wt-set-box::before{display:none; content:'';position: absolute;width: 150px;height: 150px;border-radius: 100px;background-color: #2196F3;z-index: -1;opacity: 0.7;bottom: 0;transform: translate(-40%,58%);}
  1044. #wt-set-box::after{display:none;content:'';position: absolute;width: 150px;height: 150px;border-radius: 100px;background-color: #FFC107;z-index: -1;opacity: 0.7;top: 0;right: 0;transform: translate(22%,-53%);}
  1045. #wt-set-box .selected-box .selected{ background-color: #ff6022;color: white;}
  1046. #wt-set-box .user-box-container{display: none;letter-spacing: 1px;}
  1047. #wt-set-box .info-box{display:flex;height: 50px;align-items: center;}
  1048. #wt-set-box .expire{ opacity: 0.35;}
  1049. #wt-set-box .info-box .avatar-box{position: relative;height: 36px;width: 36px;background-color: white;border-radius: 7px;box-shadow: rgb(166 166 166 / 20%) 0px 1px 20px 0px;}
  1050. #wt-set-box .user-box .title{text-align: center;font-weight: 600;font-size: 16px;color: #3a3a3a;}
  1051. #wt-set-box .user-box .desc{display: flex;flex-direction: column;height: 36px;justify-content: space-around;flex: 8;font-size: 10px;color: #5d5d5d;margin-left: 10px;}
  1052. #wt-set-box .user-box .vip-day{margin-right: 10px;text-align: center;color: #8a8a8a;font-size: 11px;}
  1053. #wt-set-box .user-box .avatar{position: absolute; width: 36px;height:36px;border-radius: 30px;border-radius: 7px;font-size: 0;}
  1054. #wt-set-box .user-box .user-info{ position: relative; left: -5px; display: flex;align-items: center;margin-bottom: 4px;background-color: #f1f1f1;border-radius: 11px;padding: 7px;}
  1055. #wt-set-box .user-box .user-info .info{margin-left: 10px;width: 180px;}
  1056. #wt-set-box .user-box .user-info .info .nickname{color: #676767;font-size: 12px;letter-spacing: 1px;}
  1057. #wt-set-box .user-box .user-info .info .username{color: #b9b9b9;font-size: 10px;margin-top: 2px;}
  1058. #wt-set-box .user-box .user-info .logout{position: absolute;font-size: 0;right: 12px;}
  1059. #wt-set-box .user-box .user-info .logout button{padding: 0 10px;height: 28px;background-color: #615b5b;border-radius: 30px;color: white;border: none;font-size: 10px;}
  1060. #wt-set-box .user-box .apps-container{ height: 330px; overflow: auto; margin-bottom: 10px;}
  1061. #wt-tips-box,#wt-download-box{ position:fixed;top:50%;left:50%;transform:translate(-50%,-50%) scale(0);overflow: hidden;width: 240px;min-height:130px;background-color: white;border-radius:12px;z-index: 95000;padding:10px 15px;}
  1062. #wt-tips-box,#wt-download-box .tips{ font-size: 10px;margin-top: 30px;color: #00bcd4;letter-spacing: 1px;}
  1063. #wt-tips-box .title{font-size: 16px;text-align: center;font-weight: 600;}
  1064. #wt-tips-box .content{text-align: center;margin: 14px 0;font-size: 12px;color: #2a2a2a;font-weight: 500;word-break: break-word;}
  1065. #wt-tips-box .content p{color: #ff4757;text-align: left;}
  1066. #wt-tips-box a{color: #1E88E5;text-decoration: underline;}
  1067. #wt-tips-box .btn-box{display:flex;justify-content: space-around;}
  1068. #wt-tips-box .btn-box button{min-width: 60px;height: 28px;background-color: #00bcd4;border-radius: 30px;color: white;border: none;font-size: 12px;}
  1069. #wt-tips-box .btn-box .cancel{display: none;background-color: #eee;color:#2a2a2a}
  1070. #wt-tips-box .logo{position: absolute;top: 9%;left: 1%; color: #dbdbdb; font-size: 11px;transform: rotate(-15deg);text-align: center;z-index: -10;}
  1071. #wt-tips-box .version{position: absolute;top: 5%; right: 10%;transform: rotate(-15deg);color: #dbdbdb;}
  1072. #wt-notify-box {position: fixed;top: 2%;left: 50%;transform:translate(-50%,-100%) scale(0);overflow: hidden;width: 80%;min-height: 75px;letter-spacing: 1px;background-color: white;color:#2a2a2a;border-radius: 15px;box-shadow: 0 15px 30px rgba(0, 0, 0, .15);z-index: 95000;}
  1073. #wt-notify-box::after{display:none; content:'';position: absolute;width: 250px;height: 250px;border-radius: 200px;background-color: #03A9F4;z-index: -1;opacity: 0.7;bottom: 0;left: 0;transform: translate(-50%,85%);}
  1074. #wt-notify-box .title{ text-align: center;height: 35px; line-height: 35px;font-size: 15px;font-weight: 600; color: #00bcd4;}
  1075. #wt-notify-box .content{ color: #3a3a3a;padding: 10px 15px;font-size: 12px;}
  1076. #wt-notify-box .content a{color: #1E88E5;text-decoration: underline;}
  1077. #wt-notify-box .content p{margin-bottom: 5px;}
  1078. .wt-player-btn-box{ position:absolute;top:0;left:0;right:0;bottom:0;z-index: 99998;background-color: #0000004d;}
  1079. #wt-video-container{display: none; position:fixed;top: 0;left: 0;right: 0;bottom: 0; z-index: 99998;background-color: black;}
  1080. #wt-video-container .wt-video{ position:absolute;top:50%;width:100%;transform: translateY(-50%);height: 240px; z-index: 99999;}
  1081. #wt-video-container .wt-video video{width:100%;height: 100%;}
  1082. .dplayer-controller{bottom: 30px !important;}
  1083. .main-player{height: 300px;}
  1084. .dplayer.dplayer-hide-controller .dplayer-controller{ opacity: 0 !important;transform: translateY(200%) !important;}
  1085. .wt-close-btn{ font-size: 15px;position: absolute;top: 40px;left: 25px;color: white;}
  1086. #wt-download-box{ z-index: 10010;}
  1087. #wt-download-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;}
  1088. #wt-download-box .close::before,#wt-download-box .close::after{position: absolute;left: 50%;top: 50%;content: '';width: 14px;height: 2px;border-radius: 1px;background-color: #adadad;transform: translate(-50%,-50%) rotate(45deg);}
  1089. #wt-download-box .close::after,#wt-download-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);}
  1090. #wt-download-box::before{display:none; content:'';position: absolute;width: 150px;height: 150px;border-radius: 100px;background-color: #00bcd4;z-index: -1;opacity: 0.7;top: 0;left: 0;transform: translate(-38%,-40%);}
  1091. #wt-download-box::after{display:none;content:'';position: absolute;width: 150px;height: 150px;border-radius: 100px;background-color: #FFC107;z-index: -1;opacity: 0.7;bottom: 0;right: 0;transform: translate(62%,30%);}
  1092. #wt-download-box ul li{ height: 38px;line-height: 38px;font-size: 11px;text-align: center;color:#909090;font-weight: 500;background-color: white;box-shadow: rgb(166 166 166 / 20%) 0px 1px 5px 1px;margin: 18px 30px;border-radius: 40px;}
  1093. `)
  1094. if (_CONFIG_.isMobile) {
  1095. GM_addStyle(`
  1096. #wt-set-box {width:80%;}
  1097. `);
  1098. }
  1099. const roles = util.initAppDate(false);
  1100. $(container).append(`
  1101. <div id="wt-${_CONFIG_.vipBoxId}">
  1102. <div id="wt-my" class="item wt_my_haijiao">
  1103. <img src="${_CONFIG_.cdnBaseUrl + '/image/app.png'}"></img>
  1104. </div>
  1105. <div id="wt-my-set" class="item wt_player_haijiao">
  1106. <i class="iconfont">&#xe623;</i>
  1107. </div>
  1108. <div id="wt-my-down" class="item wt_my_down_haijiao">
  1109. <i class="iconfont">&#xe61c;</i>
  1110. </div>
  1111. <div id="wt-my-notify" class="item wt_my_notify" style="padding: 0 11px;">
  1112. <i class="iconfont">&#xe604;</i>
  1113. </div>
  1114. <div id="wt-hid-box" class="item">
  1115. <i class="iconfont">&#xe65f;</i>
  1116. </div>
  1117. </div>
  1118. <div id="wt-left-show" style="transform: translate(-60px,-50%);padding: 10px;">
  1119. <i class="iconfont">&#xe675;</i>
  1120. </div>
  1121. <div id="wt-mask-box"></div>
  1122. <div id="wt-set-box">
  1123. <div class="close"></div>
  1124. <div class="line-box" style="display:none">
  1125. </div>
  1126. <div class="user-box-container">
  1127. <div class="user-box">
  1128. <div class="title" style="margin-bottom: 10px">App</div>
  1129. <div class="user-info">
  1130. <div class="avatar" style="position: relative;">
  1131. <img src="${_CONFIG_.cdnBaseUrl + '/image/app.png'}" style="width: 100%;height: 100%;border-radius: 8px;"></img>
  1132. </div>
  1133. <div class="info">
  1134. <div class="nickname">请登录</div>
  1135. <div class="username">xxxxxxxxxx</div>
  1136. </div>
  1137. <div class="logout">
  1138. <button>退出登录</button>
  1139. </div>
  1140. </div>
  1141. <div class="apps-container"> ${roles}</div>
  1142. </div>
  1143. </div>
  1144. </div>
  1145. <div id="wt-loading-box">
  1146. <div class="loading"></div>
  1147. </div>
  1148. <div id="wt-maxindex-mask"></div>
  1149. <div id="wt-tips-box">
  1150. <div class="title">提示</div>
  1151. <div class="content"></div>
  1152. <div class="btn-box">
  1153. <button class='cancel'>取消</button>
  1154. <button class='submit'>确定</button>
  1155. </div>
  1156. <div class="logo"><p>@${superVip._CONFIG_.homeUrl}</p></div>
  1157. <div class="version"><p>v ${superVip._CONFIG_.version}</p></div>
  1158. </div>
  1159. <div id="wt-notify-box">
  1160. <div class="close"></div>
  1161. <div class="title">通知</div>
  1162. <div class="content"></div>
  1163. </div>
  1164. <div id="wt-video-container">
  1165. <div class="wt-close-btn">
  1166. <i class="van-icon van-icon-close"></i>
  1167. <span style="margin-left: 5px;">退出播放</span>
  1168. </div>
  1169. <div class="wt-video">
  1170. <video id="wt-video" controls></video>
  1171. </div>
  1172. </div>
  1173. `)
  1174. if (_CONFIG_.user && _CONFIG_.user.avatar) {
  1175. util.logined()
  1176. }
  1177. return new Promise((resolve, reject) => resolve(container));
  1178. }
  1179. bindEvent(container) {
  1180. const vipBox = $(`#wt-${_CONFIG_.vipBoxId}`)
  1181. if (GM_getValue('haijiao_hid_controller', null)) {
  1182. vipBox.css("transform", "translate(125%, -50%)")
  1183. $('#wt-left-show').css("transform", "translate(0, -50%)")
  1184. }
  1185. vipBox.find("#wt-my").on("click", () => {
  1186. if (_CONFIG_.user) {
  1187. $('#wt-mask-box').css('display', 'block')
  1188. $("#wt-set-box .user-box-container").css('display', 'block')
  1189. $("#wt-set-box").removeClass('hid-set-box')
  1190. $("#wt-set-box").addClass('show-set-box')
  1191. $('#wt-set-box .user-box-container .nickname').html(_CONFIG_.user.nickname)
  1192. util.initAppDate()
  1193. } else {
  1194. util.addLogin()
  1195. $('#wt-login-mask').css('display','block')
  1196. $("#wt-login-box").removeClass('hid-set-box')
  1197. $("#wt-login-box").addClass('show-set-box')
  1198. const jsxl_login_code = GM_getValue('jsxl_login_code','')
  1199. if(jsxl_login_code){
  1200. try{
  1201. const user = JSON.parse(jsxl_login_code)
  1202. if(user.u && user.u != 'undefined'){
  1203. $("#wt-login-box input")[0].value = user.u;
  1204. }
  1205. if(user.p && user.p != 'undefined'){
  1206. $("#wt-login-box input")[1].value = user.p;
  1207. }
  1208. }catch(e){}
  1209. }
  1210. }
  1211. })
  1212. vipBox.find("#wt-my-set").on("click", async () => {
  1213. try{
  1214. document.querySelector('video').pause()
  1215. }catch(e){}
  1216. if (!_CONFIG_.user) {
  1217. $("#wt-my").click()
  1218. return
  1219. }
  1220. if(_CONFIG_.videoUrl.requestErrMsg){
  1221. util.showTips({ title: _CONFIG_.videoUrl.requestErrMsg})
  1222. return
  1223. }
  1224. if (!_CONFIG_.videoUrl.playerUrl) {
  1225. $('#wt-loading-box').css('display', 'block')
  1226. for (let i = 0; i < 3; i++) {
  1227. await util.sleep(1000)
  1228. if (_CONFIG_.videoUrl.playerUrl) {
  1229. $('#wt-loading-box').css('display', 'none')
  1230. break
  1231. }
  1232. }
  1233. $('#wt-loading-box').css('display', 'none')
  1234. }
  1235. if (_CONFIG_.videoUrl?.playerUrl) {
  1236. $('#wt-video-container').css('display', 'block')
  1237. $("#wt-hid-box").click()
  1238. if(_CONFIG_.videoUrl.playerType == 'mp4'){
  1239. $('.wt-video').empty()
  1240. $('.wt-video').append(`
  1241. <video controls width="100%" height="100%">
  1242. <source src="${_CONFIG_.videoUrl?.playerUrl}">
  1243. </video>
  1244. `)
  1245. return
  1246. }
  1247. if (_CONFIG_.isMobile && _CONFIG_.isMobile[0] == 'iPhone') {
  1248. $('.wt-video').empty()
  1249. $('.wt-video').append(`
  1250. <video controls width="100%" height="100%">
  1251. <source src="${_CONFIG_.videoUrl.playerUrl}" type="application/x-mpegURL">
  1252. </video>
  1253. `)
  1254. } else {
  1255. const video = document.querySelector('.wt-video #wt-video')
  1256. _CONFIG_.hls_dp = new Hls()
  1257. _CONFIG_.hls_dp.loadSource(_CONFIG_.videoUrl.playerUrl)
  1258. _CONFIG_.hls_dp.attachMedia(video)
  1259. _CONFIG_.hls_dp.on(Hls.Events.MANIFEST_PARSED, function() {
  1260. video.play()
  1261. })
  1262. }
  1263. }
  1264. if (!_CONFIG_.videoUrl.playerUrl) {
  1265. util.showTips({
  1266. title: '</br>抱歉未检测到帖子视频,请关掉其它插件再试,或苹果用Focus浏览器,安卓用Via浏览器再试'
  1267. })
  1268. }
  1269. })
  1270. $('#wt-video-container div').on('click', function(e) {
  1271. e.stopPropagation()
  1272. })
  1273. $('.wt-close-btn').on('click', function() {
  1274. $('#wt-video-container').css('display', 'none')
  1275. var videos = document.querySelectorAll('video');
  1276. videos.forEach(function(video) {
  1277. // video.volume = 0.0
  1278. video.pause();
  1279. });
  1280. if (_CONFIG_.hls_dp) _CONFIG_.hls_dp.destroy()
  1281. $("#wt-left-show").click();
  1282. })
  1283. vipBox.find("#wt-my-down").on("click", () => {
  1284. if (!_CONFIG_.user) {
  1285. $("#wt-my").click()
  1286. return
  1287. }
  1288. if(_CONFIG_.isMobile && _CONFIG_.isMobile[0] == 'iPhone' && (!_CONFIG_.videoUrl.aes || !_CONFIG_.videoUrl.playerUrl)){
  1289. util.showTips({ title: '抱歉,未检测到视频'})
  1290. return
  1291. }
  1292. if(_CONFIG_.videoUrl.requestErrMsg){
  1293. util.showTips({ title: _CONFIG_.videoUrl.requestErrMsg})
  1294. return
  1295. }
  1296. if(_CONFIG_.videoUrl.downloadUrlSign){
  1297. util.showDownLoadWindow();
  1298. return;
  1299. }
  1300. if (_CONFIG_.videoUrl.downloadUrl || _CONFIG_.videoUrl.aes) {
  1301. if(_CONFIG_.user && _CONFIG_.user.stopDownload || (_CONFIG_.user.role.use_download_num == _CONFIG_.user.role.max_download_num) ){
  1302. util.showTips({
  1303. title: '抱歉,今日下载次数' + _CONFIG_.user.role.max_download_num + '次已经用完,请明日再下载'
  1304. })
  1305. return;
  1306. }
  1307. util.showTips({
  1308. title: '为了插件的稳定现已日限下载</br>(当前账号日限' + _CONFIG_.user.role.max_download_num +'次,' + superVip._CONFIG_.user.downloadTips +',已使用' + _CONFIG_.user.role.use_download_num +'次,每个插件每日各' + _CONFIG_.user.role.max_download_num +'次),</br>您确定要消耗一次次数来获取视频链接吗(如失败不计数)?',
  1309. doubt: true,
  1310. success: async (confirm) => {
  1311. if (confirm) {
  1312. try {
  1313. $('#wt-loading-box').css('display', 'block')
  1314. await util.sleep(300);
  1315. let obj = ''
  1316. if(_CONFIG_.isMobile && _CONFIG_.isMobile[0] == 'iPhone'){
  1317. obj = {
  1318. code: encodeURIComponent(_CONFIG_.videoUrl.aes),
  1319. isAes: true,
  1320. origin: location.origin
  1321. }
  1322. }else{
  1323. obj = {
  1324. code: ec.knxkbxen(_CONFIG_.videoUrl.downloadUrl.startsWith('http')?_CONFIG_.videoUrl.downloadUrl: location.origin + _CONFIG_.videoUrl.downloadUrl)
  1325. }
  1326. }
  1327. $.ajax({
  1328. url: superVip._CONFIG_.apiBaseUrl + '/d' + (Math.floor(Math.random() * 3) + 1) +'00/downloadTangxin',
  1329. method: 'POST',
  1330. headers: { 'luckyToken': superVip._CONFIG_.user.token},
  1331. contentType: 'application/json',
  1332. data: JSON.stringify(obj),
  1333. dataType: 'json',
  1334. success: function(response) {
  1335. $('#wt-loading-box').css('display', 'none')
  1336. if (response.errCode != 0) {
  1337. throw new Error(response.errMsg)
  1338. }
  1339. if(response.newToken) _CONFIG_.user.token = response.newToken;
  1340. _CONFIG_.user.role.use_download_num = response.useDownloadNum
  1341. _CONFIG_.videoUrl.downloadUrlSign = response.data
  1342. util.showDownLoadWindow(true, response.errMsg);
  1343. GM_setValue('jsxl_user', _CONFIG_.user);
  1344. },
  1345. error: function(error) {
  1346. $('#wt-loading-box').css('display', 'none')
  1347. util.showTips({
  1348. title: '请求jsxl失败'
  1349. })
  1350. }
  1351. })
  1352. } catch (e) {
  1353. console.log(e)
  1354. $('#wt-loading-box').css('display', 'none')
  1355. util.showTips({
  1356. title: e.message +
  1357. '</br>获取下载链接失败,可能此版块视频不支持下载'
  1358. })
  1359. if(e.message.includes('明日再下载')){
  1360. _CONFIG_.user.stopDownload = true
  1361. _CONFIG_.user.role.use_download_num = _CONFIG_.user.role.max_download_num
  1362. GM_setValue('jsxl_user', _CONFIG_.user);
  1363. }
  1364. }
  1365. }
  1366. }
  1367. })
  1368. return;
  1369. }
  1370. util.showTips({
  1371. title: '需要播放按钮有小绿点或暂不支持下载'
  1372. })
  1373. })
  1374. vipBox.find("#wt-hid-box").on("click", () => {
  1375. vipBox.css("transform", "translate(125%, -50%)");
  1376. $('#wt-left-show').css("transform", "translate(0, -50%)")
  1377. GM_setValue('haijiao_hid_controller', 1)
  1378. })
  1379. $('#wt-left-show').on('click', () => {
  1380. $('#wt-left-show').css("transform", "translate(-60px, -50%)");
  1381. vipBox.css("transform", "translate(0, -50%)")
  1382. GM_setValue('haijiao_hid_controller', '')
  1383. })
  1384. $('#wt-mask-box').on('click', () => {
  1385. $('#wt-mask-box').css('display', 'none')
  1386. $("#wt-set-box").removeClass('show-set-box');
  1387. $("#wt-set-box").addClass('hid-set-box')
  1388. $("#wt-download-box").removeClass('show-set-box');
  1389. $("#wt-download-box").addClass('hid-set-box')
  1390. setTimeout(() => {
  1391. $("#wt-set-box .line-box").css('display', 'none');
  1392. $("#wt-set-box .user-box-container").css('display', 'none')
  1393. }, 500)
  1394. })
  1395. $("#wt-set-box .close").on("click", () => {
  1396. $('#wt-mask-box').click()
  1397. })
  1398. vipBox.find("#wt-my-notify").on("click", () => {
  1399. if (_CONFIG_.showNotify) {
  1400. $('#wt-notify-box').click()
  1401. } else {
  1402. const notify = GM_getValue('notify', '');
  1403. if (notify) {
  1404. util.showNotify({
  1405. title: notify
  1406. })
  1407. GM_setValue('notifyShow', false);
  1408. util.showAndHidTips('wt_my_notify', 'set', false)
  1409. } else {
  1410. util.showNotify({
  1411. title: '还没有通知信息'
  1412. })
  1413. };
  1414. }
  1415. })
  1416. $("#wt-set-box .user-box .user-info").on('click', function() {
  1417. util.showTips({
  1418. title: '确定要跳转到插件官网吗?',
  1419. doubt: true,
  1420. success: (res) =>{
  1421. if(res){
  1422. location.href = superVip._CONFIG_.homeUrl
  1423. }
  1424. }
  1425. })
  1426. })
  1427. $('#wt-set-box .logout').on('click', function(e) {
  1428. util.showTips({
  1429. title: '您确定要退出登录吗?',
  1430. doubt: true,
  1431. success: (res) => {
  1432. if (res) {
  1433. util.logouted()
  1434. $('#wt-mask-box').click()
  1435. }
  1436. }
  1437. })
  1438. e.stopPropagation()
  1439. })
  1440. if (!_CONFIG_.user) {
  1441. util.addLogin()
  1442. util.findTargetElement('#wt-my').then(res => {
  1443. setTimeout(() => {
  1444. res.click()
  1445. }, 2500)
  1446. })
  1447. }
  1448. if(GM_getValue('notifyShow')){
  1449. util.showAndHidTips('wt_my_notify')
  1450. }
  1451. }
  1452. }
  1453. return {
  1454. start: () => {
  1455. _CONFIG_.user = GM_getValue('jsxl_user', '')
  1456. if (_CONFIG_.user) {
  1457. if (_CONFIG_.user.login_date && (_CONFIG_.user.login_date != new Date().setHours(0, 0, 0,
  1458. 0))) {
  1459. _CONFIG_.user = ''
  1460. GM_setValue('jsxl_user', '')
  1461. }
  1462. }
  1463. new BaseConsumer().parse()
  1464. },
  1465. _CONFIG_
  1466. }
  1467. })();
  1468. superVip.start();
  1469. }
  1470. if(!window.jQuery){
  1471. const script = document.createElement('script');
  1472. script.src = 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js';
  1473. script.onload = function() {
  1474. init(window.jQuery)
  1475. };
  1476. script.onerror = function(e) {
  1477. alert('jquery初始化失败')
  1478. };
  1479. document.head.appendChild(script);
  1480. }else{
  1481. init(window.jQuery)
  1482. }