mp4us.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. var rule = {
  2. title:'MP4电影[磁]',
  3. host:'https://www.mp4us.com',
  4. homeUrl: '/',
  5. url: '/list/fyclass-fypage.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. 'Cookie':''
  16. },
  17. timeout:5000,
  18. class_name: '动作片&科幻片&爱情片&喜剧片&恐怖片&战争片&剧情片&纪录片&动画片&电视剧',
  19. class_url: '1&2&3&4&5&6&7&8&9&10',
  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. 推荐:'div.index_update ul li;a&&Text;;b&&Text;a&&href',
  31. 一级:'div#list_all ul li;img.lazy&&alt;img.lazy&&data-original;span.update_time&&Text;a&&href',
  32. 二级:{
  33. title:"div.article-header h1&&Text",
  34. img:"div.article-header div.pic img&&src",
  35. desc:'div.article-header div.text&&Text',
  36. content:'div.article-related.info p&&Text',
  37. tabs:`js:
  38. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  39. TABS=[]
  40. let d = pdfa(html, 'ul.down-list&&li 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('mp4us 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, 'ul.down-list&&li 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('dygang title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  92. log('dygang 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.reverse());
  126. }
  127. if (liste.length>0){
  128. LISTS.push(liste.reverse());
  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('mp4us seach cookie>>>>>>>>>>>>>' + rule_fetch_params.headers.Cookie);
  149. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  150. //log("mp4us search params>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  151. let search_html = request( HOST + '/search/' + encodeURIComponent(KEY) + '-1.html', _fetch_params)
  152. //log("mp4us search result>>>>>>>>>>>>>>>" + search_html);
  153. let d=[];
  154. //'div#list_all li;img.lazy&&alt;img.lazy&&src;div.text_info h2&&Text;a&&href;p.info&&Text',
  155. let dlist = pdfa(search_html, 'div#list_all li');
  156. dlist.forEach(function(it){
  157. let title = pdfh(it, 'img.lazy&&alt');
  158. if (title.includes(KEY)){
  159. if (searchObj.quick === true){
  160. title = KEY;
  161. }
  162. let img = pd(it, 'img.lazy&&src', HOST);
  163. let content = pdfh(it, 'div.text_info h2&&Text');
  164. let desc = pdfh(it, 'p.info&&Text');
  165. let url = pd(it, 'a&&href', HOST);
  166. d.push({
  167. title:title,
  168. img:img,
  169. content:content,
  170. desc:desc,
  171. url:url
  172. })
  173. }
  174. });
  175. setResult(d);
  176. `,
  177. }