4khdr.js 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. var rule = {
  2. title:'4KHDR[磁]',
  3. host:'https://www.4khdr.cn',
  4. homeUrl: "/forum.php?mod=forumdisplay&fid=2&page=1",
  5. url: '/forum.php?mod=forumdisplay&fid=2&filter=typeid&typeid=fyclass&page=fypage',
  6. filter_url:'{{fl.class}}',
  7. filter:{
  8. },
  9. searchUrl: '/search.php#searchsubmit=yes&srchtxt=**;post',
  10. searchable:2,
  11. quickSearch:1,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': 'PC_UA',
  15. 'Cookie':'http://127.0.0.1:9978/file:///tvbox/JS/lib/4khdr.txt',
  16. },
  17. timeout:5000,
  18. class_name: "4K电影&4K美剧&4K华语&4K动画&4K纪录片&4K日韩印&蓝光电影&蓝光美剧&蓝光华语&蓝光动画&蓝光日韩印",
  19. class_url:"3&8&15&6&11&4&29&31&33&32&34",
  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. 推荐:'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
  31. 一级:'ul#waterfall li;a&&title;img&&src;div.auth.cl&&Text;a&&href',
  32. 二级:{
  33. title:"#thead_subject&&Text",
  34. img:"img.zoom&&src",
  35. desc:'td[id^="postmessage_"] font&&Text',
  36. content:'td[id^="postmessage_"] font&&Text',
  37. tabs:`js:
  38. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  39. TABS=[]
  40. let d = pdfa(html, 'div.pcb table.t_table a');
  41. let tabsa = [];
  42. let tabsq = [];
  43. let tabsm = false;
  44. let tabse = false;
  45. d.forEach(function(it) {
  46. let burl = pdfh(it, 'a&&href');
  47. if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
  48. tabsa.push("阿里雲盤");
  49. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  50. tabsq.push("夸克網盤");
  51. }else if (burl.startsWith("magnet")){
  52. tabsm = true;
  53. }else if (burl.startsWith("ed2k")){
  54. tabse = true;
  55. }
  56. });
  57. if (tabsm === true){
  58. TABS.push("磁力");
  59. }
  60. if (tabse === true){
  61. TABS.push("電驢");
  62. }
  63. if (false && tabsa.length + tabsq.length > 1){
  64. TABS.push("選擇右側綫路");
  65. }
  66. let tmpIndex;
  67. tmpIndex=1;
  68. tabsa.forEach(function(it){
  69. TABS.push(it + tmpIndex);
  70. tmpIndex = tmpIndex + 1;
  71. });
  72. tmpIndex=1;
  73. tabsq.forEach(function(it){
  74. TABS.push(it + tmpIndex);
  75. tmpIndex = tmpIndex + 1;
  76. });
  77. log('4khdr TABS >>>>>>>>>>>>>>>>>>' + TABS);
  78. `,
  79. lists:`js:
  80. log(TABS);
  81. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  82. LISTS = [];
  83. let d = pdfa(html, 'div.pcb table.t_table a');
  84. let lista = [];
  85. let listq = [];
  86. let listm = [];
  87. let liste = [];
  88. d.forEach(function(it){
  89. let burl = pdfh(it, 'a&&href');
  90. let title = pdfh(it, 'a&&Text');
  91. log('4khdr title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  92. log('4khdr burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  93. let loopresult = title + '$' + burl;
  94. if (burl.startsWith("https://www.aliyundrive.com/s/") || burl.startsWith("https://www.alipan.com/s/")){
  95. if (true){
  96. if (TABS.length==1){
  97. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&confirm=0&url=" + encodeURIComponent(burl);
  98. }else{
  99. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl);
  100. }
  101. }else{
  102. burl = 'push://' + burl;
  103. }
  104. loopresult = title + '$' + burl;
  105. lista.push(loopresult);
  106. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  107. if (true){
  108. if (TABS.length==1){
  109. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  110. }else{
  111. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  112. }
  113. }else{
  114. burl = 'push://' + burl;
  115. }
  116. loopresult = title + '$' + burl;
  117. listq.push(loopresult);
  118. }else if (burl.startsWith("magnet")){
  119. listm.push(loopresult);
  120. }else if (burl.startsWith("ed2k")){
  121. liste.push(loopresult);
  122. }
  123. });
  124. if (listm.length>0){
  125. LISTS.push(listm);
  126. }
  127. if (liste.length>0){
  128. LISTS.push(liste);
  129. }
  130. if (false && lista.length + listq.length > 1){
  131. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  132. }
  133. lista.forEach(function(it){
  134. LISTS.push([it]);
  135. });
  136. listq.forEach(function(it){
  137. LISTS.push([it]);
  138. });
  139. `,
  140. },
  141. 搜索:`js:
  142. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  143. if (rule_fetch_params.headers.Cookie.startsWith("http")){
  144. rule_fetch_params.headers.Cookie=fetch(rule_fetch_params.headers.Cookie);
  145. let cookie = rule_fetch_params.headers.Cookie;
  146. setItem(RULE_CK, cookie);
  147. };
  148. log('4khdr search cookie>>>>>>>>>>>>>>>' + rule_fetch_params.headers.Cookie);
  149. let new_host= HOST + '/search.php';
  150. let new_html=request(new_host);
  151. let formhash = pdfh(new_html, 'input[name="formhash"]&&value');
  152. log("4khdr formhash>>>>>>>>>>>>>>>" + formhash);
  153. let params = 'formhash=' + formhash + '&searchsubmit=yes&srchtxt=' + encodeURIComponent(KEY);
  154. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  155. let postData = {
  156. body: params
  157. };
  158. Object.assign(_fetch_params, postData);
  159. log("4khdr search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  160. let search_html = post( HOST + '/search.php?mod=forum', _fetch_params)
  161. //log("4khdr search result>>>>>>>>>>>>>>>" + search_html);
  162. let d=[];
  163. let dlist = pdfa(search_html, 'div#threadlist ul li');
  164. dlist.forEach(function(it){
  165. let title = pdfh(it, 'h3&&Text');
  166. if (searchObj.quick === true){
  167. if (title.includes(KEY)){
  168. title = KEY;
  169. }
  170. }
  171. let img = "";
  172. let content = pdfh(it, 'p:eq(2)&&Text');
  173. let desc = pdfh(it, 'p:eq(3)&&Text');
  174. let url = pd(it, 'a&&href', HOST);
  175. d.push({
  176. title:title,
  177. img:img,
  178. content:content,
  179. desc:desc,
  180. url:url
  181. })
  182. });
  183. setResult(d);
  184. `,
  185. }