kuba.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. var rule = {
  2. title:'酷吧[磁]',
  3. host:'https://www.kuba222.com',
  4. homeUrl: '/',
  5. url: '/vodtypehtml/fyclass.html?',
  6. filter_url:'{{fl.class}}',
  7. filter:{
  8. },
  9. searchUrl: '/search/**-1.html',
  10. searchable:2,
  11. quickSearch:0,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': 'PC_UA',
  15. 'Referer': 'https://www.kuba222.com/'
  16. },
  17. timeout:5000,
  18. class_name: '最新&4K&电影&动作片&喜剧片&爱情片&科幻片&恐怖片&剧情片&战争片&微电影&电视剧&动漫&纪录片',
  19. class_url: 'new&4K&1&5&6&7&8&9&10&11&21&31&4&16',
  20. play_parse:true,
  21. play_json:[{
  22. re:'*',
  23. json:{
  24. parse:0,
  25. jx:0
  26. }
  27. }],
  28. lazy:'',
  29. limit:6,
  30. 推荐:`js:
  31. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  32. let d = [];
  33. let html = request(input);
  34. let list = pdfa(html, 'ul.stui-vodlist li');
  35. list.forEach(function (it){
  36. d.push({
  37. title: pdfh(it, 'a&&title'),
  38. desc: pdfh(it, 'li&&div&&a&&span&&Text'),
  39. pic_url: pd(it, 'a&&data-original', HOST),
  40. url: pdfh(it, 'a&&href')
  41. });
  42. });
  43. setResult(d);
  44. `,
  45. 一级:`js:
  46. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  47. let d = [];
  48. if (MY_CATE === '4K'){
  49. let turl = (MY_PAGE === 1)? '' : '-' + MY_PAGE;
  50. input = rule.homeUrl + 'vodtopichtml/' + '11' + turl + '.html';
  51. }else if (MY_CATE === 'new'){
  52. input = rule.homeUrl + MY_CATE + '.html';
  53. }else{
  54. let turl = (MY_PAGE === 1)? '' : '-' + MY_PAGE;
  55. input = rule.homeUrl + 'vodtypehtml/' + MY_CATE + turl + '.html';
  56. }
  57. let html = request(input);
  58. let list = pdfa(html, 'ul.stui-vodlist li');
  59. list.forEach(function (it){
  60. d.push({
  61. title: pdfh(it, 'a&&title'),
  62. desc: pdfh(it, 'li&&div&&a&&span&&Text'),
  63. pic_url: pd(it, 'a&&data-original', HOST),
  64. url: pdfh(it, 'a&&href')
  65. });
  66. });
  67. setResult(d);
  68. `,
  69. 二级:{
  70. title:"div.stui-content h3&&Text",
  71. img:"div.stui-content a.lazyload img&&src",
  72. desc:'div.stui-content a span&&Text',
  73. content:'div.stui-content p.data&&Text',
  74. tabs:`js:
  75. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  76. TABS=[]
  77. let vodUrls=[];
  78. try{
  79. vodUrls.push(html.match(/var GvodUrls1 *= *"([^"]*)"/)[1]);
  80. vodUrls.push(html.match(/var GvodUrls2 *= *"([^"]*)"/)[1]);
  81. vodUrls.push(html.match(/var GvodUrls3 *= *"([^"]*)"/)[1]);
  82. vodUrls.push(html.match(/var GvodUrls4 *= *"([^"]*)"/)[1]);
  83. vodUrls.push(html.match(/var GvodUrls5 *= *"([^"]*)"/)[1]);
  84. }catch(e){
  85. }
  86. let index=1;
  87. vodUrls.forEach(function (it) {
  88. TABS.push("磁力"+index);
  89. index = index + 1;
  90. });
  91. log('kuba TABS >>>>>>>>>>>>>>>>>>' + TABS);
  92. `,
  93. lists:`js:
  94. log(TABS);
  95. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  96. LISTS = [];
  97. let vodUrls=[];
  98. //log("kuba html>>>>>>>>>>>>>>>>>>>>>>" + html);
  99. try{
  100. vodUrls.push(html.match(/var GvodUrls1 *= *"([^"]*)"/)[1]);
  101. vodUrls.push(html.match(/var GvodUrls2 *= *"([^"]*)"/)[1]);
  102. vodUrls.push(html.match(/var GvodUrls3 *= *"([^"]*)"/)[1]);
  103. vodUrls.push(html.match(/var GvodUrls4 *= *"([^"]*)"/)[1]);
  104. vodUrls.push(html.match(/var GvodUrls5 *= *"([^"]*)"/)[1]);
  105. }catch(e){
  106. log('kuba tabs e>>>>>>>>>>>>>>>>>>..' + e);
  107. }
  108. vodUrls.forEach(function (it) {
  109. let epos = it.split("###");
  110. let d=[];
  111. epos.forEach(function (it1){
  112. if (it1.length>0){
  113. d.push(it1);
  114. }
  115. });
  116. LISTS.push(d.reverse());
  117. });
  118. `,
  119. },
  120. 搜索:`js:
  121. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  122. let cookie="";
  123. if (false){
  124. let new_html=request(HOST, {withHeaders:true});
  125. let json=JSON.parse(new_html);
  126. let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
  127. if (typeof setCk !== "undefined"){
  128. let d=[];
  129. for(const key in json[setCk]){
  130. if (typeof json[setCk][key] === "string"){
  131. log("kuba header setCk key>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + json[setCk][key] + " " + (typeof json[setCk][key]));
  132. d.push(json[setCk][key].split(";")[0]);
  133. }
  134. }
  135. cookie=d.join(";");
  136. }
  137. fetch_params.headers.Cookie=cookie;
  138. rule_fetch_params.headers.Cookie=cookie;
  139. }
  140. log('kuba search cookie >>>>>>>>>>>>>>>>>>>>>' + cookie);
  141. let params = 'wd='+ encodeURIComponent(KEY) + '&submit=';
  142. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  143. let postData = {
  144. body: params
  145. };
  146. Object.assign(_fetch_params, postData);
  147. log("kuba search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  148. let search_html = post( HOST + '/index.php?m=vod-search', _fetch_params)
  149. search_html = search_html.replace(/<script>.*?<\\/script>/g,"");
  150. //log("kuba search result>>>>>>>>>>>>>>>" + search_html.substring(4096));
  151. let d=[];
  152. let dlist = pdfa(search_html, 'li.activeclearfix');
  153. log("kuba search dlist.length>>>>>>>>>>>>>" + dlist.length);
  154. dlist.forEach(function(it){
  155. let title = pdfh(it, 'a&&title');
  156. let img = pd(it, 'a&&data-original', HOST);
  157. let content = pdfh(it, 'a&&Text');
  158. let desc = pdfh(it, 'div.detail&&Text');
  159. let url = pd(it, 'a&&href', HOST);
  160. d.push({
  161. title:title,
  162. img:img,
  163. content:content,
  164. desc:desc,
  165. url:url
  166. });
  167. });
  168. dlist = pdfa(search_html, 'li.active.clearfix');
  169. log("kuba search dlist.length>>>>>>>>>>>>>" + dlist.length);
  170. dlist.forEach(function(it){
  171. let title = pdfh(it, 'a&&title');
  172. let img = pd(it, 'a&&data-original', HOST);
  173. let content = pdfh(it, 'a&&Text');
  174. let desc = pdfh(it, 'div.detail&&Text');
  175. let url = pd(it, 'a&&href', HOST);
  176. d.push({
  177. title:title,
  178. img:img,
  179. content:content,
  180. desc:desc,
  181. url:url
  182. });
  183. });
  184. setResult(d);
  185. `,
  186. }