mp4us.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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/#nobot=1&wd=**;post',
  10. searchable:2,
  11. quickSearch:1,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': 'PC_UA',
  15. 'Referer': 'https://www.mp4us.com/',
  16. },
  17. timeout:5000,
  18. class_name: '动作片&科幻片&爱情片&喜剧片&恐怖片&战争片&剧情片&纪录片&动画片&电视剧',
  19. class_url: '1&2&3&4&5&6&7&8&9&10',
  20. play_parse:false,
  21. lazy:'',
  22. limit:6,
  23. 推荐:'div.index_update ul li;a&&Text;;b&&Text;a&&href',
  24. 一级:'div#list_all ul li;img.lazy&&alt;img.lazy&&data-original;span.update_time&&Text;a&&href',
  25. 二级:{
  26. title:"div.article-header h1&&Text",
  27. img:"div.article-header div.pic img&&src",
  28. desc:'div.article-header div.text&&Text',
  29. content:'div.article-related.info p&&Text',
  30. tabs:`js:
  31. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  32. TABS=[]
  33. var d = pdfa(html, 'ul.down-list&&li');
  34. let magnetIndex=0;
  35. let ed2kIndex=0;
  36. d.forEach(function(it) {
  37. let burl = pdfh(it, 'a&&href');
  38. log("burl >>>>>>" + burl);
  39. if (burl.startsWith("magnet")){
  40. let result = 'magnet' + magnetIndex;
  41. magnetIndex = magnetIndex + 1;
  42. TABS.push(result);
  43. }
  44. });
  45. d.forEach(function(it) {
  46. let burl = pdfh(it, 'a&&href');
  47. log("burl >>>>>>" + burl);
  48. if (burl.startsWith("ed2k")){
  49. let result = 'ed2k' + ed2kIndex;
  50. ed2kIndex = ed2kIndex + 1;
  51. TABS.push(result);
  52. }
  53. });
  54. log('TABS >>>>>>>>>>>>>>>>>>' + TABS);
  55. `,
  56. lists:`js:
  57. log(TABS);
  58. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  59. LISTS = [];
  60. var d = pdfa(html, 'ul.down-list&&li');
  61. TABS.forEach(function(tab) {
  62. log('tab >>>>>>>>' + tab);
  63. if (/^magnet/.test(tab)) {
  64. let targetindex = parseInt(tab.substring(6));
  65. let index = 0;
  66. d.forEach(function(it){
  67. let burl = pdfh(it, 'a&&href');
  68. if (burl.startsWith("magnet")){
  69. if (index == targetindex){
  70. let title = pdfh(it, 'a&&Text');
  71. log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  72. log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  73. let loopresult = title + '$' + burl;
  74. LISTS.push([loopresult]);
  75. }
  76. index = index + 1;
  77. }
  78. });
  79. }
  80. });
  81. TABS.forEach(function(tab) {
  82. log('tab >>>>>>>>' + tab);
  83. if (/^ed2k/.test(tab)) {
  84. let targetindex = parseInt(tab.substring(4));
  85. let index = 0;
  86. d.forEach(function(it){
  87. let burl = pdfh(it, 'a&&href');
  88. if (burl.startsWith("ed2k")){
  89. if (index == targetindex){
  90. let title = pdfh(it, 'a&&Text');
  91. log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  92. log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  93. let loopresult = title + '$' + burl;
  94. LISTS.push([loopresult]);
  95. }
  96. index = index + 1;
  97. }
  98. });
  99. }
  100. });
  101. `,
  102. },
  103. 搜索:'div#list_all li;img.lazy&&alt;img.lazy&&src;div.text_info h2&&Text;a&&href;p.info&&Text',
  104. 预处理:`
  105. let new_host=HOST;
  106. let new_html=request(new_host, {withHeaders:true});
  107. let json=JSON.parse(new_html);
  108. let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
  109. let cookie=setCk?json[setCk].split(";")[0]:"";
  110. log("cookie:"+cookie);
  111. rule_fetch_params.headers.Cookie=cookie;
  112. setItem(RULE_CK,cookie);
  113. `,
  114. }