黑料不打烊.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. var rule = {
  2. title: '黑料不打烊[密]',
  3. host: 'https://hl49.co',
  4. url: '/category/fyclass/fypage.html',
  5. searchUrl: '/index/search_article?word=**&page=fypage',
  6. searchable: 1,
  7. quickSearch: 0,
  8. filterable: 0,
  9. headers: {
  10. 'User-Agent': 'Mozilla/5.0',
  11. },
  12. class_parse: '.slider-content&&a;span&&Text;a&&href;.*/(\\d+)\.html',
  13. hostJs: $js.toString(() => {
  14. HOST = 'https://mgj.uzrpy.com';
  15. try {
  16. let html = request(rule.host);
  17. HOST = pdfh(html, ".box-wrap&&a&&href") || HOST;
  18. } catch (e) {
  19. log(`获取Host错误${e.message}`);
  20. }
  21. }),
  22. hikerListCol: "card_pic_1",
  23. hikerClassListCol: "card_pic_1",
  24. lazy: typeof MY_NAME !== "undefined" ? $js.toString(() => {
  25. var list = jsp.pdfa(request(input), '.dplayer');
  26. input = {
  27. parse: ""
  28. };
  29. if (list.length === '1') {
  30. let url = JSON.parse(pdfh(list[0], '.dplayer&&config')).video.url;
  31. input.url = url.startsWith("http") ? url : "https://hls.vdtuzv.com" + url;
  32. } else {
  33. var a = []
  34. list.forEach((data, id) => a.push('第' + (id + 1) + '部'))
  35. input.url = $(a, 1)
  36. .select(list => {
  37. input = input.match(/\d+/)[0] - 1
  38. return $(JSON.parse(pdfh(list[input], '.dplayer&&config'))
  39. .video.url)
  40. .lazyRule(() => input.startsWith("http") ? input : "https://hls.vdtuzv.com" + input)
  41. }, list)
  42. }
  43. }) : void 0,
  44. play_parse: true,
  45. limit: 6,
  46. proxy_rule: $js.toString(() => {
  47. //log(input);
  48. // 测试:https://www.wakatool.com/base64img
  49. if (input) {
  50. let t1 = new Date().getTime();
  51. let _type = input.url.split('.').slice(-1)[0];
  52. let data = request(input.url, {toBase64: true});
  53. //log(data);
  54. let t2 = new Date().getTime();
  55. log(`网络请求获取图片耗时:${t2 - t1}ms`);
  56. // log(`当前线程:${java.lang.Thread.currentThread().getName()}`);
  57. let key = CryptoJS.enc.Utf8.parse("f5d965df75336270");
  58. let iv = CryptoJS.enc.Utf8.parse("97b60394abc2fbe1");
  59. let encrypted = CryptoJS.AES.decrypt({
  60. ciphertext: CryptoJS.enc.Base64.parse(data)
  61. }, key, {
  62. iv: iv,
  63. mode: CryptoJS.mode.CBC,
  64. padding: CryptoJS.pad.Pkcs7
  65. }).toString(CryptoJS.enc.Base64);
  66. // .toString(CryptoJS.enc.Utf8).toTypedArray(CryptoJS.enc.Utf8); //直接转参数3可用的字节流方法
  67. let img_base64 = 'data:image/' + _type + ';base64,' + encrypted;
  68. let t3 = new Date().getTime();
  69. log(`已获取图片${input.url}解密耗时:${t3 - t2}ms`);
  70. // // input = [200, 'text/plain', img_base64];
  71. // input = [302, 'text/html', '', {Location:'https://www.baidu.com'}];
  72. input = [200, 'image/' + _type, img_base64, null, 1];
  73. // input = [200, 'text/plain', data];
  74. }
  75. }),
  76. 预处理: $js.toString(() => {
  77. rule.cate_exclude = '';
  78. }),
  79. 推荐: '*',
  80. 一级: $js.toString(() => {
  81. let d = [];
  82. let html = request(input);
  83. let list = pdfa(html, '.video-item');
  84. list.forEach(item => {
  85. var pic = pdfh(item, 'img&&onload');
  86. var url = pd(item, 'a&&href', MY_URL);
  87. var title = pdfh(item, '.title&&Text');
  88. if (title) {
  89. d.push({
  90. title: title,
  91. img: pic,
  92. desc: "0",
  93. url: url
  94. });
  95. }
  96. });
  97. setResult(d);
  98. }),
  99. //一级: '.video-item;.title&&Text;img&&onload;;a&&href',
  100. 图片替换: $js.toString(() => {
  101. if (/loadImg/.test(input)) {
  102. input = input.split("'")[1];
  103. }
  104. // tim壳子专用图片解密
  105. // input = input + '@Option:{"mode":"CBC","inbase64":false,"key":"f5d965df75336270","iv":"97b60394abc2fbe1"}';
  106. input = getProxyUrl() + '&url=' + input;
  107. }),
  108. 二级: "*",
  109. 搜索: $js.toString(() => {
  110. let d = [];
  111. let u = input.split("?");
  112. let h = post(u[0], {
  113. body: u[1]
  114. });
  115. let list = JSON.parse(h).data.list;
  116. list.forEach(item => {
  117. let pic = item.thumb;
  118. let url = `${rule.host}/archives/${item.id}.html`
  119. d.push({
  120. title: item.title,
  121. desc: item.created_date,
  122. img: pic,
  123. url: url
  124. });
  125. });
  126. setResult(d);
  127. })
  128. }