XZ.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. var rule = {
  2. title: '校长影视[云盘]',
  3. host: 'https://xzys.fun',
  4. homeUrl: '/',
  5. url: '/fyclass.html?page=fypage',
  6. filter_url: '{{fl.class}}',
  7. filter: {},
  8. searchUrl: '/search.html?keyword=**',
  9. searchable: 2,
  10. quickSearch: 0,
  11. filterable: 0,
  12. headers: {
  13. 'User-Agent': 'PC_UA',
  14. 'Cookie': ''
  15. },
  16. timeout: 5000,
  17. class_name: '电视剧&电影&动漫&纪录片&综艺',
  18. class_url: 'dsj&dy&dm&jlp&zy',
  19. play_parse: true,
  20. play_json: [{
  21. re: '*',
  22. json: {
  23. parse: 0,
  24. jx: 0
  25. }
  26. }],
  27. lazy: "js:\n input = 'push://' + input;\n ",
  28. limit: 6,
  29. 推荐: 'div.container div.row a:has(>img);img&&alt;img&&src;img&&alt;a&&href',
  30. 一级: 'div.container div.row div.list-boxes;img&&alt;img&&src;div.list-actions&&Text;a&&href',
  31. 二级: {
  32. title: "div.container div.row h1&&Text",
  33. img: "div.container div.row img&&src",
  34. desc: 'div.container div.row div.article-infobox&&Text', //remark
  35. content: 'div.container div.row div#info&&Text',
  36. tabs: `js:
  37. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  38. TABS=[]
  39. let d = pdfa(html, 'div.container div.row a');
  40. let tabsa = [];
  41. let tabsq = [];
  42. let tabsm = false;
  43. let tabse = false;
  44. d.forEach(function(it) {
  45. let burl = pdfh(it, 'a&&href');
  46. if (burl.startsWith("https://pan.quark.cn/s/")){
  47. tabsq.push("夸克网盘");
  48. }else if (burl.startsWith("magnet")){
  49. tabsm = true;
  50. }else if (burl.startsWith("ed2k")){
  51. tabse = true;
  52. }
  53. });
  54. if (tabsm === true){
  55. TABS.push("磁力");
  56. }
  57. if (tabse === true){
  58. TABS.push("电驴");
  59. }
  60. if (false && tabsa.length + tabsq.length > 1){
  61. TABS.push("选择右侧线路");
  62. }
  63. let tmpIndex;
  64. tmpIndex=1;
  65. tabsa.forEach(function(it){
  66. TABS.push(it + tmpIndex);
  67. tmpIndex = tmpIndex + 1;
  68. });
  69. tmpIndex=1;
  70. tabsq.forEach(function(it){
  71. TABS.push(it + tmpIndex);
  72. tmpIndex = tmpIndex + 1;
  73. });
  74. log('xzys TABS >>>>>>>>>>>>>>>>>>' + TABS);
  75. `,
  76. lists: `js:
  77. log(TABS);
  78. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  79. LISTS = [];
  80. let d = pdfa(html, 'div.container div.row a');
  81. let lista = [];
  82. let listq = [];
  83. let listm = [];
  84. let liste = [];
  85. d.forEach(function(it){
  86. let burl = pdfh(it, 'a&&href');
  87. let title = pdfh(it, 'a&&Text');
  88. log('dygang title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  89. log('dygang burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  90. let loopresult = title + '$' + burl;
  91. if (burl.startsWith("https://pan.quark.cn/s/")){
  92. if (true){
  93. if (TABS.length==1){
  94. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  95. }else{
  96. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  97. }
  98. }else{
  99. burl = "push://" + burl;
  100. }
  101. loopresult = title + '$' + burl;
  102. listq.push(loopresult);
  103. }else if (burl.startsWith("magnet")){
  104. listm.push(loopresult);
  105. }else if (burl.startsWith("ed2k")){
  106. liste.push(loopresult);
  107. }
  108. });
  109. if (listm.length>0){
  110. LISTS.push(listm);
  111. }
  112. if (liste.length>0){
  113. LISTS.push(liste);
  114. }
  115. if (false && lista.length + listq.length > 1){
  116. LISTS.push(["选择右侧线路,或3秒后自动跳过$http://127.0.0.1:10079/delay/"]);
  117. }
  118. lista.forEach(function(it){
  119. LISTS.push([it]);
  120. });
  121. listq.forEach(function(it){
  122. LISTS.push([it]);
  123. });
  124. `,
  125. },
  126. 搜索: `js:
  127. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  128. if (rule_fetch_params.headers.Cookie.startsWith("http")){
  129. rule_fetch_params.headers.Cookie=fetch(rule_fetch_params.headers.Cookie);
  130. let cookie = rule_fetch_params.headers.Cookie;
  131. setItem(RULE_CK, cookie);
  132. };
  133. log('xzys seach cookie>>>>>>>>>>>>>' + rule_fetch_params.headers.Cookie);
  134. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  135. log("xzys search params>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  136. let search_html = request( HOST + '/search.html?keyword=' + encodeURIComponent(KEY), _fetch_params)
  137. //log("xzys search result>>>>>>>>>>>>>>>" + search_html);
  138. let d=[];
  139. let dlist = pdfa(search_html, 'div.container div.row div.list-boxes');
  140. dlist.forEach(function(it){
  141. let title = pdfh(it, 'h2 a img&&alt');
  142. if (searchObj.quick === true){
  143. if (title.includes(KEY)){
  144. title = KEY;
  145. }
  146. }
  147. let img = pd(it, 'h2 a img&&src', HOST);
  148. let content = pdfh(it, 'p.text_p&&Text');
  149. let desc = pdfh(it, 'div.list-actions&&Text'); //remark
  150. let url = pd(it, 'h2 a&&href', HOST);
  151. d.push({
  152. title:title,
  153. img:img,
  154. content:content,
  155. desc:desc,
  156. url:url
  157. })
  158. });
  159. setResult(d);
  160. `,
  161. }