meijumi.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. var rule = {
  2. title:'美剧迷[磁]',
  3. host:'https://www.meijumi.net',
  4. homeUrl:'/',
  5. url: '/fyclass/page/fypage/?',
  6. filter_url:'{{fl.class}}',
  7. filter:{
  8. },
  9. searchUrl: '/?s=**',
  10. searchable:2,
  11. quickSearch:0,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': 'PC_UA',
  15. 'Accept': '*/*',
  16. 'Referer': 'https://www.meijumi.net/'
  17. },
  18. timeout:5000,
  19. class_name:'最近更新&美剧&灵异/惊悚&魔幻/科幻&罪案/动作谍战&剧情/历史&喜剧&律政/医务&动漫/动画&纪录片&综艺/真人秀&英剧&韩剧',
  20. class_url:'news&usa&usa/xuanyi&usa/mohuan&usa/zuian&usa/qinggan&usa/xiju&usa/yiwu&usa/katong&usa/jilu&usa/zongyi&en&hanju',
  21. play_parse:true,
  22. play_json:[{
  23. re:'*',
  24. json:{
  25. parse:0,
  26. jx:0
  27. }
  28. }],
  29. lazy:'',
  30. limit:6,
  31. 推荐:'',
  32. 推荐:`js:
  33. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  34. let d = [];
  35. let html = request(input);
  36. let items;
  37. items = pdfa(html, 'main#main div.hd ul li:has(>a>img)');
  38. items.forEach(it => {
  39. d.push({
  40. title: pdfh(it, 'li&&Text'),
  41. desc: '',
  42. pic_url: pd(it, 'img&&src', HOST),
  43. url: pdfh(it, 'a&&href')
  44. });
  45. });
  46. items = pdfa(html, 'main#main div.hd div.huandeng span:has(>a>img)');
  47. if (typeof items !== "undefined") {
  48. items.forEach(it => {
  49. d.push({
  50. title: pdfh(it, 'span&&Text'),
  51. desc: '',
  52. pic_url: pd(it, 'img&&src', HOST),
  53. url: pdfh(it, 'a&&href')
  54. });
  55. });
  56. }
  57. items = pdfa(html, 'main#main div#pingbi_gg div:has(>div>a>img)');
  58. if (typeof items !== "undefined") {
  59. items.forEach(it => {
  60. d.push({
  61. title: pdfh(it, 'a&&title'),
  62. desc: pdfh(it, 'div&&span b&&Text'),
  63. pic_url: pd(it, 'img&&src', HOST),
  64. url: pdfh(it, 'a&&href')
  65. });
  66. });
  67. }
  68. items = pdfa(html, 'main#main div#pingbi_gg div:has(>header>div>a)');
  69. if (typeof items !== "undefined") {
  70. items.forEach(it => {
  71. d.push({
  72. title: pdfh(it, 'header a&&Text'),
  73. desc: pdfh(it, 'header&&div span&&Text'),
  74. pic_url: pd(it, 'figure img&&src', HOST),
  75. url: pdfh(it, 'header a&&href')
  76. });
  77. });
  78. }
  79. setResult(d);
  80. `,
  81. 一级:'',
  82. 一级:`js:
  83. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  84. let d = [];
  85. if (MY_CATE !== "news" ){
  86. let html = request(input);
  87. let list = pdfa(html, 'div#post_list_box article');
  88. list.forEach(it => {
  89. d.push({
  90. title: pdfh(it, 'header a&&Text'),
  91. desc: pdfh(it, 'div.entry-content span:eq(1)&&Text'),
  92. pic_url: pd(it, 'figure img&&src', HOST),
  93. url: pdfh(it, 'header a&&href')
  94. });
  95. })
  96. }else{
  97. input = rule.homeUrl + MY_CATE + '/';
  98. let html = request(input);
  99. let list = pdfa(html, 'article ol&&li');
  100. list.forEach(it => {
  101. d.push({
  102. title: pdfh(it, 'a&&Text'),
  103. desc: pdfh(it, 'li&&span:eq(3)&&Text') + ' / 更新' + pdfh(it, 'li&&span:eq(1)&&Text'),
  104. pic_url: '',
  105. url: pdfh(it, 'a&&href')
  106. });
  107. })
  108. }
  109. setResult(d);
  110. `,
  111. 二级:{
  112. title:"article&&header&&h1&&Text",
  113. img:"article div.single-content img&&src",
  114. desc:"article div.single-content blockquote&&Text",
  115. content:"article div.single-content table&&Text",
  116. tabs:`js:
  117. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  118. TABS=[]
  119. let playGroups = [];
  120. let d = pdfa(html, 'article div.single-content&&p:has(>a)');
  121. d.forEach(function(it) {
  122. let playObj = {"ali":{},"quark":{},"magnet":{}};
  123. let playUrls = pdfa(it, 'a');
  124. let title="";
  125. playUrls.forEach(function(playUrl) {
  126. let purl = pdfh(playUrl, 'a&&href');
  127. if (true || title === ""){
  128. title = pdfh(playUrl, 'a&&Text');
  129. }
  130. if (purl.startsWith("magnet")){
  131. let magfn = title;
  132. try {
  133. magfn = purl.match(/(^|&)dn=([^&]*)(&|$)/)[2];
  134. }catch(e){
  135. magfn = title;
  136. }
  137. let resolution = "unknown";
  138. try {
  139. resolution = magfn.match(/(1080|720|2160|4k|4K)/)[1];
  140. }catch(e){
  141. resolution = "unknown";
  142. }
  143. magfn = resolution + "." + magfn;
  144. log("tabs magnet filename>>>>>>>>>>>" + magfn);
  145. playObj["magnet"][purl]=magfn;
  146. }else if (purl.startsWith("https://www.aliyundrive.com/s/")){
  147. playObj["ali"][purl]=title;
  148. }else if (purl.startsWith("https://pan.quark.cn/s/")){
  149. playObj["quark"][purl]=title;
  150. }
  151. });
  152. playGroups.push(playObj);
  153. });
  154. LISTS.push(playGroups);
  155. let groupIndex = 1;
  156. let haveDelay = false;
  157. playGroups.forEach(function (it) {
  158. let magCount = Object.keys(it["magnet"]).length;
  159. let aliCount = Object.keys(it["ali"]).length;
  160. let quarkCount = Object.keys(it["quark"]).length;
  161. let haveMag = false;
  162. if (magCount==0 && aliCount!==1 && quarkCount!==1 ){
  163. }else{
  164. if (magCount>0){
  165. TABS.push("磁力" + groupIndex);
  166. haveMag= true;
  167. haveDelay = true;
  168. }
  169. if (aliCount === 1){
  170. if (!haveMag && !haveDelay){
  171. haveDelay = true;
  172. TABS.push("選擇右側綫路");
  173. }
  174. TABS.push("阿里雲盤" + groupIndex);
  175. }
  176. if (quarkCount === 1){
  177. if (!haveMag && !haveDelay){
  178. haveDelay = true;
  179. TABS.push("選擇右側綫路");
  180. }
  181. TABS.push("夸克雲盤" + groupIndex);
  182. }
  183. groupIndex = groupIndex + 1;
  184. }
  185. });
  186. log('meijumi TABS >>>>>>>>>>>>>>>>>>' + TABS);
  187. `,
  188. lists:`js:
  189. log(TABS);
  190. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  191. let playGroups = [];
  192. if (false && LISTS.length>0 && typeof LISTS[0] === "object"){
  193. playGroups = LISTS.shift();
  194. }else{
  195. let d = pdfa(html, 'article div.single-content&&p:has(>a)');
  196. d.forEach(function(it) {
  197. let playObj = {"ali":{},"quark":{},"magnet":{}};
  198. let playUrls = pdfa(it, 'a');
  199. let title="";
  200. playUrls.forEach(function(playUrl) {
  201. let purl = pdfh(playUrl, 'a&&href');
  202. if (true || title === ""){
  203. title = pdfh(playUrl, 'a&&Text');
  204. }
  205. if (purl.startsWith("magnet")){
  206. let magfn = title;
  207. try {
  208. magfn = purl.match(/(^|&)dn=([^&]*)(&|$)/)[2];
  209. }catch(e){
  210. magfn = title;
  211. }
  212. let resolution = "unknown";
  213. try {
  214. resolution = magfn.match(/(1080|720|2160|4k|4K)/)[1];
  215. }catch(e){
  216. resolution = "unknown";
  217. }
  218. magfn = resolution + "." + magfn;
  219. log("tabs magnet filename>>>>>>>>>>>" + magfn);
  220. playObj["magnet"][purl]=magfn;
  221. }else if (purl.startsWith("https://www.aliyundrive.com/s/")){
  222. playObj["ali"][purl]=title;
  223. }else if (purl.startsWith("https://pan.quark.cn/s/")){
  224. playObj["quark"][purl]=title;
  225. }
  226. });
  227. playGroups.push(playObj);
  228. });
  229. }
  230. LISTS = [];
  231. let haveDelay = false;
  232. playGroups.forEach(function(it){
  233. let haveMag = false;
  234. if (Object.keys(it["magnet"]).length>0){
  235. haveMag = true;
  236. haveDelay = true;
  237. let d = [];
  238. for(const key in it["magnet"]){
  239. if (it["magnet"].hasOwnProperty(key)){
  240. let title = it["magnet"][key];
  241. let burl = key;
  242. log('meijumi magnet title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  243. log('meijumi magnet burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  244. d.push(title + '$' + burl);
  245. }
  246. }
  247. d.sort();
  248. let newd = [];
  249. d.forEach(it=>{
  250. newd.push(it.substring(it.indexOf(".")+1));
  251. });
  252. LISTS.push(newd);
  253. }
  254. if (Object.keys(it["ali"]).length==1){
  255. if (!haveMag && !haveDelay){
  256. haveDelay = true;
  257. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  258. }
  259. let d = [];
  260. for(const key in it["ali"]){
  261. if (it["ali"].hasOwnProperty(key)){
  262. let title = it["ali"][key];
  263. //let burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(key);
  264. let burl = "push://" + key;
  265. log('meijumi ali title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  266. log('meijumi ali burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  267. d.push(title + '$' + burl);
  268. }
  269. }
  270. LISTS.push(d);
  271. }
  272. if (Object.keys(it["quark"]).length==1){
  273. if (!haveMag && !haveDelay){
  274. haveDelay = true;
  275. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  276. }
  277. let d = [];
  278. for(const key in it["quark"]){
  279. if (it["quark"].hasOwnProperty(key)){
  280. let title = it["quark"][key];
  281. //let burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(key);
  282. let burl = "push://" + key;
  283. log('meijumi quark title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  284. log('meijumi quark burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  285. d.push(title + '$' + burl);
  286. }
  287. }
  288. LISTS.push(d);
  289. }
  290. });
  291. `,
  292. },
  293. 搜索:'ul.search-page article;h2&&Text;a img&&src;div.entry-content span:eq(1)&&Text;a&&href;div.entry-content div.archive-content&&Text',
  294. }