黑料不打烊.js 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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_name: '首页&热点&明星&奇葩&真实',
  13. class_url: '0&1&2&3&4',
  14. hostJs: $js.toString(() => {
  15. HOST = 'https://mgj.uzrpy.com';
  16. try {
  17. let html = request(rule.host);
  18. HOST = pdfh(html, ".box-wrap&&a&&href") || HOST;
  19. } catch (e) {
  20. log(`获取Host错误${e.message}`);
  21. }
  22. }),
  23. hikerListCol: "card_pic_1",
  24. hikerClassListCol: "card_pic_1",
  25. lazy: typeof MY_NAME !== "undefined" ? $js.toString(() => {
  26. var list = jsp.pdfa(request(input), '.dplayer');
  27. input = {
  28. parse: ""
  29. };
  30. if (list.length === '1') {
  31. let url = JSON.parse(pdfh(list[0], '.dplayer&&config')).video.url;
  32. input.url = url.startsWith("http") ? url : "https://hls.vdtuzv.com" + url;
  33. } else {
  34. var a = []
  35. list.forEach((data, id) => a.push('第' + (id + 1) + '部'))
  36. input.url = $(a, 1)
  37. .select(list => {
  38. input = input.match(/\d+/)[0] - 1
  39. return $(JSON.parse(pdfh(list[input], '.dplayer&&config'))
  40. .video.url)
  41. .lazyRule(() => input.startsWith("http") ? input : "https://hls.vdtuzv.com" + input)
  42. }, list)
  43. }
  44. }) : void 0,
  45. play_parse: true,
  46. limit: 6,
  47. proxy_rule: $js.toString(() => {
  48. //log(input);
  49. // 测试:https://www.wakatool.com/base64img
  50. if (input) {
  51. let _type = input.url.split('.').slice(-1)[0];
  52. let data = request(input.url, {toBase64: true});
  53. //log(data);
  54. let key = CryptoJS.enc.Utf8.parse("f5d965df75336270");
  55. let iv = CryptoJS.enc.Utf8.parse("97b60394abc2fbe1");
  56. let encrypted = CryptoJS.AES.decrypt({
  57. ciphertext: CryptoJS.enc.Base64.parse(data)
  58. }, key, {
  59. iv: iv,
  60. mode: CryptoJS.mode.CBC,
  61. padding: CryptoJS.pad.Pkcs7
  62. }).toString(CryptoJS.enc.Base64);
  63. let img_base64 = 'data:image/' + _type + ';base64,' + encrypted;
  64. // input = [200, 'text/plain', img_base64];
  65. // input = [302, 'text/html', '', {Location:'https://www.baidu.com'}];
  66. input = [200, 'image/' + _type, img_base64, null, 1];
  67. }
  68. }),
  69. 预处理: $js.toString(() => {
  70. rule.cate_exclude = '';
  71. }),
  72. 一级: $js.toString(() => {
  73. let d = [];
  74. let html = request(input);
  75. let list = pdfa(html, '.video-item');
  76. list.forEach(item => {
  77. var pic = pdfh(item, 'img&&onload');
  78. var url = pd(item, 'a&&href', MY_URL);
  79. var title = pdfh(item, '.title&&Text');
  80. if (title) {
  81. d.push({
  82. title: title,
  83. img: pic,
  84. desc: "0",
  85. url: url
  86. });
  87. }
  88. });
  89. setResult(d);
  90. }),
  91. //一级: '.video-item;.title&&Text;img&&onload;;a&&href',
  92. 图片替换: $js.toString(() => {
  93. if (/loadImg/.test(input)) {
  94. input = input.split("'")[1];
  95. }
  96. input = getProxyUrl() + '&url=' + input;
  97. }),
  98. 二级: "*",
  99. 搜索: $js.toString(() => {
  100. let d = [];
  101. let u = input.split("?");
  102. let h = post(u[0], {
  103. body: u[1]
  104. });
  105. let list = JSON.parse(h).data.list;
  106. list.forEach(item => {
  107. let pic = item.thumb;
  108. let url = `${rule.host}/archives/${item.id}.html`
  109. d.push({
  110. title: item.title,
  111. desc: item.created_date,
  112. img: pic,
  113. url: url
  114. });
  115. });
  116. setResult(d);
  117. })
  118. }