kkpans.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. var rule = {
  2. title:'KK網盤[磁]',
  3. host:'https://www.kkpans.com',
  4. homeUrl:'/',
  5. url: '/forum-fyclass-fypage.html?',
  6. //host:'http://192.168.101.1:10078',
  7. //homeUrl:'/p/0/s/https://www.kkpans.com/',
  8. //url: '/p/0/s/https://www.kkpans.com/forum-fyclass-fypage.html?',
  9. filter_url:'{{fl.class}}',
  10. filter:{
  11. },
  12. searchUrl: '/search',
  13. searchable:2,
  14. quickSearch:0,
  15. filterable:0,
  16. headers:{
  17. 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; SM-G981B) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.162 Mobile Safari/537.36',
  18. 'Accept': '*/*',
  19. 'Referer': 'https://www.kkpans.com/'
  20. },
  21. timeout:5000,
  22. class_name:'国外电影&国外电视剧&纪录片资源&综艺资源&动漫资源&音乐资源',
  23. class_url:'39&40&41&42&46&43',
  24. play_parse:true,
  25. play_json:[{
  26. re:'*',
  27. json:{
  28. parse:0,
  29. jx:0
  30. }
  31. }],
  32. lazy:'',
  33. limit:6,
  34. 推荐:'',
  35. 一级:'',
  36. 一级:`js:
  37. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  38. let d = [];
  39. log("kkpans input>>>>>>>>>>>>>>"+input);
  40. let html = request(input);
  41. //log("kkpans 1level html>>>>>>>>>>>>>>"+html);
  42. let list = pdfa(html, 'div.threadlist ul li.list');
  43. list.forEach(function(it) {
  44. d.push({
  45. title: pdfh(it, 'div.threadlist_tit&&Text'),
  46. desc: pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text'),
  47. pic_url: '',
  48. url: pd(it, 'li.list&&a[href^="forum.php"]:eq(1)&&href', HOST)
  49. });
  50. })
  51. setResult(d);
  52. `,
  53. 二级:{
  54. title:"div.viewthread&&div.view_tit&&Text",
  55. img:"div.viewthread div.message&&img&&src",
  56. desc:"div.viewthread div.message&&Text",
  57. content:"div.viewthread div.message&&Text",
  58. tabs:`js:
  59. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  60. TABS=[]
  61. let d = pdfa(html, 'div.viewthread div.message a[href^="https://pan.quark.cn/s/"]');
  62. let index = 1;
  63. if (d.length>1){
  64. TABS.push("選擇右側綫路");
  65. }
  66. d.forEach(function(it) {
  67. TABS.push("夸克雲盤" + index);
  68. index = index + 1;
  69. });
  70. log('meijumi TABS >>>>>>>>>>>>>>>>>>' + TABS);
  71. `,
  72. lists:`js:
  73. log(TABS);
  74. LISTS=[];
  75. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  76. let d = pdfa(html, 'div.viewthread div.message a[href^="https://pan.quark.cn/s/"]');
  77. let index = 1;
  78. if (d.length>1){
  79. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  80. }
  81. d.forEach(function(it) {
  82. let burl = pdfh(it, 'a&&href');
  83. if (false){
  84. if (d.length==1){
  85. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  86. }else{
  87. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  88. }
  89. }else{
  90. burl = "push://" + burl;
  91. }
  92. let title = pdfh(it, 'a&&Text');
  93. LISTS.push([title + '$' + burl]);
  94. });
  95. `,
  96. },
  97. 搜索:`js:
  98. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  99. let withHeaders = {
  100. withHeaders: true
  101. };
  102. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  103. Object.assign(_fetch_params, withHeaders);
  104. let new_html=request(rule.homeUrl + 'search.php?mod=forum', _fetch_params);
  105. log('kkpans search new_html >>>>>>>>>>>>>>>>>>>>>' + new_html);
  106. let json=JSON.parse(new_html);
  107. let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
  108. let cookie="";
  109. if (typeof setCk !== "undefined"){
  110. let d=[];
  111. for(const key in json[setCk]){
  112. if (typeof json[setCk][key] === "string"){
  113. log("kkpans header setCk key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + json[setCk][key] + " " + (typeof json[setCk][key]));
  114. d.push(json[setCk][key].split(";")[0]);
  115. }
  116. }
  117. cookie=d.join(";");
  118. }
  119. fetch_params.headers.Cookie=cookie;
  120. rule_fetch_params.headers.Cookie=cookie;
  121. log('kkpans search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
  122. //log('kkpans search body >>>>>>>>>>>>>>>>>>>>>' + json['body']);
  123. new_html = json['body'];
  124. let formhash = pdfh(new_html, 'input[name="formhash"]&&value');
  125. log("kkpans formhash>>>>>>>>>>>>>>>" + formhash);
  126. let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
  127. _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  128. let postData = {
  129. body: params
  130. };
  131. Object.assign(_fetch_params, postData);
  132. log("kkpans search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  133. let search_html = post(rule.homeUrl + 'search.php?mod=forum', _fetch_params)
  134. //log("kkpans search result>>>>>>>>>>>>>>>" + search_html);
  135. let d=[];
  136. let dlist = pdfa(search_html, 'div.threadlist ul li.list');
  137. dlist.forEach(function(it){
  138. let title = pdfh(it, 'div.threadlist_tit&&Text');
  139. if (searchObj.quick === true){
  140. if (title.includes(KEY)){
  141. title = KEY;
  142. }
  143. }
  144. let img = "";
  145. let content = pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text');
  146. let desc = pdfh(it, 'div.threadlist_top div:has(>h3) span&&Text');
  147. let url = pd(it, 'a[href^="forum.php?mod=viewthread"]&&href', HOST);
  148. d.push({
  149. title:title,
  150. img:img,
  151. content:content,
  152. desc:desc,
  153. url:url
  154. })
  155. });
  156. setResult(d);
  157. `,
  158. }