├── README.md └── haijiao.user.js /README.md: -------------------------------------------------------------------------------- 1 | # haijiao 2 | 海角社区无限制看付费帖子,海角社区下载视频等/海角社区/海角社区/海角社区/海角社区/海角社区/海角社区/海角社区/海角社区/海角社区/海角社区 3 |

插件获取地址

4 | https://vip.luckychajian.com 5 | -------------------------------------------------------------------------------- /haijiao.user.js: -------------------------------------------------------------------------------- 1 | // ==UserScript== 2 | // @name 海角社区 3 | // @version 1.0.0 4 | // @updateDesc 5 | // @description 🔥免费无限制看付费视频,下载视频(日限),复制播放链接,保存账号密码免输入,帖子是否有视频图片提示(标题前缀),自动展开帖子,屏蔽广告等 6 | // @icon https://cdn.luckychajian.com/image/boy.jpeg 7 | // @namespace 海角社区 8 | // @author lucky 9 | // @include */pages/hjsq* 10 | // @include *://hj*.*/* 11 | // @include *://*.hj*.*/* 12 | // @include *://*.hai*.*/* 13 | // @include *://hai*.*/* 14 | // @include *://hj*/* 15 | // @include *://*.hj*/* 16 | // @include *://paidaa.*/* 17 | // @include *://*.paidaa.*/* 18 | // @include */post/details/* 19 | // @include *://blog.luckly-mjw.cn/* 20 | // @include *://tools.thatwind.com/* 21 | // @include *://tools.bugscaner.com/* 22 | // @include *://m3u8-player.com/* 23 | // @match *://*/post/details* 24 | // @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js 25 | // @require https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.5.8/hls.min.js 26 | // @require https://cdnjs.cloudflare.com/ajax/libs/dplayer/1.27.1/DPlayer.min.js 27 | // @run-at document-start 28 | // @grant unsafeWindow 29 | // @grant GM_addStyle 30 | // @grant GM_getValue 31 | // @grant GM_setValue 32 | // @grant GM_xmlhttpRequest 33 | // @connect haijiao.live 34 | // @charset UTF-8 35 | // @antifeature payment 36 | // @updateURL https://cdn.luckychajian.com/script/haijiao.user.js 37 | // @downloadURL https://cdn.luckychajian.com/script/haijiao.user.js 38 | // @license MIT 39 | // ==/UserScript== 40 | 41 | const encode = function(s, plus) { 42 | const cfsed = encodeURIComponent; 43 | const csrdfd = unescape; 44 | return plus ? ec.swaqbt(ec.swaqbt(csrdfd(cfsed(s))), false) : ec.swaqbt(ec.swaqbt(s), false); 45 | } 46 | 47 | const decode = function(s, plus) { 48 | const obj = {}; 49 | const sfscc = 'wt' + Math.ceil(Math.random() * 100000000); 50 | if (!superVip._CONFIG_.user || !superVip._CONFIG_.user.token) { 51 | util.showTips({ 52 | title: '请退出插件登录后重新登录插件,user|token not_exists', 53 | success: (res)=>{ 54 | if(res){ 55 | window.location.reload(); 56 | } 57 | } 58 | }) 59 | return; 60 | } 61 | obj[sfscc] = escape; 62 | return plus ? decodeURIComponent(obj[sfscc](ec.sfweccat(ec.sfweccat(s), false))) : 63 | decodeURIComponent(ec.sfweccat(ec.sfweccat(s), false)); 64 | } 65 | 66 | const asyncXmlhttpRequest = function (url, method, params = {}){ 67 | return new Promise((res, rej) =>{ 68 | const request = { 69 | method: method, 70 | url: url, 71 | onload: function(response) { 72 | if(response.responseText){ 73 | let result = '' 74 | try{ 75 | result = JSON.parse(response.responseText) 76 | }catch(e){ 77 | result = response.responseText 78 | } 79 | res(result) 80 | }else{ 81 | rej('请求失败_null') 82 | } 83 | }, 84 | onerror: function(e){ 85 | rej('请求失败_err') 86 | }, 87 | ontimeout: function(e){ 88 | rej('请求超时') 89 | } 90 | } 91 | 92 | if(params.data) request.data = params.data; 93 | if(params.headers) request.headers = params.headers; 94 | GM_xmlhttpRequest(request); 95 | }) 96 | } 97 | 98 | const md5x = function(s, type) { 99 | try { 100 | if (!type) { 101 | const date = new Date().setHours(0, 0, 0, 0) + ''; 102 | const day = new Date().getDate(); 103 | const code = date.substring(4, 8) * new Date().getDate() + ''; 104 | return ec.swaqbt(JSON.stringify({ 105 | date: date, 106 | code: code, 107 | day: day 108 | })); 109 | } else { 110 | const token = JSON.parse(ec.sfweccat(s)); 111 | if ((new Date(Number(token.date)).getTime() + 86400000) < Date.now()) { 112 | throw Error('md5x expire'); 113 | } 114 | if (token.day != new Date(Number(token.date)).getDate()) { 115 | throw Error('md5x err'); 116 | } 117 | const code = (new Date(Number(token.date)).setHours(0, 0, 0, 0) + '').substring(4, 8) * token.day; 118 | if (code != token.code) { 119 | throw Error('md5x err2'); 120 | } 121 | return token; 122 | } 123 | } catch (e) { 124 | return ''; 125 | } 126 | } 127 | 128 | const checkDuration = function(m3u8Content) { 129 | let sumDuration = 0; 130 | let DurationReg = new RegExp('#EXTINF:(.+),', 'g') 131 | let reg = '' 132 | while ((reg = DurationReg.exec(m3u8Content)) !== null) { 133 | sumDuration += Number(reg[1]); 134 | } 135 | return sumDuration 136 | } 137 | 138 | const serializeVideo = async (str) => { 139 | if (!str) { 140 | return ''; 141 | } 142 | try { 143 | const item = ec.cskuecede(str.replace('9JSXL', '')); 144 | if (typeof(item) != 'object') { 145 | return ''; 146 | } 147 | try{ 148 | if(item.ur){ 149 | deList(item, ['ke', 'ur']) 150 | superVip._CONFIG_.videoUrl.keyUrl = item.ke 151 | let res = await asyncXmlhttpRequest(item.ur, "GET") 152 | if(res.startsWith('#EXTM3')){ 153 | const keyUrl = /enc.+\.key/.exec(res) 154 | res = res.replace(keyUrl[0], item.ke + keyUrl[0]) 155 | const file = new Blob([res], { 156 | type: 'text/plain' 157 | }) 158 | return URL.createObjectURL(file); 159 | }else{ 160 | for(let i = 0;i< 5; i++){ 161 | let res = await asyncXmlhttpRequest(item.ur, "GET") 162 | if(res.startsWith('#EXTM3')){ 163 | const keyUrl = /enc.+\.key/.exec(res) 164 | res = res.replace(keyUrl[0], item.ke + keyUrl[0]) 165 | const file = new Blob([res], { 166 | type: 'text/plain' 167 | }) 168 | return URL.createObjectURL(file); 169 | } 170 | } 171 | return '解析失败' 172 | } 173 | } 174 | }catch(e){ 175 | console.log(e) 176 | } 177 | let duration = '1.250000'; 178 | deList(item, ['std', 'du', 'ke', 'st']) 179 | const countNum = item.std.split('-')[1] - item.std.split('-')[0]; 180 | try { 181 | if (item.du && item.du > 40) { 182 | duration = (item.du / (countNum + 1)).toFixed(6); 183 | if (duration > 2 || duration < 0.5) { 184 | duration = '1.250000'; 185 | } 186 | } 187 | } catch (e) {} 188 | 189 | if(superVip._CONFIG_.videoUrl.key && (superVip._CONFIG_.videoUrl.key != item.ke)){ 190 | const keyReg = /\/(enc_.+)/.exec(item.ke) 191 | if(keyReg && keyReg.length > 1){ 192 | item.ke= superVip._CONFIG_.videoUrl.key + keyReg[1] 193 | $.ajax({ 194 | method: 'GET', 195 | url: superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/updateKey?id=' + ec.knxkbxen(item._id) + '&key=' + ec.knxkbxen(item.ke), 196 | timeout: 8000, 197 | headers: { 198 | 'luckyToken': superVip._CONFIG_.user.token 199 | }, 200 | success: (response) =>{ 201 | if(response.newToken){ 202 | if(response.newToken) superVip._CONFIG_.user.token = response.newToken; 203 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 204 | } 205 | } 206 | }) 207 | } 208 | } 209 | let m3u8Content = '#EXTM3U' + '\r\n'; 210 | m3u8Content += '#EXT-X-VERSION:3' + '\r\n'; 211 | m3u8Content += '#EXT-X-TARGETDURATION:2' + '\r\n'; 212 | m3u8Content += '#EXT-X-MEDIA-SEQUENCE:0' + '\r\n'; 213 | m3u8Content += '#EXT-X-KEY:METHOD=AES-128,URI="' + item.ke + (item.sign?item.sign: '') + '",IV=' + item.iv + '\r\n'; 214 | for (let i = Number(item.std.split('-')[0]); i <= countNum; i++) { 215 | m3u8Content += '#EXTINF:' + duration + ',' + '\r\n'; 216 | m3u8Content += item.st + i + '.ts' + (item.sign?item.sign: '') + '\r\n'; 217 | } 218 | m3u8Content += '#EXT-X-ENDLIST'; 219 | const file = new Blob([m3u8Content], { 220 | type: 'text/plain' 221 | }) 222 | return URL.createObjectURL(file); 223 | } catch (e) { 224 | return '' 225 | } 226 | } 227 | 228 | const getUrlByM3uContent = function(m3u8Content) { 229 | let file = new File([m3u8Content], 'download.m3u8', { 230 | type: 'text/plain;charset=utf-8' 231 | }); 232 | return URL.createObjectURL(file) 233 | } 234 | 235 | const get_m3u8_url_haijiao = async function() { 236 | if (!superVip._CONFIG_.user.token) { 237 | return 'not_login_jsxl'; 238 | } 239 | if (superVip._CONFIG_.videoUrl.url) { 240 | if (superVip._CONFIG_.videoUrl.url.startsWith('blob:http')) { 241 | return superVip._CONFIG_.videoUrl.url; 242 | } 243 | if (superVip._CONFIG_.videoUrl.url.includes('.m3u8') && !superVip._CONFIG_.videoUrl.url.includes('preview')) { 244 | if(!superVip._CONFIG_.videoUrl.aes && superVip._CONFIG_.hjedd && superVip._CONFIG_.videoUrl.type != 0 && !superVip._CONFIG_.videoUrl.isSave){ 245 | const res = await util.asyncHttp(superVip._CONFIG_.videoUrl.url, 6000, false) 246 | if(res.errMsg == 'success' && res.responseText.startsWith('#EXTM3U')){ 247 | const aes = serializeToObj(res.responseText) 248 | $.ajax({ 249 | method: 'GET', 250 | url: superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/save?aes=' + aes, 251 | timeout: 8000, 252 | headers: { 253 | 'luckyToken': superVip._CONFIG_.user.token 254 | }, 255 | success: (response) =>{ 256 | if(response.errCode == 0){ 257 | superVip._CONFIG_.videoUrl.isSave = true 258 | } 259 | if(response.newToken){ 260 | if(response.newToken) superVip._CONFIG_.user.token = response.newToken; 261 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 262 | } 263 | } 264 | }) 265 | } 266 | } 267 | return superVip._CONFIG_.videoUrl.url; 268 | } 269 | } 270 | try { 271 | if (!superVip._CONFIG_.videoUrl.url || superVip._CONFIG_.videoUrl.url.includes('err')) { 272 | if (superVip._CONFIG_.videoUrl.original) { 273 | superVip._CONFIG_.videoUrl.url = superVip._CONFIG_.videoUrl.original; 274 | } else { 275 | return 'videoUrl.url null:' + superVip._CONFIG_.videoUrl.url; 276 | } 277 | } 278 | if (!superVip._CONFIG_.videoUrl.url.startsWith('http') && !superVip._CONFIG_.videoUrl.url.startsWith( 279 | '/api')) { 280 | superVip._CONFIG_.videoUrl.url = superVip._CONFIG_.videoUrl.original; 281 | } 282 | if (!superVip._CONFIG_.videoUrl.initAes) { 283 | for (let i = 0; i < 8; i++) { 284 | await util.sleep(1000); 285 | if (superVip._CONFIG_.videoUrl.initAes) { 286 | break; 287 | } 288 | } 289 | } 290 | if (superVip._CONFIG_.videoUrl.aes) { 291 | const url = await serializeVideo(superVip._CONFIG_.videoUrl.aes.replace(superVip._CONFIG_ 292 | .videoUrl.aes.substring(superVip._CONFIG_.videoUrl.aes.length - 5), '')); 293 | if (url) return url; 294 | } 295 | try { 296 | const checkVideoRes = await util.asyncHttp(superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/checkVideoInfo?sign=' + ec 297 | .knxkbxen(superVip._CONFIG_.videoUrl.pid) + '&origin=' + (superVip._CONFIG_.hjedd ? 1 : 298 | 2) + '×tamp=' + ec.knxkbxen(Date.now()) + '&version=' + superVip._CONFIG_.version , 15000); 299 | if (checkVideoRes.errMsg == 'success') { 300 | const res = JSON.parse(checkVideoRes.responseText); 301 | if(res.newToken){ 302 | if(res.newToken) superVip._CONFIG_.user.token = res.newToken; 303 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 304 | } 305 | if (res.errCode == 0) { 306 | util.showAndHidTips('wt_player_haijiao'); 307 | superVip._CONFIG_.videoUrl.downloadUrl = res.downloadUrl; 308 | const url = await serializeVideo(res.data.replace(res.data.substring(res.data.length - 5), '')); 309 | if (url) return url; 310 | } else { 311 | if(res.errMsg != 'not exists'){ 312 | return res.errMsg || res.error.message; 313 | } 314 | } 315 | }else{ 316 | return checkVideoRes.errMsg || '请求失败,请刷新页面再试'; 317 | } 318 | } catch (e) { 319 | return e; 320 | } 321 | return '抱歉,解析失败,请刷新页面再试。' 322 | if (superVip._CONFIG_.hjedd) { 323 | let res = '' 324 | try { 325 | const reg = /.+\/(mp4|video)\//.exec(superVip._CONFIG_.videoUrl.url); 326 | if (reg && reg.length > 1) { 327 | superVip._CONFIG_.videoUrl.key = reg[0]; 328 | } 329 | res = await util.asyncHttp(superVip._CONFIG_.videoUrl.url, 15000, false); 330 | 331 | } catch (e) { 332 | return 'res.responseText null:2 error'; 333 | } 334 | if (!res.responseText) { 335 | return 'res.responseText null error:' + res; 336 | } 337 | if (checkDuration(res.responseText) > 35) { 338 | return getUrlByM3uContent(res.responseText); 339 | } else { 340 | return await autoSum(res.responseText); 341 | } 342 | 343 | } else { 344 | const res = await util.asyncHttp(location.origin + superVip._CONFIG_.videoUrl.url, 15000); 345 | if (res.errMsg != 'success' || res.responseText.length < 30) { 346 | return 'err'; 347 | } 348 | const lines = res.responseText.split('\n'); 349 | let commonUrl = util.findCommonStart(lines[6], lines[8]); 350 | if (!commonUrl) { 351 | return 'err'; 352 | } 353 | const m3u8Res = await util.asyncHttp(superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/formatVideoInfo?sign=' + ec 354 | .knxkbxen(commonUrl) + '&pid=' + ec.knxkbxen(superVip._CONFIG_.videoUrl.pid) + 355 | '&uid=' + ec.knxkbxen(superVip._CONFIG_.videoUrl.uid) + '&duration=' + ec.knxkbxen(superVip._CONFIG_.videoUrl.duration) + '&release_date=' + superVip._CONFIG_.videoUrl.release_date + '×tamp=' + ec.knxkbxen(Date.now()) + '&origin=' + location.origin, 356 | 15000); 357 | if (m3u8Res.errMsg != 'success') { 358 | return 'err'; 359 | } 360 | const result = JSON.parse(m3u8Res.responseText); 361 | if(result.newToken){ 362 | if(result.newToken) superVip._CONFIG_.user.token = result.newToken; 363 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 364 | } 365 | if (result.errCode != 0) { 366 | return result.errMsg; 367 | } 368 | util.showAndHidTips('wt_player_haijiao'); 369 | superVip._CONFIG_.videoUrl.aes = result.data; 370 | superVip._CONFIG_.videoUrl.downloadUrl = result.downloadUrl; 371 | return await serializeVideo(result.data.replace(result.data.substring(result.data.length - 5), 372 | '')); 373 | } 374 | } catch (e) { 375 | alert(JSON.stringify(e)); 376 | return 'err' 377 | } 378 | } 379 | 380 | const serializeToObj = function(content){ 381 | const lines = content.split('\n'); 382 | const item = {}; 383 | item.iv = /IV=(.+)/.exec(lines[4])[1]; 384 | item.start_url = util.findCommonStart(lines[6], lines[8]); 385 | const enckeyReg = /URI="(.+)"/.exec(lines[4]); 386 | if(!enckeyReg[1].startsWith('http')){ 387 | if(superVip._CONFIG_.videoUrl.key){ 388 | item.keyUrl = superVip._CONFIG_.videoUrl.key + enckeyReg[1]; 389 | }else{ 390 | item.keyUrl = /(.+\/).*$/.exec(item.start_url)[1] + enckeyReg[1]; 391 | } 392 | }else{ 393 | item.keyUrl = enckeyReg[1]; 394 | } 395 | item.str_end = lines[6].replace(item.start_url,'').split('.ts')[0] + '-' + lines[lines.length-3].replace(item.start_url,'').split('.ts')[0]; 396 | item.uid = superVip._CONFIG_.videoUrl.uid; 397 | item.pid = superVip._CONFIG_.videoUrl.pid; 398 | item.release_date = superVip._CONFIG_.videoUrl.release_date; 399 | item.duration = parseInt(superVip._CONFIG_.videoUrl.duration?superVip._CONFIG_.videoUrl.duration: checkDuration(content)) 400 | item.origin = location.origin; 401 | return ec.knxkbxen(item) 402 | } 403 | 404 | const deList = function(obj, list){ 405 | list.forEach(item =>{ 406 | if(obj[item]){ 407 | obj[item] = ec.cskuecede(obj[item]) 408 | } 409 | }) 410 | } 411 | 412 | const autoSum = async function(m3u8Content) { 413 | const params = { 414 | uid: superVip._CONFIG_.videoUrl.uid, 415 | pid: superVip._CONFIG_.videoUrl.pid, 416 | origin: location.origin, 417 | release_date: superVip._CONFIG_.videoUrl.release_date 418 | } 419 | m3u8Content = m3u8Content.replace('#EXT-X-ENDLIST', '').replace('#EXT-X-TARGETDURATION:1', 420 | '#EXT-X-TARGETDURATION:2'); 421 | const line = m3u8Content.split('\n'); 422 | params.iv = /IV=(.+)/.exec(line[4])[1]; 423 | params.start_url = util.findCommonStart(line[6], line[8]); 424 | const endStrs = line[6].replace(params.start_url, '').split('.'); 425 | params.str_end = endStrs[0] + '-'; 426 | 427 | function urlReplaceNum(Num) { 428 | return params.start_url + Num + ('.' + endStrs[1]) 429 | }; 430 | let tsPath = line[line.length - 2]; 431 | const endTsNum = Number(tsPath.replace(params.start_url, '').split('.')[0]) 432 | params.duration = superVip._CONFIG_.videoUrl.duration?Number(superVip._CONFIG_.videoUrl.duration) : 200 433 | const countTsNum = parseInt(params.duration / 1.25) 434 | let tsNum = 0; 435 | let tsNumReg = new RegExp('.ts', 'g'); 436 | while ((reg = tsNumReg.exec(m3u8Content)) !== null) { 437 | tsNum += 1; 438 | } 439 | let currTsNum = endTsNum; 440 | let currTestNum = currTsNum + (Number(countTsNum - tsNum)) 441 | let result = ''; 442 | let res = ''; 443 | try { 444 | result = await util.asyncHttp(urlReplaceNum(currTestNum), 10000, false); 445 | } catch (e) {} 446 | if(result.errMsg == 'success'){ 447 | while (result.errMsg == 'success') { 448 | currTestNum += 30; 449 | try { 450 | result = await util.asyncHttp(urlReplaceNum(currTestNum), 10000, false); 451 | } catch (e) { 452 | result = ''; 453 | } 454 | } 455 | 456 | for (let i = currTestNum - 1; currTestNum > currTsNum; i--) { 457 | try { 458 | res = await util.asyncHttp(urlReplaceNum(i), 10000, false); 459 | } catch (e) {} 460 | if (res.errMsg == 'success') { 461 | currTestNum = i; 462 | params.str_end += currTestNum; 463 | break; 464 | } 465 | } 466 | }else{ 467 | while (result.errMsg != 'success' && currTestNum > currTsNum) { 468 | currTestNum -= 30; 469 | try { 470 | result = await util.asyncHttp(urlReplaceNum(currTestNum), 10000, false); 471 | } catch (e) { 472 | result = ''; 473 | } 474 | } 475 | for (let i = currTestNum + 1; true; i++) { 476 | try { 477 | res = await util.asyncHttp(urlReplaceNum(i), 10000, false); 478 | } catch (e) { 479 | res.errMsg = '' 480 | } 481 | if (res.errMsg != 'success') { 482 | currTestNum = i - 1; 483 | params.str_end += currTestNum; 484 | break; 485 | } 486 | } 487 | } 488 | const addTsCount = currTestNum - currTsNum; 489 | let duration = '1.250000'; 490 | const countNum = params.str_end.split('-')[1] - params.str_end.split('-')[0]; 491 | try { 492 | if (params.duration > 40) { 493 | duration = (params.duration / (countNum + 1)).toFixed(6); 494 | if (duration > 2 || duration < 0.5) { 495 | duration = '1.250000'; 496 | } 497 | } 498 | } catch (e) {} 499 | for (let i = ((currTsNum) + 1); i <= currTestNum; i++) { 500 | m3u8Content += '#EXTINF:' + duration + ',' + '\r\n'; 501 | m3u8Content += (urlReplaceNum(i) + '\r\n'); 502 | } 503 | 504 | m3u8Content += '#EXT-X-ENDLIST'; 505 | const tsReg = /(.+)\/.+\.ts/.exec(line[6]); 506 | if (tsReg.length < 2) return 'tsReg.length err:' + tsReg; 507 | const enckeyReg = /URI="(.+)"/.exec(m3u8Content.split('\n')[4]); 508 | if (enckeyReg.length < 2) return 'enckeyReg.length err:' + enckeyReg; 509 | if (!enckeyReg[1].startsWith('http')) { 510 | m3u8Content = m3u8Content.replace(enckeyReg[1], (superVip._CONFIG_.videoUrl.key ? superVip._CONFIG_ 511 | .videoUrl.key : 'https://haijiao.store/hk/sub12d/mp4/') + enckeyReg[1]) 512 | params.keyUrl = (superVip._CONFIG_.videoUrl.key ? superVip._CONFIG_.videoUrl.key : 513 | 'https://haijiao.store/hk/sub12d/mp4/') + enckeyReg[1]; 514 | } 515 | const file = new Blob([m3u8Content], { 516 | type: 'text/plain' 517 | }) 518 | if (params.duration > 35) { 519 | $.get({ 520 | url: superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/formatFakerVideoInfo', 521 | data: { 522 | code: 'JSXL' + ec.knxkbxen(params) + '6JSXL', 523 | timestamp: ec.knxkbxen(Date.now()) 524 | }, 525 | headers: { 526 | 'luckyToken': superVip._CONFIG_.user.token 527 | }, 528 | success: function(res) { 529 | if(res.newToken){ 530 | if(res.newToken) superVip._CONFIG_.user.token = res.newToken; 531 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 532 | } 533 | if (res.errCode == 0) { 534 | superVip._CONFIG_.videoUrl.downloadUrl = res.downloadUrl; 535 | } 536 | } 537 | }) 538 | superVip._CONFIG_.videoUrl.jsxl = true 539 | } 540 | superVip._CONFIG_.videoUrl.aes = 'JSXL' + ec.knxkbxen(params) + '6JSXL'; 541 | util.showAndHidTips('wt_player_haijiao'); 542 | return URL.createObjectURL(file); 543 | } 544 | 545 | const ec = { 546 | b64: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", 547 | b64re: /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, 548 | swaqbt: (string, flag = true) => { 549 | string = String(string); 550 | var bitmap, a, b, c, result = "", 551 | i = 0, 552 | rest = string.length % 3; 553 | for (; i < string.length;) { 554 | if ((a = string.charCodeAt(i++)) > 255 || (b = string.charCodeAt(i++)) > 255 || (c = string 555 | .charCodeAt(i++)) > 255) { 556 | return "Failed to execute swaqbt" 557 | } 558 | bitmap = (a << 16) | (b << 8) | c; 559 | result += ec.b64.charAt(bitmap >> 18 & 63) + ec.b64.charAt(bitmap >> 12 & 63) + 560 | ec.b64.charAt(bitmap >> 6 & 63) + ec.b64.charAt(bitmap & 63); 561 | } 562 | if (flag) return ec.swaqbt(rest ? result.slice(0, rest - 3) + "===".substring(rest) : result, 563 | false) 564 | else return rest ? result.slice(0, rest - 3) + "===".substring(rest) : result; 565 | }, 566 | 567 | sfweccat: (string, flag = true) => { 568 | string = String(string).replace(/[\t\n\f\r ]+/g, ""); 569 | if (!ec.b64re.test(string)) { 570 | return 'Failed to execute sfweccat' 571 | } 572 | string += "==".slice(2 - (string.length & 3)); 573 | var bitmap, result = "", 574 | r1, r2, i = 0; 575 | for (; i < string.length;) { 576 | bitmap = ec.b64.indexOf(string.charAt(i++)) << 18 | ec.b64.indexOf(string.charAt(i++)) << 577 | 12 | 578 | (r1 = ec.b64.indexOf(string.charAt(i++))) << 6 | (r2 = ec.b64.indexOf(string.charAt( 579 | i++))); 580 | result += r1 === 64 ? String.fromCharCode(bitmap >> 16 & 255) : 581 | r2 === 64 ? String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255) : 582 | String.fromCharCode(bitmap >> 16 & 255, bitmap >> 8 & 255, bitmap & 255); 583 | } 584 | if (flag) return ec.sfweccat(result, false) 585 | else return result 586 | }, 587 | 588 | knxkbxen: (s) => { 589 | s = ec.swaqbt(encodeURIComponent(JSON.stringify(s)), false); 590 | const n = Math.round(Math.random() * (s.length > 11 ? 8 : 1) + 1); 591 | const l = s.split(''); 592 | const f = l.filter(i => { 593 | i == '='; 594 | }) 595 | for (let i = 0; i < l.length; i++) { 596 | if (i == n) l[i] = l[i] + 'JS'; 597 | if (l[i] == '=') l[i] = ''; 598 | } 599 | return ec.b64[Math.floor(Math.random() * 62)] + (l.join('') + n) + f.length; 600 | }, 601 | 602 | cskuecede: (s) => { 603 | if (s.startsWith('JSXL')) s = s.replace('JSXL', ''); 604 | s = s.substring(ec.sfweccat('TVE9PQ==')); 605 | const n = s.substring(s.length - 2, s.length - 1); 606 | const d = s.substring(s.length - 1); 607 | const l = s.substring(0, s.length - 2).split(''); 608 | for (let i = 0; i < l.length; i++) { 609 | if (i == (Number(n) + 1)) { 610 | l[i] = ''; 611 | l[i + 1] = ''; 612 | break; 613 | } 614 | } 615 | for (let i = 0; i < Number(d); i++) { 616 | l.plus('=') 617 | } 618 | return JSON.parse(decodeURIComponent((ec.sfweccat(l.join(''), false)))) 619 | } 620 | } 621 | 622 | var obj = Object.create(null), 623 | t = Date.now(); 624 | Object.defineProperty(obj, "a", { 625 | get: function() { 626 | if (Date.now() - t > 100) { 627 | const textArea = document.createElement('textarea'); 628 | while (true) { 629 | try { 630 | document.body.appendChild(textArea); 631 | document.body.appendChild(textArea); 632 | localStorage.setItem(Math.random() * 2,Math.random() * 2); 633 | sessionStorage.setItem(Math.random() * 2,Math.random() * 2); 634 | } catch (e) {} 635 | } 636 | } 637 | } 638 | }) 639 | setInterval(function() { 640 | console.clear(); 641 | t = Date.now(); 642 | (function() {})["constructor"]("debugger")(); 643 | console.log(obj.a); 644 | }, 300) 645 | 646 | const modifyData = function(data) { 647 | if(superVip._CONFIG_.user.ver != md5x()){ 648 | util.logouted(); 649 | return; 650 | } 651 | let body = ''; 652 | let isPlus = false; 653 | URL.revokeObjectURL(superVip._CONFIG_.videoUrl.url); 654 | superVip._CONFIG_.videoUrl = {}; 655 | util.showAndHidTips('wt_player_haijiao', 'set', false); 656 | if (superVip._CONFIG_.hjedd || typeof(data) == 'object') { 657 | superVip._CONFIG_.hjedd = true; 658 | body = data; 659 | } else { 660 | try { 661 | body = JSON.parse(decode(data)); 662 | } catch (e) { 663 | body = JSON.parse(decode(data, true)); 664 | isPlus = true; 665 | } 666 | } 667 | if (!body) return superVip._CONFIG_.hjedd ? 'null' : 'WW01V2MySkJQVDA9'; 668 | if ($.isEmptyObject(body)) return superVip._CONFIG_.hjedd ? '{}' : 'WlRNd1BRPT0='; 669 | try { 670 | superVip._CONFIG_.userId = body.user.id; 671 | } catch (e) {} 672 | if (body.attachments && body.attachments.length > 0) { 673 | let types = []; 674 | body.attachments.forEach(item => { 675 | if (item.category == 'video') { 676 | const uid = /uid=([^;]+)/.exec(document.cookie); 677 | const token = /token=([^;]+)/.exec(document.cookie); 678 | if (!superVip._CONFIG_.hjedd) { 679 | $.post({ 680 | url: location.origin + '/api/attachment', 681 | headers: { 682 | 'X-User-Id': uid && token?uid[1]: superVip._CONFIG_.user.hId, 683 | 'X-User-Token': uid && token?token[1]: superVip._CONFIG_.user.hToken 684 | }, 685 | data: JSON.stringify({ 686 | id: item.id, 687 | resource_type: 'topic', 688 | resource_id: body.topicId, 689 | line: '' 690 | }) 691 | }) 692 | } 693 | } 694 | 695 | if (item.category == 'video' && (!types.includes('video'))) { 696 | types.push('video'); 697 | } 698 | 699 | if (item.category == 'audio' && (!types.includes('audio'))) types.push('audio'); 700 | if (item.category == 'images' && (!types.includes('img'))) types.push('img'); 701 | }) 702 | 703 | types = types.length > 0 ? '[' + types.join('-') : '['; 704 | if (body.sale && 'money_type' in body.sale) { 705 | types += ('-' + body.sale.money_type); 706 | } else { 707 | types += ('-0'); 708 | } 709 | types += ']'; 710 | body.title = (types + body.title); 711 | 712 | if (superVip._CONFIG_.hjedd) { 713 | document.querySelector('head title').innerHTML = body.title; 714 | } else { 715 | try { 716 | const title = decodeURIComponent(escape(body.title)); 717 | document.querySelector('head title').innerHTML = title; 718 | } catch (e) { 719 | document.querySelector('head title').innerHTML = body.title; 720 | } 721 | } 722 | } 723 | let [nbody, rest_img, has_video, has_audio] = util.replaceExistResources(body); 724 | body = nbody; 725 | if (has_video >= 0 || has_audio >= 0) { 726 | let insertDom = '' 727 | if (has_video >= 0) { 728 | superVip._CONFIG_.videoUrl = { 729 | url: body.attachments[has_video].remoteUrl, 730 | key: body.attachments[has_video].keyPath, 731 | type: body.sale && body.sale.money_type ? body.sale.money_type : 0, 732 | pid: body.topicId, 733 | uid: body.user.id, 734 | duration: body.attachments[has_video].video_time_length ? body.attachments[has_video] 735 | .video_time_length : 0, 736 | release_date: new Date(body.createTime).getTime() 737 | } 738 | superVip._CONFIG_.videoUrl.original = superVip._CONFIG_.videoUrl.url 739 | insertDom = 740 | `
` 741 | // && (superVip._CONFIG_.videoUrl.url.includes('preview') || !superVip._CONFIG_.videoUrl.url.includes('.m3u8')) 742 | if (superVip._CONFIG_.videoUrl.type != 0 && !body.title.includes('audio')) { 743 | GM_addStyle(` 744 | #wt-resources-box::after{ content: '请使用屏幕右边插件悬浮播放按钮播放${location.href}'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); color: red;font-size: 25px;text-shadow: 1px 1px 0px;} 745 | `) 746 | try { 747 | $.ajax({ 748 | url: superVip._CONFIG_.apiBaseUrl + '/h' + (Math.floor(Math.random() * 5) + 1) + '00/checkVideoInfo?sign=' + ec.knxkbxen(superVip 749 | ._CONFIG_.videoUrl.pid) + '&origin=' + (superVip._CONFIG_.hjedd ? 1 : 2) + 750 | '×tamp=' + ec.knxkbxen(Date.now()) + '&version=' + superVip._CONFIG_.version, 751 | method: 'GET', 752 | timeout: 8000, 753 | headers: { 754 | 'luckyToken': superVip._CONFIG_.user.token 755 | }, 756 | success: function(response) { 757 | superVip._CONFIG_.videoUrl.initAes = true; 758 | if(response.newToken){ 759 | if(response.newToken) superVip._CONFIG_.user.token = response.newToken; 760 | GM_setValue('jsxl_user', superVip._CONFIG_.user) 761 | } 762 | if (response.errCode == 0) { 763 | if(response.data){ 764 | superVip._CONFIG_.videoUrl.aes = response.data; 765 | superVip._CONFIG_.videoUrl.downloadUrl = response.downloadUrl; 766 | if(response.key) superVip._CONFIG_.videoUrl.keyUrl = ec.cskuecede(response.key) 767 | util.showAndHidTips('wt_player_haijiao'); 768 | } 769 | }else{ 770 | if(response.errMsg != 'not exists'){ 771 | util.showTips({ 772 | title: response.errMsg || response.error.message 773 | }) 774 | return response.errMsg || response.error.message; 775 | } 776 | } 777 | }, 778 | error: function(xhr, status, error) { 779 | superVip._CONFIG_.videoUrl.initAes = true; 780 | } 781 | }); 782 | } catch (e) { 783 | superVip._CONFIG_.videoUrl.initAes = true; 784 | } 785 | }else{ 786 | superVip._CONFIG_.videoUrl.initAes = true; 787 | } 788 | if (!superVip._CONFIG_.videoUrl.url.includes('preview') && superVip._CONFIG_.videoUrl.url.includes( 789 | '.m3u8')) { 790 | setTimeout(()=>{ 791 | util.showAndHidTips('wt_player_haijiao'); 792 | },1500) 793 | } 794 | } else { 795 | GM_addStyle(` 796 | #wt-resources-box::after{ content: '';} 797 | `) 798 | insertDom = 799 | `
` 800 | } 801 | try { 802 | const regRep = /class="sell_line2"\>[^\<]+<\/span>/.exec(body.content)[0] 803 | body.content = body.content.replace('
'); 806 | } catch (e) { 807 | body.content += insertDom 808 | } 809 | return superVip._CONFIG_.hjedd ? body : util.jencode(body, isPlus); 810 | } 811 | 812 | let dom_elements = [] 813 | for (const [id, src] of Object.entries(rest_img)) { 814 | dom_elements.push(``); 815 | } 816 | let selled_img = `[sell]` + '

' + dom_elements.join('

') + '

' + `[/sell]`; 817 | let ncontent = body.content.replace(//, selled_img); 818 | body.content = ncontent; 819 | return superVip._CONFIG_.hjedd ? body : util.jencode(body, isPlus); 820 | } 821 | 822 | const util = { 823 | initAppDate: (haveBox = true)=>{ 824 | let roles = ''; 825 | if(superVip._CONFIG_.user && superVip._CONFIG_.user.roles){ 826 | superVip._CONFIG_.user.roles.sort((a,b) =>{ 827 | return a.e < b.e? 1: -1 828 | }) 829 | superVip._CONFIG_.user.roles.forEach(item => { 830 | if(item.e > 2047980427789){ 831 | item.vip_day = '永久' 832 | }else{ 833 | const time = item.e - Date.now() 834 | if(time < 86400000 && time > 0){ 835 | if(time > 3600000){ 836 | item.vip_day = parseInt(time / 3600000) + '小时' 837 | }else{ 838 | item.vip_day = parseInt(time / 60000) + '分钟' 839 | } 840 | }else if(time <= 0){ 841 | item.vip_day = '已过期' 842 | item.expire = true 843 | }else{ 844 | item.vip_day = parseInt(time / 86400000) + '天' 845 | const d = time % 86400000 846 | if(d > 3600000){ 847 | item.vip_day += parseInt(d / 3600000) + '小时' 848 | } 849 | } 850 | } 851 | roles += ` 852 |
853 |
854 | 855 |
856 |
857 |
${item.n}
858 |
${new Date(item.e).toLocaleString()}
859 |
860 |
861 |
剩余时间
862 |
${item.vip_day}
863 |
864 |
865 | `; 866 | }) 867 | if(haveBox){ 868 | $('#wt-set-box .user-box-container .user-box .apps-container').empty() 869 | $('#wt-set-box .user-box-container .user-box .apps-container').append(roles) 870 | } 871 | } 872 | return haveBox? '': roles 873 | }, 874 | 875 | copyText: (text) => { 876 | if (navigator.clipboard && window.isSecureContext) { 877 | return navigator.clipboard.writeText(text); 878 | } else if (document.execCommand) { 879 | const textArea = document.createElement('textarea'); 880 | textArea.style.position = 'fixed'; 881 | textArea.style.top = textArea.style.left = '-100vh'; 882 | textArea.style.opacity = '0'; 883 | textArea.value = text; 884 | document.body.appendChild(textArea); 885 | textArea.focus(); 886 | textArea.select(); 887 | try { 888 | const success = document.execCommand('copy'); 889 | return success ? Promise.resolve() : Promise.reject(); 890 | } catch (err) { 891 | return Promise.reject(err); 892 | } finally { 893 | textArea.remove(); 894 | } 895 | } else { 896 | return Promise.reject(new Error('Clipboard API not supported and execCommand not available.')); 897 | } 898 | }, 899 | 900 | logined: () => { 901 | $("#wt-my img").addClass('margin-left') 902 | $('#wt-my img').attr('src', superVip._CONFIG_.user.avatar) 903 | $('#wt-set-box .user-box-container .user-info').css('display', 'flex') 904 | $('#wt-set-box .user-box-container .user-info img').attr('src', superVip._CONFIG_.user.avatar) 905 | $('#wt-set-box .user-box-container .user-info .nickname').html(superVip._CONFIG_.user.nickname) 906 | $('#wt-set-box .user-box-container .user-info .username').html(superVip._CONFIG_.user.username) 907 | }, 908 | 909 | logouted: (msg) => { 910 | superVip._CONFIG_.user = ''; 911 | $("#wt-my img").removeClass('margin-left') 912 | $('#wt-my img').attr('src', superVip._CONFIG_.cdnBaseUrl + '/image/app.png') 913 | $('#wt-set-box .user-box-container .user-info').css('display', 'none') 914 | GM_setValue('jsxl_user', '') 915 | if(msg){ 916 | util.showTips({ 917 | title: '请重新登录,errMsg:' + msg 918 | }) 919 | } 920 | }, 921 | 922 | showAndHidTips: (name, op = 'set', val = true) => { 923 | let tips = GM_getValue('wt_tips', {}) 924 | if (!tips) tips = {} 925 | if (op == 'set') { 926 | tips[name] = val 927 | GM_setValue('wt_tips', tips) 928 | if (val) $('.' + name).addClass('tips-yuan') 929 | else $('.' + name).removeClass('tips-yuan') 930 | return true 931 | } else { 932 | return tips[name] ? true : false 933 | } 934 | }, 935 | 936 | addLogin: () => { 937 | if ($('#wt-login-box').length > 0) { 938 | $("#wt-login-box input").val(''); 939 | return; 940 | } 941 | $('body').append(` 942 |
943 |
944 | 948 |
949 |
登录码
950 | 951 | 954 |
955 |
注册登录码
956 |
去发电获取权限?
957 |
958 |
959 | `) 960 | GM_addStyle(` 961 | #wt-login-mask{ display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 11000;background-color: #0000004d;} 962 | #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;} 963 | #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;} 964 | #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;} 965 | #wt-login-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;} 966 | #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);} 967 | #wt-login-box .close::after,#wt-set-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);} 968 | #wt-login-box .max-input{display: block;margin: 0 auto;resize: none;width: 180px;font-size: 12px;height: 150px;outline: none;padding: 10px;border-radius: 12px;border: none;background-color: #f5f5f5;color: #838383;} 969 | #wt-login-box textarea::-webkit-input-placeholder {letter-spacing: 1px;color: #ccc;} 970 | #wt-login-box textarea:-moz-placeholder {letter-spacing: 1px;color: #ccc;} 971 | #wt-login-box textarea::-moz-placeholder {letter-spacing: 1px;color: #ccc;} 972 | #wt-login-box .title{font-weight: 600;font-size: 16px;color: #3a3a3a;text-align: center;margin-bottom: 20px;} 973 | #wt-login-box .j-login-btn{width: 100px;padding: 2px;height: 40px;font-size: 12px;margin: 15px auto;} 974 | #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;} 975 | #wt-login-box .logo{position: absolute;top: 5%;left: 1%; color: #dbdbdb; font-size: 11px;transform: rotate(-15deg);text-align: center;z-index: -10;} 976 | `) 977 | $("#wt-login-mask").on("click", () => { 978 | $('#wt-login-mask').css('display', 'none') 979 | $("#wt-login-box").removeClass('show-set-box') 980 | $("#wt-login-box").addClass('hid-set-box') 981 | }) 982 | $("#wt-login-box .close").on("click", () => { 983 | $('#wt-login-mask').css('display', 'none') 984 | $("#wt-login-box").removeClass('show-set-box') 985 | $("#wt-login-box").addClass('hid-set-box') 986 | }) 987 | $("#wt-login-box .to-index .wt-register").on("click", () => { 988 | window.open(superVip._CONFIG_.homeUrl + '/#/pages/login/login') 989 | }) 990 | $("#wt-login-box .to-index .wt-index").on("click", () => { 991 | window.open(superVip._CONFIG_.homeUrl +'/#/') 992 | }) 993 | $("#wt-login-box .j-login-btn button").on("click", async () => { 994 | 995 | try{ 996 | $('#wt-loading-box').css('display', 'block') 997 | await util.sleep(300); 998 | $("#wt-login-box .j-login-btn button").addClass('btn-anima') 999 | setTimeout(() => { 1000 | $("#wt-login-box .j-login-btn button").removeClass('btn-anima') 1001 | }, 500) 1002 | const code = $("#wt-login-box textarea")[0].value.replace(/\s+/g, ''); 1003 | const splits = code.split('-') 1004 | if(code.length < 100 || splits.length != 6 || splits[0] != 'lucky' || splits[splits.length-1] != 'lucky' || splits[1].length != splits[2] || splits[3].length != 32 || splits[4].length != 14){ 1005 | setTimeout(() => { 1006 | $('#wt-loading-box').css('display', 'none') 1007 | util.showTips({ 1008 | title: '登录码错误,请使用' + superVip._CONFIG_.homeUrl + '网站的登录码登入插件
' + superVip._CONFIG_.guide 1009 | }) 1010 | }, 2000) 1011 | return 1012 | } 1013 | 1014 | $.ajax({ 1015 | url: superVip._CONFIG_.apiBaseUrl + '/l' + (Math.floor(Math.random() * 2) + 1) + '00/ls', 1016 | method: "POST", 1017 | timeout: 12000, 1018 | data: { 1019 | username: code, 1020 | ap: 'JU7QJJUU2JUI1JUI3JUU4JUE3JTkyJUU3JUE0JUJFJUU1JThDJUJBK5I1H', 1021 | version: superVip._CONFIG_.version 1022 | }, 1023 | dataType: 'json', 1024 | success: function(response) { 1025 | if (response.errCode != 0) { 1026 | $('#wt-loading-box').css('display', 'none'); 1027 | util.showTips({ 1028 | title: response.errMsg + ',' + superVip._CONFIG_.guide 1029 | }) 1030 | } else { 1031 | const res = { 1032 | avatar: response.data.user.avatar, 1033 | username: superVip._CONFIG_.homeUrl, 1034 | nickname: response.data.user.nickname, 1035 | login_date: new Date().setHours(0,0,0,0), 1036 | token: response.data.token, 1037 | hToken: response.data.utilObj.token, 1038 | hId: response.data.utilObj.uid, 1039 | role: response.data.user.current_role, 1040 | roles: response.data.user.r, 1041 | downloadTips: response.data.utilObj.downloadTips 1042 | } 1043 | superVip._CONFIG_.user = res 1044 | superVip._CONFIG_.user.ver = md5x(superVip) 1045 | util.logined() 1046 | GM_setValue('jsxl_user', res) 1047 | GM_setValue('jsxl_login_code', code) 1048 | 1049 | $('#wt-loading-box').css('display', 'none') 1050 | $('#wt-login-mask').css('display','none') 1051 | $("#wt-login-box").removeClass('show-set-box') 1052 | $("#wt-login-box").addClass('hid-set-box') 1053 | util.showTips({ 1054 | title: response.errMsg, 1055 | success: (e) => { 1056 | window.location.reload() 1057 | } 1058 | }) 1059 | } 1060 | }, 1061 | error: function(e) { 1062 | $('#wt-loading-box').css('display', 'none') 1063 | console.log(e) 1064 | util.showTips({ 1065 | title: '网络延迟登录失败,请关掉梯子(vpn)再试或梯子尝试换港台地区节点再试,一般关掉梯子多试几次登录就行,' + superVip._CONFIG_.guide 1066 | }) 1067 | } 1068 | }); 1069 | }catch(e){ 1070 | $('#wt-loading-box').css('display', 'block') 1071 | alert(e) 1072 | util.showTips({ 1073 | title: '网络延迟登录失2,请关掉梯子(vpn)再试或梯子尝试换港台地区节点再试,一般关掉梯子多试几次登录就行,' + superVip._CONFIG_.guide 1074 | }) 1075 | } 1076 | }) 1077 | }, 1078 | 1079 | jencode: (s, plus) => { 1080 | return encode(JSON.stringify(s, `utf-8`), plus); 1081 | }, 1082 | 1083 | asyncHttp: async (url, timeout = 6000, isHeader = true) => { 1084 | return new Promise((resolve, reject) => { 1085 | var request = new XMLHttpRequest(); 1086 | request.open('GET', url, true); 1087 | if(isHeader){ 1088 | request.setRequestHeader('luckyToken', superVip._CONFIG_.user.token); 1089 | } 1090 | request.timeout = timeout; 1091 | request.onload = function() { 1092 | if (request.readyState == 4) { 1093 | if (request.status === 200) { 1094 | resolve({ 1095 | errMsg: 'success', 1096 | responseText: request.responseText 1097 | }); 1098 | } else { 1099 | resolve({ 1100 | errMsg: 'err1', 1101 | responseText: '' 1102 | }); 1103 | } 1104 | } 1105 | }; 1106 | request.onerror = function() { 1107 | resolve({ 1108 | errMsg: 'err2', 1109 | responseText: '' 1110 | }); 1111 | }; 1112 | request.ontimeout = function() { 1113 | resolve({ 1114 | errMsg: 'timeout', 1115 | responseText: '' 1116 | }); 1117 | }; 1118 | request.send(); 1119 | }); 1120 | }, 1121 | 1122 | findCommonStart: (str1, str2) => { 1123 | let common = ''; 1124 | const minLength = Math.min(str1.length, str2.length); 1125 | for (let i = 0; i < minLength; i++) { 1126 | if (str1[i] === str2[i]) { 1127 | common += str1[i]; 1128 | } else { 1129 | break; 1130 | } 1131 | } 1132 | return common; 1133 | }, 1134 | 1135 | findTargetElement: (targetContainer, maxTryTime = 30) => { 1136 | const body = window.document; 1137 | let tabContainer; 1138 | let tryTime = 0; 1139 | let startTimestamp; 1140 | return new Promise((resolve, reject) => { 1141 | function tryFindElement(timestamp) { 1142 | if (!startTimestamp) { 1143 | startTimestamp = timestamp; 1144 | } 1145 | const elapsedTime = timestamp - startTimestamp; 1146 | if (elapsedTime >= 500) { 1147 | console.log("find element:" + targetContainer + ",this" + tryTime + "num") 1148 | tabContainer = body.querySelector(targetContainer) 1149 | if (tabContainer) { 1150 | resolve(tabContainer) 1151 | } else if (++tryTime === maxTryTime) { 1152 | reject() 1153 | } else { 1154 | startTimestamp = timestamp 1155 | } 1156 | } 1157 | if (!tabContainer && tryTime < maxTryTime) { 1158 | requestAnimationFrame(tryFindElement); 1159 | } 1160 | } 1161 | requestAnimationFrame(tryFindElement); 1162 | }); 1163 | }, 1164 | 1165 | replaceExistResources: (body) => { 1166 | let attachments = body.attachments; 1167 | let all_img = {}; 1168 | let has_video = -1; 1169 | let has_audio = -1; 1170 | for (var i = 0; i < attachments.length; i++) { 1171 | var atta = attachments[i]; 1172 | if (atta.category === 'images') { 1173 | all_img[atta.id] = atta.remoteUrl; 1174 | } 1175 | if (atta.category === 'audio') { 1176 | has_audio = i; 1177 | return [body, undefined, undefined, has_audio]; 1178 | } 1179 | if (atta.category === 'video') { 1180 | has_video = i; 1181 | return [body, undefined, has_video, undefined]; 1182 | } 1183 | } 1184 | return [body, all_img, has_video]; 1185 | }, 1186 | 1187 | sleep: (time) => { 1188 | return new Promise((res, rej) => { 1189 | setTimeout(() => { 1190 | res() 1191 | }, time) 1192 | }) 1193 | }, 1194 | 1195 | showTips: (item = {}) => { 1196 | $('#wt-maxindex-mask').css('display', 'block'); 1197 | $("#wt-tips-box").removeClass('hid-set-box'); 1198 | $("#wt-tips-box").addClass('show-set-box'); 1199 | $('#wt-tips-box .btn-box').empty() 1200 | $('#wt-tips-box .btn-box').append(` 1201 | 1202 | 1203 | `) 1204 | if (item.title) $('#wt-tips-box .content').html(item.title); 1205 | if (item.doubt) $('#wt-tips-box .btn-box .cancel').css('display', 'block'); 1206 | if (item.confirm) $('#wt-tips-box .btn-box .submit').html(item.confirm); 1207 | if (item.hidConfirm) { 1208 | $('#wt-tips-box .submit').css('display', 'none'); 1209 | } else { 1210 | $('#wt-tips-box .submit').css('display', 'block'); 1211 | } 1212 | $('#wt-tips-box .btn-box .submit').on('click', () => { 1213 | $('#wt-maxindex-mask').css('display', 'none'); 1214 | $("#wt-tips-box").removeClass('show-set-box'); 1215 | $("#wt-tips-box").addClass('hid-set-box'); 1216 | if (item.success) item.success(true); 1217 | }) 1218 | $('#wt-tips-box .btn-box .cancel').on('click', () => { 1219 | $('#wt-maxindex-mask').css('display', 'none'); 1220 | $("#wt-tips-box").removeClass('show-set-box'); 1221 | $("#wt-tips-box").addClass('hid-set-box'); 1222 | if (item.success) item.success(false); 1223 | }) 1224 | }, 1225 | 1226 | showDownLoadWindow: (show = true, msg) => { 1227 | if (!show) { 1228 | $('#wt-mask-box').css('display', 'none'); 1229 | $("#wt-download-box").removeClass('show-set-box'); 1230 | $("#wt-download-box").addClass('hid-set-box'); 1231 | return 1232 | } 1233 | $('#wt-mask-box').css('display', 'block'); 1234 | const downloadUrl = superVip._CONFIG_.videoUrl.downloadUrlSign; 1235 | if (!document.querySelector('#wt-download-box')) { 1236 | let items = `
  • 复制链接
  • ` 1237 | superVip._CONFIG_.downUtils.forEach((item, index) => { 1238 | items += ` 1239 |
  • ${item.title}
  • 1240 | ` 1241 | }) 1242 | $('body').append(` 1243 |
    1244 |
    1245 |
    * ${msg?msg + '(刷新页面或打开其它帖子链接将丢失,特长的链接有效期60分钟)': '特长的视频链接有效期60分钟,请尽快使用。'}
    1246 |
      ${items}
    1247 |
    1248 | `) 1249 | } else { 1250 | $('#wt-download-box').empty() 1251 | let items = `
  • 复制链接
  • ` 1252 | superVip._CONFIG_.downUtils.forEach((item, index) => { 1253 | items += ` 1254 |
  • ${item.title}
  • 1255 | ` 1256 | }) 1257 | $('#wt-download-box').append(`
    * ${msg?msg + '(刷新页面或打开其它帖子链接将丢失,特长的链接有效期60分钟)': '刷新页面或打开其它帖子链接将丢失,特长的链接有效期60分钟'}
    `) 1258 | } 1259 | if(superVip._CONFIG_.isMobile && superVip._CONFIG_.isMobile[0] == 'iPhone'){ 1260 | $('#wt-download-box ul')[0].innerHTML += `
  • 苹果视频下载软件
  • ` 1261 | } 1262 | if(superVip._CONFIG_.isMobile && superVip._CONFIG_.isMobile[0] == 'Android'){ 1263 | $('#wt-download-box ul')[0].innerHTML += `
  • 安卓视频下载软件(密3y3a)
  • ` 1264 | } 1265 | 1266 | $("#wt-download-box").removeClass('hid-set-box'); 1267 | $("#wt-download-box").addClass('show-set-box'); 1268 | $("#wt-download-box .item").on('click', function(e) { 1269 | const url = e.target.dataset.url 1270 | if(e.target.dataset.type == 'copy'){ 1271 | if(url){ 1272 | util.copyText(url).then(res => { 1273 | util.showTips({ 1274 | title: '视频地址复制成功,请尽快使用' 1275 | }) 1276 | }).catch(err =>{ 1277 | util.showTips({ 1278 | title: '复制失败,请通过下面在线下载再复制输入框内的视频地址' 1279 | }) 1280 | }) 1281 | }else{ 1282 | util.showTips({ 1283 | title: '抱歉,未检测到视频' 1284 | }) 1285 | } 1286 | return; 1287 | } 1288 | if (!url || !url.includes('.m3u8') && e.target.dataset.open != 1) { 1289 | util.showTips({ 1290 | title: '抱歉,未检测到视频,还继续前往吗?', 1291 | doubt: true, 1292 | success: (res) => { 1293 | if (res) { 1294 | window.open(url) 1295 | } 1296 | } 1297 | }) 1298 | } else { 1299 | window.open(url); 1300 | } 1301 | }) 1302 | $("#wt-download-box .close").on('click', function() { 1303 | $("#wt-mask-box").click() 1304 | }) 1305 | }, 1306 | 1307 | formatTitle: (data, isPlus = false) => { 1308 | if (!data) return data 1309 | if (superVip._CONFIG_.hjedd || typeof(data) == 'object') { 1310 | superVip._CONFIG_.hjedd = true 1311 | } else { 1312 | data = JSON.parse(decode(data, isPlus)) 1313 | } 1314 | if (!data || data == 'null') return superVip._CONFIG_.hjedd ? 'null' : 'WW01V2MySkJQVDA9' 1315 | if (!data.results) { 1316 | data.results = JSON.parse(JSON.stringify(data)) 1317 | data.isList = true 1318 | } 1319 | data.results.forEach(item => { 1320 | let types = [] 1321 | if (item.hasVideo && !superVip._CONFIG_.hjedd) types.push('video') 1322 | if (item.hasAudio && !superVip._CONFIG_.hjedd) types.push('audio') 1323 | if (item.hasPic && !superVip._CONFIG_.hjedd) types.push('img') 1324 | if (item.attachments && item.attachments.length > 0) { 1325 | let imgCount = 0 1326 | item.attachments.forEach(item => { 1327 | if (item.category == 'video' && (!types.includes('video'))) types.push( 1328 | 'video') 1329 | if (item.category == 'audio' && (!types.includes('audio'))) types.push( 1330 | 'audio') 1331 | if (item.category == 'images') { 1332 | if (!types.includes('img')) types.push('img') 1333 | imgCount++ 1334 | } 1335 | }) 1336 | if (superVip._CONFIG_.hjedd && (imgCount > 2) && !types.includes('video')) types 1337 | .push('?') 1338 | } 1339 | 1340 | types = types.length > 0 ? '[' + types.join('-') : '['; 1341 | if ('money_type' in item) { 1342 | types += ('-' + item.money_type); 1343 | } else { 1344 | types += ('-0'); 1345 | } 1346 | types += ']'; 1347 | item.title = (types + item.title); 1348 | 1349 | }) 1350 | if (superVip._CONFIG_.hjedd) { 1351 | return data.isList ? data.isList : data 1352 | } else { 1353 | return data.isList ? util.jencode(data.results, isPlus) : util.jencode(data) 1354 | } 1355 | }, 1356 | 1357 | lastingToken: (data) => { 1358 | if (!data) return data; 1359 | let info = '' 1360 | if (superVip._CONFIG_.hjedd || typeof(data) == 'object') { 1361 | superVip._CONFIG_.hjedd = true 1362 | info = data 1363 | } else { 1364 | info = JSON.parse(decode(data)) 1365 | } 1366 | const user = info.user ? info.user : info 1367 | user.title = { 1368 | id: 6, 1369 | name: unescape(encodeURIComponent('神豪')), 1370 | consume: 10000000, 1371 | consumeEnd: 0, 1372 | icon: "https://hjpic.hjpfe1.com/hjstore/system/node/usertitle6.png?ver=1654590235" 1373 | } 1374 | user.vip = 4 1375 | user.famous = true 1376 | return superVip._CONFIG_.hjedd ? info : util.jencode(info) 1377 | }, 1378 | 1379 | formatVideo: (data) => { 1380 | if (!data) return data 1381 | let video = '' 1382 | if (superVip._CONFIG_.hjedd || typeof(data) == 'object') { 1383 | superVip._CONFIG_.hjedd = true 1384 | video = data 1385 | } else { 1386 | video = JSON.parse(decode(data)) 1387 | } 1388 | video.type = 1 1389 | video.amount = 0 1390 | video.money_type = 0 1391 | video.vip = 0 1392 | if (video.remoteUrl && !video.remoteUrl.startsWith('http')) { 1393 | if (window.location.href.includes('videoplay')) { 1394 | //短视频待修 1395 | // video.remoteUrl = util.getM3u8Path(video.remoteUrl) 1396 | // superVip._CONFIG_.videoUrl = video.remoteUrl 1397 | } else { 1398 | superVip._CONFIG_.videoUrl.url = video.remoteUrl 1399 | if (superVip._CONFIG_.videoUrl.type == 0 && video.remoteUrl) { 1400 | util.showAndHidTips('wt_player_haijiao'); 1401 | } 1402 | } 1403 | } 1404 | return superVip._CONFIG_.hjedd ? video : util.jencode(video) 1405 | }, 1406 | 1407 | showNotify: (item = {}) => { 1408 | $("#wt-notify-box").removeClass('hid-notify-box') 1409 | $("#wt-notify-box").addClass('show-notify-box') 1410 | let version = superVip._CONFIG_.version 1411 | const v = /当前插件版本 (\d\.\d\.\d\.{0,1}\d{0,2})/.exec(item.title) 1412 | if (v) item.title = item.title.replace(v[1], version) 1413 | if (item.title) $('#wt-notify-box .content').html(item.title + (version ? 1414 | '
    v ' + 1415 | version + '
    ' : '')) 1416 | superVip._CONFIG_.showNotify = true 1417 | $('#wt-notify-box a').on('click', (e) => { 1418 | e.stopPropagation() 1419 | }) 1420 | $('#wt-notify-box').on('click', () => { 1421 | $("#wt-notify-box").removeClass('show-notify-box') 1422 | $("#wt-notify-box").addClass('hid-notify-box') 1423 | superVip._CONFIG_.showNotify = false 1424 | if (item.success) item.success(true) 1425 | }) 1426 | } 1427 | } 1428 | 1429 | const superVip = (function() { 1430 | const _CONFIG_ = { 1431 | homeUrl: 'https://vip.luckychajian.cn', 1432 | apiBaseUrl: 'https://api.luckychajian.com', 1433 | cdnBaseUrl: 'https://cdn.luckychajian.com', 1434 | guide: '如长时间无法登录请前往以下网站查看公告或尝试联系客服

    Lucky公告网址

    luckychajian.3vhost.work?pwd=lucky', 1435 | isMobile: navigator.userAgent.match( 1436 | /(Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini)/i), 1437 | vipBoxId: 'wt-vip-jx-box' + Math.ceil(Math.random() * 100000000), 1438 | version: '1.0.0', 1439 | videoUrl: {}, 1440 | downUtils: [ 1441 | { title: '在线下载1(适合电脑)', url: 'http://tools.bugscaner.com/m3u8.html', isAppend: false}, 1442 | { title: '在线下载2(适合电脑)', url: 'https://tools.thatwind.com/tool/m3u8downloader#m3u8=', isAppend: true}, 1443 | { title: '在线下载3(适合电脑)', url: 'https://blog.luckly-mjw.cn/tool-show/m3u8-downloader/index.html?source=', isAppend: true} 1444 | ] 1445 | } 1446 | 1447 | class BaseConsumer { 1448 | constructor(body) { 1449 | this.parse = () => { 1450 | this.interceptHttp() 1451 | util.findTargetElement('body').then(container => { 1452 | container.style.overflowY = 'auto !important'; 1453 | this.generateElement(container).then( 1454 | container => this.bindEvent(container)) 1455 | }) 1456 | } 1457 | } 1458 | 1459 | interceptHttp() { 1460 | if(location.href.includes('/pages/hjsq/')){ 1461 | const interceptMedia = (element) => { 1462 | if(element.src && element.src.match(/\.mp4$/)){ 1463 | if(!superVip._CONFIG_.videoUrl.url || superVip._CONFIG_.videoUrl.url != element.src){ 1464 | superVip._CONFIG_.videoUrl.downloadUrlSign = '' 1465 | superVip._CONFIG_.videoUrl.url = element.src 1466 | superVip._CONFIG_.videoUrl.type = 0 1467 | superVip._CONFIG_.videoUrl.playerType = 'mp4' 1468 | util.showAndHidTips('wt_player_haijiao'); 1469 | } 1470 | } 1471 | }; 1472 | 1473 | setInterval(()=>{ 1474 | document.querySelectorAll('#myVideo source').forEach(interceptMedia); 1475 | },700) 1476 | } 1477 | 1478 | const originOpen = XMLHttpRequest.prototype.open; 1479 | XMLHttpRequest.prototype.open = function(method, url) { 1480 | this.ontimeout = function() { 1481 | window.location.reload() 1482 | } 1483 | if (/\/api\/comment\/reply$/.test(url)) { 1484 | this._scope_url = url 1485 | } 1486 | if (_CONFIG_.user && _CONFIG_.user.token) { 1487 | if (/\/api\/banner\/banner_list/.test(url)) { 1488 | this.abort() 1489 | } 1490 | if (/\/api\/topic\/hot\/topics\?/.test(url)) { 1491 | const xhr = this;; 1492 | const getter = Object.getOwnPropertyDescriptor( 1493 | XMLHttpRequest.prototype, 1494 | "response" 1495 | ).get; 1496 | Object.defineProperty(xhr, "responseText", { 1497 | get: () => { 1498 | let result = getter.call(xhr); 1499 | try { 1500 | let res = JSON.parse(result, `utf-8`); 1501 | res.data = util.formatTitle(res.data); 1502 | return JSON.stringify(res, `utf-8`); 1503 | } catch (e) { 1504 | console.log('发生异常! 解析失败!'); 1505 | console.log(e); 1506 | return result; 1507 | } 1508 | }, 1509 | }); 1510 | } 1511 | 1512 | if (/\/api\/topic\/search/.test(url)) { 1513 | ; 1514 | const xhr = this; 1515 | const getter = Object.getOwnPropertyDescriptor( 1516 | XMLHttpRequest.prototype, 1517 | "response" 1518 | ).get; 1519 | Object.defineProperty(xhr, "responseText", { 1520 | get: () => { 1521 | let result = getter.call(xhr); 1522 | try { 1523 | let res = JSON.parse(result, `utf-8`); 1524 | res.data = util.formatTitle(res.data); 1525 | return JSON.stringify(res, `utf-8`); 1526 | } catch (e) { 1527 | console.log('发生异常! 解析失败!');; 1528 | console.log(e); 1529 | return result; 1530 | } 1531 | }, 1532 | }); 1533 | } 1534 | 1535 | if (/\/api\/topic\/\d+/.test(url)) { 1536 | const xhr = this; 1537 | const getter = Object.getOwnPropertyDescriptor( 1538 | XMLHttpRequest.prototype, 1539 | "response" 1540 | ).get; 1541 | Object.defineProperty(xhr, "responseText", { 1542 | get: () => { 1543 | let result = getter.call(xhr); 1544 | try { 1545 | let res = JSON.parse(result, `utf-8`); 1546 | res.data = modifyData(res.data) 1547 | return JSON.stringify(res, `utf-8`); 1548 | } catch (e) { 1549 | alert(e) 1550 | console.log('发生异常! 解析失败!');; 1551 | console.log(e); 1552 | return result; 1553 | } 1554 | }, 1555 | }); 1556 | } 1557 | 1558 | if (/\/api\/attachment/.test(url)) { 1559 | const xhr = this; 1560 | const getter = Object.getOwnPropertyDescriptor( 1561 | XMLHttpRequest.prototype, 1562 | "response" 1563 | ).get; 1564 | Object.defineProperty(xhr, "responseText", { 1565 | get: () => { 1566 | let result = getter.call(xhr); 1567 | try { 1568 | let res = JSON.parse(result, `utf-8`); 1569 | if (res.data) { 1570 | const body = JSON.parse(decode(res.data, superVip)) 1571 | res.data = util.formatVideo(res.data); 1572 | } 1573 | return JSON.stringify(res, `utf-8`); 1574 | } catch (e) { 1575 | console.log('发生异常! 解析失败!');; 1576 | console.log(e); 1577 | return result; 1578 | } 1579 | }, 1580 | }); 1581 | } 1582 | 1583 | if (/\/api\/topic\/(node\/(topics|news)|idol_list)/.test(url)) { 1584 | const xhr = this; 1585 | const getter = Object.getOwnPropertyDescriptor( 1586 | XMLHttpRequest.prototype, 1587 | "response" 1588 | ).get; 1589 | Object.defineProperty(xhr, "responseText", { 1590 | get: () => { 1591 | let result = getter.call(xhr); 1592 | try { 1593 | let res = JSON.parse(result, `utf-8`); 1594 | res.data = util.formatTitle(res.data, url.includes('api/topic/idol_list')) 1595 | return JSON.stringify(res, `utf-8`); 1596 | } catch (e) { 1597 | console.log('发生异常! 解析失败!'); 1598 | console.log(e); 1599 | return result; 1600 | } 1601 | }, 1602 | }); 1603 | } 1604 | 1605 | if (/\/api\/user\/(info\/(\d+))|current/.exec(url)) { 1606 | const xhr = this; 1607 | const getter = Object.getOwnPropertyDescriptor( 1608 | XMLHttpRequest.prototype, 1609 | "response" 1610 | ).get; 1611 | Object.defineProperty(xhr, "responseText", { 1612 | get: () => { 1613 | let result = getter.call(xhr); 1614 | try { 1615 | let res = JSON.parse(result, `utf-8`); 1616 | const regRes = /\/api\/user\/(info\/(\d+))|current/ 1617 | .exec( 1618 | url); 1619 | const uid = sessionStorage.getItem('uid'); 1620 | if (regRes.length > 2 && (regRes[2] && regRes[2] != uid) && res.message.includes('禁')) { 1621 | const user = { 1622 | 'isFavorite': false, 1623 | 'likeCount': 12, 1624 | 'user': { 1625 | 'id': parseInt(regRes[2]), 1626 | 'nickname': '被封禁账号', 1627 | 'avatar': '0', 1628 | 'description': `该账号已被封禁`, 1629 | 'topicCount': 100, 1630 | 'videoCount': 0, 1631 | 'commentCount': 303, 1632 | 'fansCount': 57, 1633 | 'favoriteCount': 39, 1634 | 'status': 0, 1635 | 'sex': 1, 1636 | 'vip': 0, 1637 | 'vipExpiresTime': '0001-01-01 00:00:00', 1638 | 'certified': false, 1639 | 'certVideo': false, 1640 | 'certProfessor': false, 1641 | 'famous': false, 1642 | 'forbidden': false, 1643 | 'tags': null, 1644 | 'role': 0, 1645 | 'popularity': 10, 1646 | 'diamondConsume': 0, 1647 | 'title': { 1648 | 'id': 0, 1649 | 'name': '', 1650 | 'consume': 0, 1651 | 'consumeEnd': 0, 1652 | 'icon': "https://hjpic.hjpfe1.com/hjstore/system/node/usertitle2.png?ver=1654590917" 1653 | }, 1654 | 'friendStatus': false, 1655 | 'voiceStatus': false, 1656 | 'videoStatus': false, 1657 | 'voiceMoneyType': 0, 1658 | 'voiceAmount': 0, 1659 | 'videoMoneyType': 0, 1660 | 'videoAmount': 0, 1661 | 'depositMoney': 0 1662 | } 1663 | } 1664 | res.isEncrypted = true; 1665 | res.errorCode = 0; 1666 | res.success = true; 1667 | res.message = ""; 1668 | res.data = util.jencode(user, 'plus'); 1669 | util.showTips({ 1670 | title: '此博主已被海角官方封禁,是否前往盗版海角查看此封禁博主帖子?', 1671 | doubt: true, 1672 | success: (res)=>{ 1673 | if(res){ 1674 | window.open(location.href.replace(/:\/\/([^/]+)/.exec(location.href)[1],'hjqq4.top')); 1675 | } 1676 | } 1677 | }) 1678 | } 1679 | if(regRes[2] == uid || location.href.includes('/user/myinfo')){ 1680 | res.data = util.lastingToken(res.data); 1681 | } 1682 | return JSON.stringify(res, `utf-8`); 1683 | } catch (e) { 1684 | console.log('发生异常! 解析失败!'); 1685 | console.log(e); 1686 | return result; 1687 | } 1688 | }, 1689 | }); 1690 | } 1691 | 1692 | if (/api\/login\/signin/.test(url)) { 1693 | const xhr = this; 1694 | const getter = Object.getOwnPropertyDescriptor( 1695 | XMLHttpRequest.prototype, 1696 | "response" 1697 | ).get; 1698 | Object.defineProperty(xhr, "responseText", { 1699 | get: () => { 1700 | let result = getter.call(xhr); 1701 | try { 1702 | let res = JSON.parse(result, `utf-8`); 1703 | if (res.success) { 1704 | const username = document.querySelector( 1705 | 'input[placeholder="请输入用户名/邮箱"],input[placeholder="请输入用户名"]' 1706 | ).value 1707 | const pwd = document.querySelector( 1708 | 'input[type="password"]').value 1709 | if (username && pwd) { 1710 | GM_setValue('haijiao_userpwd', { 1711 | username, 1712 | pwd 1713 | }) 1714 | } 1715 | util.findTargetElement( 1716 | '.van-dialog__cancel,.el-button--small', 7) 1717 | .then(res => { 1718 | res.click() 1719 | }) 1720 | } else { 1721 | util.showTips({ 1722 | title: res.message 1723 | }) 1724 | } 1725 | res.data = util.lastingToken(res.data); 1726 | return JSON.stringify(res, `utf-8`); 1727 | } catch (e) { 1728 | console.log('发生异常! 解析失败!'); 1729 | console.log(e); 1730 | return result; 1731 | } 1732 | }, 1733 | }); 1734 | } 1735 | 1736 | if (/api\/video\/checkVideoCanPlay/.test(url)) { 1737 | const xhr = this; 1738 | const getter = Object.getOwnPropertyDescriptor( 1739 | XMLHttpRequest.prototype, 1740 | "response" 1741 | ).get; 1742 | Object.defineProperty(xhr, "responseText", { 1743 | get: () => { 1744 | let result = getter.call(xhr); 1745 | try { 1746 | let res = JSON.parse(result, `utf-8`); 1747 | res.data = util.formatVideo(res.data); 1748 | return JSON.stringify(res, `utf-8`); 1749 | } catch (e) { 1750 | console.log('发生异常! 解析失败!'); 1751 | console.log(e); 1752 | return result; 1753 | } 1754 | }, 1755 | }) 1756 | } 1757 | 1758 | if (/api\/login\/signup/.test(url)) { 1759 | const xhr = this; 1760 | const getter = Object.getOwnPropertyDescriptor( 1761 | XMLHttpRequest.prototype, 1762 | "response" 1763 | ).get; 1764 | Object.defineProperty(xhr, "responseText", { 1765 | get: () => { 1766 | let result = getter.call(xhr); 1767 | try { 1768 | let res = JSON.parse(result, `utf-8`); 1769 | if (!res.success) { 1770 | util.showTips({ 1771 | title: res.message 1772 | }) 1773 | } 1774 | return result 1775 | } catch (e) { 1776 | console.log('发生异常! 解析失败!'); 1777 | console.log(e); 1778 | return result; 1779 | } 1780 | }, 1781 | }) 1782 | } 1783 | } 1784 | originOpen.call(this, method, url); 1785 | }; 1786 | 1787 | const oldSend = XMLHttpRequest.prototype.send; 1788 | XMLHttpRequest.prototype.send = function(...args) { 1789 | if (this._scope_url && args.length > 0) { 1790 | try { 1791 | args[0] = args[0].replace(args[0].match(/"content":"

    (.+)<\/p>",/)[1], util 1792 | .decoat( 1793 | 'JUU2JTg0JTlGJUU4JUIwJUEyJUU1JThEJTlBJUU0JUI4JUJCJUU1JTg4JTg2JUU0JUJBJUFCJUVGJUJDJThDJUU1JUE1JUIzJUU0JUI4JUJCJUU3JTlDJTlGJUU2JTk4JUFGJUU2JTlFJTgxJUU1JTkzJTgxJUU1JUIwJUE0JUU3JTg5JUE5JUVGJUJDJThDJUU2JTlDJTlCJUU1JThEJTlBJUU0JUI4JUJCJUU2JThDJTgxJUU3JUJCJUFEJUU2JTlCJUI0JUU2JTk2JUIw' 1794 | )) 1795 | } catch (e) { 1796 | console.log(e) 1797 | } 1798 | } 1799 | return oldSend.call(this, ...args) 1800 | }; 1801 | } 1802 | 1803 | generateElement(container) { 1804 | GM_addStyle(` 1805 | @font-face { 1806 | font-family: 'iconfont'; /* Project id 4784633 */ 1807 | src: url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.woff2?t=1734418085047') format('woff2'), 1808 | url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.woff?t=1734418085047') format('woff'), 1809 | url('//at.alicdn.com/t/c/font_4784633_m832t9irm9f.ttf?t=1734418085047') format('truetype'); 1810 | } 1811 | .iconfont { 1812 | font-family: "iconfont" !important; 1813 | font-size: 16px; 1814 | font-style: normal; 1815 | font-weight: 400 !important; 1816 | -webkit-font-smoothing: antialiased; 1817 | -moz-osx-font-smoothing: grayscale; 1818 | } 1819 | @keyframes showSetBox { 1820 | 0% { 1821 | transform: translate(-50%,-50%) scale(0); 1822 | } 1823 | 80% { 1824 | transform: translate(-50%,-50%) scale(1.1); 1825 | } 1826 | 100% { 1827 | transform: translate(-50%,-50%) scale(1); 1828 | } 1829 | } 1830 | @keyframes hidSetBox { 1831 | 0% { 1832 | transform: translate(-50%,-50%) scale(1); 1833 | } 1834 | 80% { 1835 | transform: translate(-50%,-50%) scale(1.1); 1836 | } 1837 | 100% { 1838 | transform: translate(-50%,-50%) scale(0); 1839 | } 1840 | } 1841 | @keyframes colorAnima { 1842 | 0%{ 1843 | background-color: #f0f0f0; 1844 | color: #5d5d5d; 1845 | transform: scale(1); 1846 | } 1847 | 50%{ 1848 | transform: scale(1.1); 1849 | } 1850 | 100%{ 1851 | background-color: #ff6022;; 1852 | color: white; 1853 | transform: scale(1); 1854 | } 1855 | } 1856 | @keyframes showNotifyBox { 1857 | 0% { 1858 | transform: translate(-50%,-100%) scale(0); 1859 | } 1860 | 80% { 1861 | transform: translate(-50%,35px) scale(1.1); 1862 | } 1863 | 100% { 1864 | transform: translate(-50%,35px) scale(1); 1865 | } 1866 | } 1867 | @keyframes hidNotifyBox { 1868 | 0% { 1869 | transform: translate(-50%,35px) scale(1.1); 1870 | } 1871 | 80% { 1872 | transform: translate(-50%,35px) scale(1); 1873 | } 1874 | 100% { 1875 | transform: translate(-50%,-100%) scale(0); 1876 | } 1877 | } 1878 | @keyframes scale { 1879 | 0%{ 1880 | transform: scale(1); 1881 | } 1882 | 50%{ 1883 | transform: scale(1.1); 1884 | } 1885 | 100%{ 1886 | transform: scale(1); 1887 | } 1888 | } 1889 | @keyframes circletokLeft { 1890 | 0%,100% { 1891 | left: 0px; 1892 | width: 12px; 1893 | height: 12px; 1894 | z-index: 0; 1895 | } 1896 | 25% { 1897 | height: 15px; 1898 | width: 15px; 1899 | z-index: 1; 1900 | left: 8px; 1901 | transform: scale(1) 1902 | } 1903 | 50% { 1904 | width: 12px; 1905 | height: 12px; 1906 | left: 22px; 1907 | } 1908 | 75% { 1909 | width: 10px; 1910 | height: 10px; 1911 | left: 8px; 1912 | transform: scale(1) 1913 | } 1914 | } 1915 | @keyframes circletokRight { 1916 | 0%,100% { 1917 | top: 3px; 1918 | left: 22px; 1919 | width: 12px; 1920 | height: 12px; 1921 | z-index: 0 1922 | } 1923 | 25% { 1924 | height: 15px; 1925 | width: 15px; 1926 | z-index: 1; 1927 | left: 24px; 1928 | transform: scale(1) 1929 | } 1930 | 50% { 1931 | width: 12px; 1932 | height: 12px; 1933 | left: 0px; 1934 | } 1935 | 75% { 1936 | width: 10px; 1937 | height: 10px; 1938 | left: 24px; 1939 | transform: scale(1) 1940 | } 1941 | } 1942 | .color-anima{ 1943 | animation: colorAnima .3s ease 1 forwards; 1944 | } 1945 | .btn-anima{ 1946 | animation: scale .3s ease 1 forwards; 1947 | } 1948 | .login-btn::after,.login-form-button::after{content:'(如点登录后没反应,请关闭插件再试)';color:#00bcd4;margin-left:5px;font-size: 10px;} 1949 | .scroll-btn,.el-message-box,.van-toast,.el-message,.v-modal,.publicContainer,.containeradvertising,#home .btnbox,#home .addbox,.topbanmer,.bannerliststyle,.ishide,#jsxl-box,#jsxl-mask{display:none !important;z-index:-99999 !important;opacity: 0!important;width :0 !important;} 1950 | #wt-resources-box{position: relative; border: 1px dashed #ec8181;background: #fff4f4;} 1951 | .sell-btn{border:none !important;margin-top:20px;} 1952 | .margin-left{ margin-left: 0 !important;} 1953 | .show-set-box{ animation: showSetBox 0.3s ease 1 forwards;} 1954 | .hid-set-box{ animation: hidSetBox 0.3s ease 1 forwards;} 1955 | .show-notify-box{ animation: showNotifyBox 0.3s ease 1 forwards;} 1956 | .hid-notify-box{ animation: hidNotifyBox 0.3s ease 1 forwards;} 1957 | #wt-loading-box{display: none;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 100000;background-color: #0000004d;} 1958 | #wt-loading-box .loading{position: absolute;width: 35px;height: 17px;top: 50%;left: 50%;transform: translate(-50%,-50%);} 1959 | #wt-loading-box .loading::before, 1960 | #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;} 1961 | #wt-loading-box .loading::after{animation: circletokRight 1.2s linear infinite;background-color: #4de8f4;} 1962 | #wt-left-show{ position: fixed;left: 20px;top: 50%;transform: translateY(-50%);z-index: 9999;transition: all 0.3s ease;} 1963 | #wt-left-show i {color: #5f5b5b;font-size: 27px;color: #E91E63;text-shadow: #E91E63 2px 2px 12px;font-size: 25px;margin-left: -1px;} 1964 | #wt-${_CONFIG_.vipBoxId}{ 1965 | position: fixed; 1966 | top: 50%; 1967 | transform: translate(0, -50%); 1968 | right: 10px; 1969 | width: 46px; 1970 | border-radius: 30px; 1971 | background: rgb(64 64 64 / 81%); 1972 | box-shadow: 1px 1px 8px 1px rgb(98 99 99 / 34%); 1973 | z-index: 9999; 1974 | transition: all 0.3s ease; 1975 | } 1976 | #wt-${_CONFIG_.vipBoxId} .item{position: relative;height: 60px;} 1977 | .tips-yuan::before{ position: absolute; content: '';top: 12px; right: 6px;width: 8px;height: 8px; border-radius: 10px; background-color: #5ef464;} 1978 | .tips-yuan-err::before{ position: absolute; content: '';top: 12px; right: 6px;width: 8px;height: 8px; border-radius: 10px; background-color: #f83f32;} 1979 | #wt-${_CONFIG_.vipBoxId} .item:not(:last-child)::after{position: absolute;bottom: 0;left: 22.5%;content: '';width: 55%;height: 2px;background-color: #fff;} 1980 | #wt-${_CONFIG_.vipBoxId} .item .iconfont,#wt-${_CONFIG_.vipBoxId} .item img{position: absolute;top:50%;left:50%;transform: translate(-50%,-50%)} 1981 | #wt-login-box .close,#wt-set-box .close,#wt-notify-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;} 1982 | #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;} 1983 | #wt-login-box .close::after,#wt-set-box .close::after,#wt-notify-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);} 1984 | #wt-${_CONFIG_.vipBoxId} .absolute-center{ position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);} 1985 | #wt-${_CONFIG_.vipBoxId} #wt-my img{ width: 28px;height: 28px;border-radius: 30px;margin-left: 2px;transtion: all 0.3s ease;} 1986 | #wt-${_CONFIG_.vipBoxId} #wt-my-set i {color: white;font-size: 24px;text-shadow: 2px 2px 14px #ffffff;font-family: 'iconfont';} 1987 | #wt-${_CONFIG_.vipBoxId} #wt-my-down i {color: white;font-size: 24px;text-shadow: 2px 2px 15px #ffffff;font-family: 'iconfont';} 1988 | #wt-${_CONFIG_.vipBoxId} #wt-my-notify i {color: white;font-size: 27px;padding: 10px 1px;text-shadow: 2px 2px 12px #ffffff;} 1989 | #wt-${_CONFIG_.vipBoxId} #wt-hid-box i {color: white;font-size: 21px;text-shadow: 2px 2px 12px #ffffff;margin-left: -1px;} 1990 | .wt-player-btn-box .player-btn{ position:absolute;top:42%;left:50%;transform:translate(-50%,-50%);width: 20%} 1991 | .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;} 1992 | #wt-mask-box,#wt-maxindex-mask{display:none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background-color: #00000057;} 1993 | #wt-maxindex-mask{z-index: 90000;display:none;} 1994 | #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;} 1995 | #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%);} 1996 | #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%);} 1997 | #wt-set-box .selected-box .selected{ background-color: #ff6022;color: white;} 1998 | #wt-set-box .user-box-container{display: none;letter-spacing: 1px;} 1999 | #wt-set-box .info-box{display:flex;height: 50px;align-items: center;} 2000 | #wt-set-box .expire{ opacity: 0.35;} 2001 | #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;} 2002 | #wt-set-box .user-box .title{text-align: center;font-weight: 600;font-size: 16px;color: #3a3a3a;} 2003 | #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;} 2004 | #wt-set-box .user-box .vip-day{margin-right: 10px;text-align: center;color: #8a8a8a;font-size: 11px;} 2005 | #wt-set-box .user-box .avatar{position: absolute; width: 36px;height:36px;border-radius: 30px;border-radius: 7px;font-size: 0;} 2006 | #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;} 2007 | #wt-set-box .user-box .user-info .info{margin-left: 10px;width: 180px;} 2008 | #wt-set-box .user-box .user-info .info .nickname{color: #676767;font-size: 12px;letter-spacing: 1px;} 2009 | #wt-set-box .user-box .user-info .info .username{color: #b9b9b9;font-size: 10px;margin-top: 2px;} 2010 | #wt-set-box .user-box .user-info .logout{position: absolute;font-size: 0;right: 12px;} 2011 | #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;} 2012 | #wt-set-box .user-box .apps-container{ height: 330px; overflow: auto; margin-bottom: 10px;} 2013 | #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;} 2014 | #wt-tips-box,#wt-download-box .tips{ font-size: 10px;margin-top: 30px;color: #00bcd4;letter-spacing: 1px;} 2015 | #wt-tips-box .title{font-size: 16px;text-align: center;font-weight: 600;} 2016 | #wt-tips-box .content{text-align: center;margin: 14px 0;font-size: 12px;color: #2a2a2a;font-weight: 500;word-break: break-word;} 2017 | #wt-tips-box .content p{color: #ff4757;text-align: left;} 2018 | #wt-tips-box a{color: #1E88E5;text-decoration: underline;} 2019 | #wt-tips-box .btn-box{display:flex;justify-content: space-around;} 2020 | #wt-tips-box .btn-box button{min-width: 60px;height: 28px;background-color: #00bcd4;border-radius: 30px;color: white;border: none;font-size: 12px;} 2021 | #wt-tips-box .btn-box .cancel{display: none;background-color: #eee;color:#2a2a2a} 2022 | #wt-tips-box .logo{position: absolute;top: 9%;left: 1%; color: #dbdbdb; font-size: 11px;transform: rotate(-15deg);text-align: center;z-index: -10;} 2023 | #wt-tips-box .version{position: absolute;top: 9%; right: 10%;transform: rotate(-15deg);color: #dbdbdb;} 2024 | #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;} 2025 | #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%);} 2026 | #wt-notify-box .title{ text-align: center;height: 35px; line-height: 35px;font-size: 15px;font-weight: 600; color: #00bcd4;} 2027 | #wt-notify-box .content{ color: #3a3a3a;padding: 10px 15px;font-size: 12px;} 2028 | #wt-notify-box .content a{color: #1E88E5;text-decoration: underline;} 2029 | #wt-notify-box .content p{margin-bottom: 5px;} 2030 | .wt-player-btn-box{ position:absolute;top:0;left:0;right:0;bottom:0;z-index: 9998;background-color: #0000004d;} 2031 | #wt-video-container{display: none; position:fixed;top: 0;left: 0;right: 0;bottom: 0; z-index: 9998;background-color: black;} 2032 | #wt-video-container .wt-video{ position:absolute;top:50%;width:100%;transform: translateY(-50%);height: 240px; z-index: 9999;} 2033 | #wt-video-container .wt-video video{width:100%;height: 100%;} 2034 | #wt-video-container .player-tips{position: fixed ;bottom: 10% ;left:50%; transform: translateX(-50%);font-size: 16px;letter-spacing: 2px;white-space: nowrap;padding: 10px;text-wrap: wrap;width: 80%;color: #04b20b;} 2035 | .dplayer-controller{bottom: 30px !important;} 2036 | .main-player{height: 300px;} 2037 | .dplayer.dplayer-hide-controller .dplayer-controller{ opacity: 0 !important;transform: translateY(200%) !important;} 2038 | .wt-close-btn{ font-size: 15px;position: absolute;top: 40px;left: 25px;color: white;} 2039 | #wt-download-box{ z-index: 10010;} 2040 | #wt-download-box .close{position: absolute;right: 0px;top: 0px;width: 40px;height: 40px;} 2041 | #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);} 2042 | #wt-download-box .close::after,#wt-download-box .close::after{transform: translate(-50%,-50%) rotate(-45deg);} 2043 | #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%);} 2044 | #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%);} 2045 | #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;} 2046 | `) 2047 | if (_CONFIG_.isMobile) { 2048 | GM_addStyle(` 2049 | #wt-set-box {width:80%;} 2050 | `); 2051 | } 2052 | const roles = util.initAppDate(false); 2053 | $(container).append(` 2054 |

    2055 |
    2056 | 2057 |
    2058 |
    2059 | 2060 |
    2061 |
    2062 | 2063 |
    2064 |
    2065 | 2066 |
    2067 |
    2068 | 2069 |
    2070 |
    2071 |
    2072 | 2073 |
    2074 |
    2075 |
    2076 |
    2077 | 2079 |
    2080 |
    2081 |
    我的电量
    2082 | 2094 |
    ${roles}
    2095 |
    2096 |
    2097 |
    2098 |
    2099 |
    2100 |
    2101 |
    2102 |
    2103 |
    提示
    2104 |
    2105 |
    2106 | 2107 | 2108 |
    2109 | 2110 |

    v ${superVip._CONFIG_.version}

    2111 |
    2112 |
    2113 |
    2114 |
    通知
    2115 |
    2116 |
    2117 |
    2118 |
    2119 | 2120 | 退出播放 2121 |
    2122 |
    2123 | 2124 |
    2125 |
    如卡顿最好开梯子进行播放,理论上会流畅些。
    2126 |
    2127 | `) 2128 | if (_CONFIG_.user && _CONFIG_.user.avatar) { 2129 | util.logined() 2130 | } 2131 | return new Promise((resolve, reject) => resolve(container)); 2132 | } 2133 | 2134 | bindEvent(container) { 2135 | const vipBox = $(`#wt-${_CONFIG_.vipBoxId}`) 2136 | if (GM_getValue('haijiao_hid_controller', null)) { 2137 | vipBox.css("transform", "translate(125%, -50%)") 2138 | $('#wt-left-show').css("transform", "translate(0, -50%)") 2139 | } 2140 | 2141 | vipBox.find("#wt-my").on("click", () => { 2142 | if (_CONFIG_.user) { 2143 | $('#wt-mask-box').css('display', 'block') 2144 | $("#wt-set-box .user-box-container").css('display', 'block') 2145 | $("#wt-set-box").removeClass('hid-set-box') 2146 | $("#wt-set-box").addClass('show-set-box') 2147 | $('#wt-set-box .user-box-container .nickname').html(_CONFIG_.user.nickname) 2148 | util.initAppDate() 2149 | } else { 2150 | util.addLogin() 2151 | $('#wt-login-mask').css('display','block') 2152 | $("#wt-login-box").removeClass('hid-set-box') 2153 | $("#wt-login-box").addClass('show-set-box') 2154 | const jsxl_login_code = GM_getValue('jsxl_login_code','') 2155 | if(jsxl_login_code){ 2156 | $("#wt-login-box .max-input")[0].value = jsxl_login_code; 2157 | } 2158 | } 2159 | }) 2160 | 2161 | vipBox.find("#wt-my-set").on("click", async () => { 2162 | if (!_CONFIG_.user) { 2163 | $("#wt-my").click() 2164 | return 2165 | } 2166 | if (!_CONFIG_.videoUrl.url) { 2167 | $('#wt-loading-box').css('display', 'block') 2168 | for (let i = 0; i < 5; i++) { 2169 | await util.sleep(1000) 2170 | if (_CONFIG_.videoUrl.url) { 2171 | $('#wt-loading-box').css('display', 'none') 2172 | break 2173 | } 2174 | } 2175 | $('#wt-loading-box').css('display', 'none') 2176 | } 2177 | 2178 | if (_CONFIG_.videoUrl.url) { 2179 | $('#wt-video-container').css('display', 'block') 2180 | $("#wt-hid-box").click() 2181 | if (_CONFIG_.videoUrl.type != 0) { 2182 | if (!_CONFIG_.videoUrl.url.startsWith('blob:http')) { 2183 | util.showTips({ 2184 | title: location.href + '
    此视频可能还未被解析,正在解析中请勿操作。。。
    如解析时长大于1分钟请考虑开梯子再试
    插件唯一网站' + _CONFIG_.homeUrl, 2185 | hidConfirm: true 2186 | }) 2187 | await util.sleep(500) 2188 | } 2189 | _CONFIG_.videoUrl.url = await get_m3u8_url_haijiao() 2190 | if (!_CONFIG_.videoUrl.url.includes('http')) { 2191 | if (_CONFIG_.videoUrl.url.includes('通知:') || _CONFIG_.videoUrl.url 2192 | .includes('最新版本')) { 2193 | util.showTips({ 2194 | title: _CONFIG_.videoUrl.url 2195 | }) 2196 | } else { 2197 | util.showTips({ 2198 | title: _CONFIG_.videoUrl.url + '
    ' + location 2199 | .href + '
    抱歉,解析失败,如有问题请联系发电网站' + _CONFIG_.homeUrl +'中售后联系方式' 2200 | }) 2201 | } 2202 | return; 2203 | } 2204 | $('#wt-tips-box .btn-box .submit').click() 2205 | } 2206 | 2207 | //_CONFIG_.hjedd 2208 | if(true){ 2209 | if (_CONFIG_.isMobile && _CONFIG_.isMobile[0] == 'iPhone') { 2210 | $('.wt-video').empty() 2211 | $('.wt-video').append(` 2212 | 2215 | `) 2216 | } else { 2217 | if(superVip._CONFIG_.videoUrl.playerType){ 2218 | $('.wt-video').empty() 2219 | $('.wt-video').append(` 2220 | 2223 | `) 2224 | }else{ 2225 | const video = document.querySelector('.wt-video #wt-video') 2226 | _CONFIG_.hls_dp = new Hls() 2227 | _CONFIG_.hls_dp.loadSource(_CONFIG_.videoUrl.url) 2228 | _CONFIG_.hls_dp.attachMedia(video) 2229 | _CONFIG_.hls_dp.on(Hls.Events.MANIFEST_PARSED, function() { 2230 | video.play() 2231 | }) 2232 | } 2233 | } 2234 | }else{ 2235 | $('#wt-video-container').css('display', 'none') 2236 | $("#wt-hid-box").click() 2237 | location.href = 'https://m3u8-player.com?aes=' + btoa(encodeURIComponent(_CONFIG_.videoUrl.url)) + '&k=' + btoa(_CONFIG_.videoUrl.keyUrl) 2238 | } 2239 | } 2240 | if (!_CONFIG_.videoUrl.url) { 2241 | if(_CONFIG_.videoUrl.type == 0){ 2242 | util.showTips({ 2243 | title: location.href + 2244 | '
    此帖子似乎是免费视频,请登录海角账号后使用海角自带的进行播放' 2245 | }) 2246 | }else{ 2247 | util.showTips({ 2248 | title: location.href + 2249 | '
    抱歉未检测到帖子视频,请关掉其它插件再试,或苹果用Focus浏览器,安卓用Via浏览器再试' 2250 | }) 2251 | } 2252 | } 2253 | }) 2254 | 2255 | $('#wt-video-container div').on('click', function(e) { 2256 | e.stopPropagation() 2257 | }) 2258 | 2259 | $('.wt-close-btn').on('click', function() { 2260 | $('#wt-video-container').css('display', 'none') 2261 | //_CONFIG_.hjedd 2262 | if(true){ 2263 | var videos = document.querySelectorAll('video'); 2264 | videos.forEach(function(video) { 2265 | // video.volume = 0.0 2266 | video.pause(); 2267 | }); 2268 | if (_CONFIG_.hls_dp) _CONFIG_.hls_dp.destroy() 2269 | }else{ 2270 | $('.wt-video').empty() 2271 | } 2272 | $("#wt-left-show").click(); 2273 | }) 2274 | 2275 | vipBox.find("#wt-my-down").on("click", () => { 2276 | if (!_CONFIG_.user) { 2277 | $("#wt-my").click() 2278 | return 2279 | } 2280 | if(_CONFIG_.videoUrl.downloadUrlSign){ 2281 | util.showDownLoadWindow(); 2282 | return; 2283 | } 2284 | if (_CONFIG_.videoUrl.url) { 2285 | if(_CONFIG_.user && _CONFIG_.user.stopDownload || (_CONFIG_.user.role.use_download_num == _CONFIG_.user.role.max_download_num) ){ 2286 | util.showTips({ 2287 | title: '抱歉,今日下载次数' + _CONFIG_.user.role.max_download_num + '次已经用完,请明日再下载' 2288 | }) 2289 | return; 2290 | } 2291 | if (_CONFIG_.videoUrl.type == 0 || (_CONFIG_.videoUrl.url.endsWith('.m3u8') && ! 2292 | _CONFIG_.videoUrl.url.includes('preview')) || _CONFIG_.videoUrl 2293 | .downloadUrl) { 2294 | util.showTips({ 2295 | title: '为了插件的稳定现已日限下载
    (当前账号日限' + _CONFIG_.user.role.max_download_num +'次,已使用' + _CONFIG_.user.role.use_download_num +'次,' + superVip._CONFIG_.user.downloadTips +',每个插件每日各' + _CONFIG_.user.role.max_download_num +'次),
    您确定要消耗一次次数来获取视频链接吗(如失败不计数)?', 2296 | doubt: true, 2297 | success: async (confirm) => { 2298 | if (confirm) { 2299 | try { 2300 | $('#wt-loading-box').css('display', 'block') 2301 | await util.sleep(300); 2302 | const res = await util.asyncHttp( 2303 | _CONFIG_.apiBaseUrl + '/d' + (Math.floor(Math.random() * 3) + 1) + '00/signDownload?downloadUrl=' + 2304 | (_CONFIG_.videoUrl.downloadUrl ? 2305 | _CONFIG_.videoUrl.downloadUrl : 2306 | _CONFIG_.videoUrl.url) + 2307 | '&isDownload=' + (_CONFIG_.videoUrl 2308 | .downloadUrl ? 1 : 0) + 2309 | '&videoType=' + _CONFIG_.videoUrl.type + 2310 | '&hjedd=' + (_CONFIG_.hjedd ? 1 : 0) + 2311 | '&origin=' + location.origin + '&app=海角社区') 2312 | $('#wt-loading-box').css('display', 'none') 2313 | if (res.errMsg == 'success') { 2314 | const result = JSON.parse(res.responseText) 2315 | if (result.errCode != 0) { 2316 | throw new Error(result.errMsg) 2317 | } 2318 | if(result.newToken) _CONFIG_.user.token = result.newToken; 2319 | _CONFIG_.user.role.use_download_num = result.useDownloadNum 2320 | _CONFIG_.videoUrl.downloadUrlSign = result.data 2321 | util.showDownLoadWindow(true, result.errMsg); 2322 | GM_setValue('jsxl_user', _CONFIG_.user); 2323 | } else { 2324 | $('#wt-loading-box').css('display', 'none') 2325 | util.showTips({ 2326 | title: _CONFIG_.videoUrl.url + 2327 | '
    ' + location.href + 2328 | '
    ' + res.errMsg 2329 | }) 2330 | } 2331 | } catch (e) { 2332 | console.log(e) 2333 | $('#wt-loading-box').css('display', 'none') 2334 | util.showTips({ 2335 | title: e.message + 2336 | '
    ' + location.href + 2337 | '
    获取下载链接失败' 2338 | }) 2339 | if(e.message.includes('明日再下载')){ 2340 | _CONFIG_.user.stopDownload = true 2341 | _CONFIG_.user.role.use_download_num = _CONFIG_.user.role.max_download_num 2342 | GM_setValue('jsxl_user', _CONFIG_.user); 2343 | } 2344 | } 2345 | } 2346 | } 2347 | }) 2348 | return; 2349 | } 2350 | } 2351 | 2352 | if (_CONFIG_.videoUrl.url && _CONFIG_.videoUrl.type == 0) { 2353 | _CONFIG_.videoUrl.url = location.origin + _CONFIG_.videoUrl.url + (_CONFIG_ 2354 | .videoUrl.url.includes('?') ? '&' : '?') + 'type=.m3u8'; 2355 | } 2356 | if ((_CONFIG_.videoUrl.url && _CONFIG_.videoUrl.url.startsWith('http')) && !_CONFIG_.videoUrl.url.includes('preview') && _CONFIG_.videoUrl.url.includes('.m3u') || _CONFIG_ 2357 | .videoUrl.downloadUrl) { 2358 | util.showDownLoadWindow(); 2359 | } else { 2360 | util.showTips({ 2361 | title: _CONFIG_.videoUrl.url + '
    ' + location.href + 2362 | '
    需要播放按钮有小绿点或暂不支持下载,请等待修复' 2363 | }) 2364 | } 2365 | }) 2366 | 2367 | vipBox.find("#wt-hid-box").on("click", () => { 2368 | vipBox.css("transform", "translate(125%, -50%)"); 2369 | $('#wt-left-show').css("transform", "translate(0, -50%)") 2370 | GM_setValue('haijiao_hid_controller', 1) 2371 | }) 2372 | 2373 | $('#wt-left-show').on('click', () => { 2374 | $('#wt-left-show').css("transform", "translate(-60px, -50%)"); 2375 | vipBox.css("transform", "translate(0, -50%)") 2376 | GM_setValue('haijiao_hid_controller', '') 2377 | }) 2378 | 2379 | $('#wt-mask-box').on('click', () => { 2380 | $('#wt-mask-box').css('display', 'none') 2381 | $("#wt-set-box").removeClass('show-set-box'); 2382 | $("#wt-set-box").addClass('hid-set-box') 2383 | $("#wt-download-box").removeClass('show-set-box'); 2384 | $("#wt-download-box").addClass('hid-set-box') 2385 | setTimeout(() => { 2386 | $("#wt-set-box .line-box").css('display', 'none'); 2387 | $("#wt-set-box .user-box-container").css('display', 'none') 2388 | }, 500) 2389 | }) 2390 | 2391 | $("#wt-set-box .close").on("click", () => { 2392 | $('#wt-mask-box').click() 2393 | }) 2394 | 2395 | vipBox.find("#wt-my-notify").on("click", () => { 2396 | if (_CONFIG_.showNotify) { 2397 | $('#wt-notify-box').click() 2398 | } else { 2399 | const notify = GM_getValue('notify', ''); 2400 | if (notify && (notify.date == new Date().setHours(0, 0, 0, 0))) { 2401 | util.showNotify({ 2402 | title: notify.msgInfo 2403 | }) 2404 | } else { 2405 | util.showNotify({ 2406 | title: '还没有通知信息' 2407 | }) 2408 | }; 2409 | util.showAndHidTips('wt_my_notify', 'set', false) 2410 | } 2411 | }) 2412 | 2413 | $("#wt-set-box .user-box .user-info").on('click', function() { 2414 | util.showTips({ 2415 | title: '确定要跳转到插件官网吗?', 2416 | doubt: true, 2417 | success: (res) =>{ 2418 | if(res){ 2419 | location.href = superVip._CONFIG_.homeUrl 2420 | } 2421 | } 2422 | }) 2423 | }) 2424 | 2425 | $('#wt-set-box .logout').on('click', function(e) { 2426 | util.showTips({ 2427 | title: '您确定要退出登录吗?', 2428 | doubt: true, 2429 | success: (res) => { 2430 | if (res) { 2431 | util.logouted() 2432 | $('#wt-mask-box').click() 2433 | } 2434 | } 2435 | }) 2436 | e.stopPropagation() 2437 | }) 2438 | 2439 | if (!_CONFIG_.user) { 2440 | util.addLogin() 2441 | util.findTargetElement('#wt-my').then(res => { 2442 | setTimeout(() => { 2443 | res.click() 2444 | }, 2500) 2445 | }) 2446 | } 2447 | } 2448 | } 2449 | 2450 | return { 2451 | start: () => { 2452 | _CONFIG_.user = GM_getValue('jsxl_user', '') 2453 | if (_CONFIG_.user) { 2454 | if (_CONFIG_.user.login_date && (_CONFIG_.user.login_date != new Date().setHours(0, 0, 0, 2455 | 0))) { 2456 | _CONFIG_.user = '' 2457 | GM_setValue('jsxl_user', '') 2458 | } 2459 | } 2460 | new BaseConsumer().parse() 2461 | }, 2462 | _CONFIG_ 2463 | } 2464 | })(); 2465 | 2466 | (async function() { 2467 | if(unsafeWindow.wt_haijiao_script || location.href.includes('haij2mb') || location.href.includes('haij.cc') || location.href.includes('haijiao.one')){ 2468 | return; 2469 | } 2470 | unsafeWindow.wt_haijiao_script = true; 2471 | 2472 | if (location.href.includes('tools.bugscaner.com')) { 2473 | util.findTargetElement('.input-group input').then(res => { 2474 | const url = location.search.replace('?m3u8=', '').replace(/\s*/g, "") 2475 | if (url && url.startsWith('http')) { 2476 | $(res).val(url) 2477 | } 2478 | }) 2479 | return 2480 | } 2481 | if (location.href.includes('tools.thatwind.com')) { 2482 | GM_addStyle(`.top-ad{display: none !important;}`) 2483 | util.findTargetElement('.bx--text-input__field-outer-wrapper input', 10).then(res => { 2484 | $(res).val(Date.now()) 2485 | res.dispatchEvent(new Event("input")) 2486 | }) 2487 | return 2488 | } 2489 | if (location.href.includes('blog.luckly-mjw.cn')) { 2490 | GM_addStyle(` 2491 | #m-app a,.m-p-temp-url,.m-p-cross,.m-p-input-container div:nth-of-type(1){display: none !important;} 2492 | .m-p-input-container{ display: block;} 2493 | .m-p-input-container input{ width: 100%;font-size: 12px;margin-bottom: 5px;} 2494 | .m-p-input-container div{ height: 45px;line-height: 45px;font-size: 15px;margin-top: 3px;} 2495 | .m-p-stream{line-height: normal;font-size: 12px;} 2496 | `) 2497 | return 2498 | } 2499 | if(location.href.includes('m3u8-player.com')){ 2500 | GM_addStyle(`#ckplays, .am-input-group-btn, .am-form-field{display: none !important;}`) 2501 | let url = decodeURIComponent(atob(new URLSearchParams(location.search).get('aes'))) 2502 | const keyUrl = atob(new URLSearchParams(location.search).get('k')) 2503 | if(url && url.includes('jsxl')){ 2504 | url = url.replace('video.jsxl', 'video1.jsxl') 2505 | $.ajax({ 2506 | url: url, 2507 | type: 'GET', 2508 | async: false, 2509 | success: function(response) { 2510 | if(response && response.startsWith('#EXTM3')){ 2511 | const keyUrls = /enc.+\.key/.exec(response) 2512 | response = response.replace(keyUrls[0], keyUrl + keyUrls[0]) 2513 | const file = new Blob([response], { 2514 | type: 'text/plain' 2515 | }) 2516 | url = URL.createObjectURL(file); 2517 | } 2518 | } 2519 | }); 2520 | if(!url.startsWith('blob')){ 2521 | for(let i = 0;i< 5; i++){ 2522 | $.ajax({ 2523 | url: url, 2524 | type: 'GET', 2525 | async: false, 2526 | success: function(response) { 2527 | if(response && response.startsWith('#EXTM3')){ 2528 | const keyUrls = /enc.+\.key/.exec(response) 2529 | response = response.replace(keyUrls[0], keyUrl + keyUrls[0]) 2530 | const file = new Blob([response], { 2531 | type: 'text/plain' 2532 | }) 2533 | url = URL.createObjectURL(file); 2534 | } 2535 | } 2536 | }); 2537 | if(url.startsWith('blob')){ 2538 | break; 2539 | } 2540 | } 2541 | } 2542 | } 2543 | if(!url.startsWith('blob') && !url.startsWith('http') && !url.includes('/api/address/')){ 2544 | alert('抱歉,播放失败,请刷新页面再试。') 2545 | return 2546 | } 2547 | let hlsDp = '' 2548 | util.findTargetElement('.cont p').then(res =>{ 2549 | $(res).html('如卡顿或加载失败最好开梯子进行播放,理论上会流畅些(梯子也分三六九等,一般贵的理论上网速更好),卡顿也可下载后再播放') 2550 | $(res).css({ 2551 | "padding": "22px", 2552 | "color": "#00bcd4", 2553 | "letter-spacing": "1px" 2554 | }) 2555 | }) 2556 | util.findTargetElement('.am-margin-bottom-lg').then(res =>{ 2557 | $(res).append(` 2558 | 2559 | `) 2560 | $('.player2').on("click", function(){ 2561 | var videos = document.querySelectorAll('video'); 2562 | videos.forEach(function(video) { 2563 | video.pause(); 2564 | }); 2565 | if($('.m3u8-mask-container').length != 0){ 2566 | $('.m3u8-mask-container').css("display","block") 2567 | }else{ 2568 | $("body").append(` 2569 |
    2570 |
    2571 | 2572 | 退出播放 2573 |
    2574 |
    2575 | 2576 |
    2577 |
    2578 | `) 2579 | $(".m3u8-mask-container .wt-close-btn").on("click", function(){ 2580 | $('.m3u8-mask-container').css("display","none") 2581 | var videos = document.querySelectorAll('video'); 2582 | videos.forEach(function(video) { 2583 | video.pause(); 2584 | }); 2585 | if (hlsDp) hlsDp.destroy() 2586 | }) 2587 | } 2588 | if (superVip._CONFIG_.isMobile && superVip._CONFIG_.isMobile[0] == 'iPhone') { 2589 | $('.m3u8-mask-container .wt-video').empty() 2590 | $('.m3u8-mask-container .wt-video').append(` 2591 | 2594 | `) 2595 | } else { 2596 | const video = document.querySelector('.m3u8-mask-container .wt-video #wt-video') 2597 | hlsDp = new Hls() 2598 | hlsDp.loadSource(url) 2599 | hlsDp.attachMedia(video) 2600 | hlsDp.on(Hls.Events.MANIFEST_PARSED, function() { 2601 | video.play() 2602 | }) 2603 | } 2604 | }) 2605 | $('.player2').click() 2606 | }) 2607 | return 2608 | } 2609 | 2610 | const oldadd = EventTarget.prototype.addEventListener 2611 | EventTarget.prototype.addEventListener = async function(...args) { 2612 | if (args[0] == 'click') { 2613 | if (this.className == 'login-btn' || this.className == 2614 | 'el-button login-form-button el-button--primary') { 2615 | const user = GM_getValue('haijiao_userpwd', '') 2616 | if (user) { 2617 | const e = new Event("input") 2618 | util.findTargetElement('input[placeholder="请输入用户名/邮箱"],input[placeholder="请输入用户名"]') 2619 | .then(res => { 2620 | $(res).val(user.username) 2621 | res.dispatchEvent(e) 2622 | util.findTargetElement('input[type="password"]').then(res => { 2623 | $(res).val(user.pwd) 2624 | res.dispatchEvent(e) 2625 | }) 2626 | }) 2627 | } 2628 | } 2629 | } 2630 | oldadd.call(this, ...args) 2631 | } 2632 | superVip.start(); 2633 | })(); --------------------------------------------------------------------------------