meijumi.js 8.8 KB

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