xb6v.js 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. var rule = {
  2. title:'新版6V[磁]',
  3. host:'http://www.xb6v.com',
  4. homeUrl:'/',
  5. url: '/fyclass/index_fypage.html?',
  6. filter_url:'{{fl.class}}',
  7. filter:{
  8. },
  9. searchUrl: '/e/search/index.php#tempid=1&tbname=article&mid=1&dopost=search&submit=&keyborad=**;post',
  10. searchable:2,
  11. quickSearch:0,
  12. filterable:0,
  13. headers:{
  14. 'User-Agent': 'PC_UA',
  15. 'Referer': 'http://www.xb6v.com/'
  16. },
  17. timeout:5000,
  18. class_name:'最新50部&喜剧片&动作片&爱情片&科幻片&恐怖片&剧情片&战争片&纪录片&动画片&电视剧&综艺',
  19. class_url:'qian50m.html&xijupian&dongzuopian&aiqingpian&kehuanpian&kongbupian&juqingpian&zhanzhengpian&jilupian&donghuapian&dianshiju&ZongYi',
  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. 推荐:'',
  31. 推荐:`js:
  32. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  33. let d = [];
  34. let html = request(input);
  35. let list = pdfa(html, 'div.mainleft ul#post_container li');
  36. list.forEach(it => {
  37. d.push({
  38. title: pdfh(it, 'div.thumbnail img&&alt'),
  39. desc: pdfh(it, 'div.info&&span.info_date&&Text') + ' / ' + pdfh(it, 'div.info&&span.info_category&&Text'),
  40. pic_url: pd(it, 'div.thumbnail img&&src', HOST),
  41. url: pdfh(it, 'div.thumbnail&&a&&href')
  42. });
  43. });
  44. setResult(d);
  45. `,
  46. 一级:'',
  47. 一级:`js:
  48. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  49. let d = [];
  50. if (MY_CATE !== 'qian50m.html') {
  51. let turl = (MY_PAGE === 1)? '/' : '/index_'+ MY_PAGE + '.html';
  52. input = rule.homeUrl + MY_CATE + turl;
  53. let html = request(input);
  54. let list = pdfa(html, 'div.mainleft ul#post_container li');
  55. list.forEach(it => {
  56. d.push({
  57. title: pdfh(it, 'div.thumbnail img&&alt'),
  58. desc: pdfh(it, 'div.info&&span.info_date&&Text') + ' / ' + pdfh(it, 'div.info&&span.info_category&&Text'),
  59. pic_url: pd(it, 'div.thumbnail img&&src', HOST),
  60. url: pdfh(it, 'div.thumbnail&&a&&href')
  61. });
  62. })
  63. }else{
  64. input = rule.homeUrl + MY_CATE;
  65. let html = request(input);
  66. let list = pdfa(html, 'div.container div#tab-content&&ul&&li');
  67. list.forEach(it => {
  68. let title = pdfh(it, 'a&&Text');
  69. if (title!==""){
  70. d.push({
  71. title: title,
  72. desc: pdfh(it, 'a&&Text'),
  73. pic_url: '',
  74. url: pdfh(it, 'a&&href')
  75. });
  76. }
  77. })
  78. }
  79. setResult(d);
  80. `,
  81. 二级:{
  82. title:"div.article_container h1&&Text",
  83. img:"div#post_content img&&src",
  84. desc:"div#post_content&&Text",
  85. content:"div#post_content&&Text",
  86. tabs:`js:
  87. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  88. TABS=[]
  89. let d = pdfa(html, 'div#post_content table tbody tr a');
  90. let tabsa = [];
  91. let tabsq = [];
  92. let tabsm = false;
  93. let tabse = false;
  94. let tabm3u8 = [];
  95. d.forEach(function(it) {
  96. let burl = pdfh(it, 'a&&href');
  97. if (burl.startsWith("https://www.aliyundrive.com/s/")){
  98. tabsa.push("阿里云盤");
  99. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  100. tabsq.push("夸克云盤");
  101. }else if (burl.startsWith("magnet")){
  102. tabsm = true;
  103. }else if (burl.startsWith("ed2k")){
  104. tabse = true;
  105. }
  106. });
  107. if (false){
  108. d = pdfa(html, 'div:has(>div#post_content) div.widget:has(>h3)');
  109. d.forEach(function(it) {
  110. tabm3u8.push(pdfh(it, 'h3&&Text'));
  111. });
  112. }
  113. if (tabsm === true){
  114. TABS.push("磁力");
  115. }
  116. if (tabse === true){
  117. TABS.push("電驢");
  118. }
  119. if (tabsa.length + tabsq.length > 1){
  120. TABS.push("選擇右側綫路");
  121. }
  122. let tmpIndex;
  123. tmpIndex=1;
  124. tabsa.forEach(function(it){
  125. TABS.push(it + tmpIndex);
  126. tmpIndex = tmpIndex + 1;
  127. });
  128. tmpIndex=1;
  129. tabsq.forEach(function(it){
  130. TABS.push(it + tmpIndex);
  131. tmpIndex = tmpIndex + 1;
  132. });
  133. tabm3u8.forEach(function(it){
  134. TABS.push(it);
  135. });
  136. log('xb6v TABS >>>>>>>>>>>>>>>>>>' + TABS);
  137. `,
  138. lists:`js:
  139. log(TABS);
  140. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  141. LISTS = [];
  142. let d = pdfa(html, 'div#post_content table tbody tr a');
  143. let lista = [];
  144. let listq = [];
  145. let listm = [];
  146. let liste = [];
  147. let listm3u8 = {};
  148. d.forEach(function(it){
  149. let burl = pdfh(it, 'a&&href');
  150. let title = pdfh(it, 'a&&Text');
  151. log('xb6v title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  152. log('xb6v burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  153. let loopresult = title + '$' + burl;
  154. if (burl.startsWith("https://www.aliyundrive.com/s/")){
  155. if (false){
  156. if (TABS.length==1){
  157. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&confirm=0&url=" + encodeURIComponent(burl);
  158. }else{
  159. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl);
  160. }
  161. }else{
  162. burl = "push://" + burl;
  163. }
  164. loopresult = title + '$' + burl;
  165. lista.push(loopresult);
  166. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  167. if (false){
  168. if (TABS.length==1){
  169. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  170. }else{
  171. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  172. }
  173. }else{
  174. burl = "push://" + burl;
  175. }
  176. loopresult = title + '$' + burl;
  177. listq.push(loopresult);
  178. }else if (burl.startsWith("magnet")){
  179. listm.push(loopresult);
  180. }else if (burl.startsWith("ed2k")){
  181. liste.push(loopresult);
  182. }
  183. });
  184. if (false){
  185. d = pdfa(html, 'div:has(>div#post_content) div.widget:has(>h3)');
  186. d.forEach(function(it){
  187. let index = pdfh(it, 'h3&&Text');
  188. let burl = pd(it, 'a&&href', HOST);
  189. let title = pdfh(it, 'a&&Text');
  190. log('xb6v title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  191. log('xb6v burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  192. let m3u8_html = request(burl);
  193. let playerUrl = pd(m3u8_html, 'div.video&&iframe&&src', HOST);
  194. log('xb6v playerUrl >>>>>>>>>>>>>>>>>>>>>>>>>>' + playerUrl);
  195. if (!listm3u8.hasOwnProperty(index)){
  196. listm3u8[index] = [];
  197. }
  198. let loopresult = title + '$' + ' ';
  199. if (/(\\/player\\/|\\/share\\/)/.test(playerUrl)){
  200. let player_html = request(playerUrl);
  201. let m3u8Url="";
  202. try{
  203. m3u8Url = player_html.match(/'([^']*.m3u8)'/)[1];
  204. }catch(e){
  205. try{
  206. m3u8Url = player_html.match(/"([^"]*.m3u8)"/)[1];
  207. }catch(e){
  208. m3u8Url = "";
  209. }
  210. }
  211. if (m3u8Url !== ""){
  212. m3u8Url = urljoin2(playerUrl, m3u8Url);
  213. log('xb6v m3u8Url >>>>>>>>>>>>>>>>>>>>>>>>>>' + m3u8Url);
  214. loopresult = title + '$' + m3u8Url;
  215. }
  216. }
  217. listm3u8[index].push(loopresult);
  218. });
  219. }
  220. if (listm.length>0){
  221. LISTS.push(listm);
  222. }
  223. if (liste.length>0){
  224. LISTS.push(liste);
  225. }
  226. if (lista.length + listq.length > 1){
  227. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  228. }
  229. lista.forEach(function(it){
  230. LISTS.push([it]);
  231. });
  232. listq.forEach(function(it){
  233. LISTS.push([it]);
  234. });
  235. for ( const key in listm3u8 ){
  236. if (listm3u8.hasOwnProperty(key)){
  237. LISTS.push(listm3u8[key]);
  238. }
  239. };
  240. `,
  241. },
  242. 搜索:`js:
  243. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  244. let params = 'show=title&tempid=1&tbname=article&mid=1&dopost=search&submit=&keyboard=' + encodeURIComponent(KEY);
  245. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  246. let postData = {
  247. method: "POST",
  248. body: params
  249. };
  250. delete(_fetch_params.headers['Content-Type']);
  251. Object.assign(_fetch_params, postData);
  252. log("xb6v search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  253. let search_html = request( HOST + '/e/search/index.php', _fetch_params, true);
  254. //log("xb6v search result>>>>>>>>>>>>>>>" + search_html);
  255. let d=[];
  256. let dlist = pdfa(search_html, 'div.mainleft&&ul#post_container&&li');
  257. dlist.forEach(function(it){
  258. let title = pdfh(it, 'div.thumbnail img&&alt');
  259. if (searchObj.quick === true){
  260. if (title.includes(KEY)){
  261. title = KEY;
  262. }
  263. }
  264. let img = pd(it, 'div.thumbnail img&&src', HOST);
  265. let content = pdfh(it, 'div.article div.entry_post&&Text');
  266. let desc = pdfh(it, 'div.info&&span.info_date&&Text');
  267. let url = pd(it, 'div.thumbnail&&a&&href', HOST);
  268. d.push({
  269. title:title,
  270. img:img,
  271. content:content,
  272. desc:desc,
  273. url:url
  274. });
  275. });
  276. setResult(d);
  277. `,
  278. }