aipanso.js 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. var rule = {
  2. title:'爱盘搜[夸]',
  3. host:'https://aipanso.com',
  4. homeUrl:'/',
  5. url: '/forum-fyclass-fypage.html?',
  6. filter_url:'{{fl.class}}',
  7. filter:{
  8. },
  9. searchUrl: '/search?page=fypage&s=1&t=-1&k=**',
  10. searchable:2,
  11. quickSearch:0,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': PC_UA,
  15. 'Accept': '*/*',
  16. 'Referer': 'https://aipanso.com/'
  17. },
  18. timeout:5000,
  19. class_name:'',
  20. class_url:'',
  21. play_parse:true,
  22. play_json:[{
  23. re:'*',
  24. json:{
  25. parse:0,
  26. jx:0
  27. }
  28. }],
  29. lazy:'',
  30. limit:6,
  31. 推荐:'',
  32. 一级:'',
  33. 二级:{
  34. title:"van-row h3&&Text",
  35. img:"",
  36. desc:"van-row h3&&Text",
  37. content:"van-row h3&&Text",
  38. tabs:`js:
  39. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  40. TABS=[]
  41. TABS.push("夸克網盤");
  42. log('meijumi TABS >>>>>>>>>>>>>>>>>>' + TABS);
  43. `,
  44. lists:`js:
  45. log(TABS);
  46. LISTS=[];
  47. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  48. let requestHeaders = {
  49. withHeaders: true,
  50. redirect: 0,
  51. headers:{
  52. Referer: MY_URL
  53. }
  54. };
  55. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  56. Object.assign(_fetch_params, requestHeaders);
  57. let new_html = request ( MY_URL.replace("/s/","/cv/"), _fetch_params);
  58. let json=JSON.parse(new_html);
  59. let redirectUrl = "";
  60. if (json.hasOwnProperty("Location")){
  61. redirectUrl = json["Location"];
  62. }else if (json.hasOwnProperty("location")){
  63. redirectUrl = json["location"];
  64. }
  65. let title = pdfh(html, 'van-row h3&&Text');
  66. LISTS.push([title + '$' + 'push://' + redirectUrl]);
  67. `,
  68. },
  69. 搜索:`js:
  70. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  71. log("aipanso enter search >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + KEY);
  72. let withHeaders = {
  73. withHeaders: true
  74. };
  75. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  76. Object.assign(_fetch_params, withHeaders);
  77. log('aipanso search params >>>>>>>>>>>>>>>>>>>>>' + JSON.stringify(_fetch_params));
  78. let new_html=request(rule.homeUrl + 'search?page=' + MY_PAGE + '&s=1&t=-1&k=' + encodeURIComponent(KEY) , _fetch_params);
  79. //log('aipanso search new_html >>>>>>>>>>>>>>>>>>>>>' + new_html);
  80. let json=JSON.parse(new_html);
  81. let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
  82. let cookie="";
  83. if (typeof setCk !== "undefined"){
  84. let d=[];
  85. for(const key in json[setCk]){
  86. if (typeof json[setCk][key] === "string"){
  87. log("aipanso header setCk key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + json[setCk][key] + " " + (typeof json[setCk][key]));
  88. d.push(json[setCk][key].split(";")[0]);
  89. }
  90. }
  91. cookie=d.join(";");
  92. setItem(RULE_CK, cookie);
  93. fetch_params.headers.Cookie=cookie;
  94. rule_fetch_params.headers.Cookie=cookie;
  95. }
  96. log('aipanso search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
  97. //log('aipanso search body >>>>>>>>>>>>>>>>>>>>>' + json['body'].substring(4096));
  98. new_html = json['body'];
  99. let d=[];
  100. let dlist = pdfa(new_html, 'van-row:has(>a[href^="/s/"])');
  101. dlist.forEach(function(it){
  102. let title = pdfh(it, 'van-card template&&Text');
  103. if (title.includes(KEY)){
  104. if (searchObj.quick === true){
  105. title = KEY;
  106. }
  107. let img = pd(it, 'van-card&&thumb', HOST);
  108. let content = pdfh(it, 'van-card template:eq(1)&&Text');
  109. let desc = pdfh(it, 'van-card template:eq(1)&&Text');
  110. let url = pd(it, 'a&&href', HOST);
  111. d.push({
  112. title:title,
  113. img:img,
  114. content:content,
  115. desc:desc,
  116. url:url
  117. })
  118. }
  119. });
  120. setResult(d);
  121. `,
  122. }