dygang.js 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. var rule = {
  2. title:'电影港[磁]',
  3. 编码:'gb2312',
  4. 搜索编码:'gb2312',
  5. host:'https://www.dygang.tv',
  6. homeUrl:'/',
  7. url: '/fyclass/index_fypage.htm?',
  8. filter_url:'{{fl.class}}',
  9. filter:{
  10. },
  11. searchUrl: '/e/search/index123.php#tempid=1&tbname=article&keyborad=**&show=title%2Csmalltext&Submit=%CB%D1%CB%F7;post',
  12. searchable:2,
  13. quickSearch:0,
  14. filterable:0,
  15. headers:{
  16. 'User-Agent': 'MOBILE_UA',
  17. 'Referer': 'https://www.dygang.tv/'
  18. },
  19. timeout:5000,
  20. class_name:'最新电影&经典高清&国配电影&经典港片&国剧&日韩剧&美剧&综艺&动漫&纪录片&高清原盘&4K高清区&3D电影&电影专题',
  21. class_url:'ys&bd&gy&gp&dsj&dsj1&yx&zy&dmq&jilupian&1080p&4K&3d&dyzt',
  22. play_parse:true,
  23. play_json:[{
  24. re:'*',
  25. json:{
  26. parse:0,
  27. jx:0
  28. }
  29. }],
  30. lazy:'',
  31. limit:6,
  32. 推荐:'div#tl tr:has(>td>table.border1>tbody>tr>td>a>img);table.border1 img&&alt;table.border1 img&&src;table:eq(2)&&Text;a&&href',
  33. 一级:`js:
  34. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  35. let d = [];
  36. let turl = (MY_PAGE === 1)? '/' : '/index_'+ MY_PAGE + '.htm';
  37. input = rule.homeUrl + MY_CATE + turl;
  38. let html = request(input);
  39. let list = pdfa(html, 'tr:has(>td>table.border1)');
  40. list.forEach(it => {
  41. let title = pdfh(it, 'table.border1 img&&alt');
  42. if (title!==""){
  43. d.push({
  44. title: title,
  45. desc: pdfh(it, 'table:eq(1)&&Text'),
  46. pic_url: pd(it, 'table.border1 img&&src', HOST),
  47. url: pdfh(it, 'a&&href')
  48. });
  49. }
  50. })
  51. setResult(d);
  52. `,
  53. 二级:{
  54. title:"div.title a&&Text",
  55. img:"#dede_content img&&src",
  56. desc:"#dede_content&&Text",
  57. content:"#dede_content&&Text",
  58. tabs:`js:
  59. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  60. TABS=[]
  61. let d = pdfa(html, '#dede_content table tbody tr a');
  62. let tabsa = [];
  63. let tabsq = [];
  64. let tabsm = false;
  65. let tabse = false;
  66. let tabm3u8 = [];
  67. d.forEach(function(it) {
  68. let burl = pdfh(it, 'a&&href');
  69. if (burl.startsWith("https://www.aliyundrive.com/s/")){
  70. tabsa.push("阿里云盤");
  71. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  72. tabsq.push("夸克云盤");
  73. }else if (burl.startsWith("magnet")){
  74. tabsm = true;
  75. }else if (burl.startsWith("ed2k")){
  76. tabse = true;
  77. }
  78. });
  79. if (false){
  80. d = pdfa(html, 'div:has(>div#post_content) div.widget:has(>h3)');
  81. d.forEach(function(it) {
  82. tabm3u8.push(pdfh(it, 'h3&&Text'));
  83. });
  84. }
  85. if (tabsm === true){
  86. TABS.push("磁力");
  87. }
  88. if (tabse === true){
  89. TABS.push("電驢");
  90. }
  91. if (tabsa.length + tabsq.length > 1){
  92. TABS.push("選擇右側綫路");
  93. }
  94. let tmpIndex;
  95. tmpIndex=1;
  96. tabsa.forEach(function(it){
  97. TABS.push(it + tmpIndex);
  98. tmpIndex = tmpIndex + 1;
  99. });
  100. tmpIndex=1;
  101. tabsq.forEach(function(it){
  102. TABS.push(it + tmpIndex);
  103. tmpIndex = tmpIndex + 1;
  104. });
  105. tabm3u8.forEach(function(it){
  106. TABS.push(it);
  107. });
  108. log('dygang TABS >>>>>>>>>>>>>>>>>>' + TABS);
  109. `,
  110. lists:`js:
  111. log(TABS);
  112. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  113. LISTS = [];
  114. let d = pdfa(html, '#dede_content table tbody tr a');
  115. let lista = [];
  116. let listq = [];
  117. let listm = [];
  118. let liste = [];
  119. let listm3u8 = {};
  120. d.forEach(function(it){
  121. let burl = pdfh(it, 'a&&href');
  122. let title = pdfh(it, 'a&&Text');
  123. log('dygang title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  124. log('dygang burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  125. let loopresult = title + '$' + burl;
  126. if (burl.startsWith("https://www.aliyundrive.com/s/")){
  127. if (false){
  128. if (TABS.length==1){
  129. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&confirm=0&url=" + encodeURIComponent(burl);
  130. }else{
  131. burl = "http://127.0.0.1:9978/proxy?do=ali&type=push&url=" + encodeURIComponent(burl);
  132. }
  133. }else{
  134. burl = 'push://' + burl;
  135. }
  136. loopresult = title + '$' + burl;
  137. lista.push(loopresult);
  138. }else if (burl.startsWith("https://pan.quark.cn/s/")){
  139. if (false){
  140. if (TABS.length==1){
  141. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&confirm=0&url=" + encodeURIComponent(burl);
  142. }else{
  143. burl = "http://127.0.0.1:9978/proxy?do=quark&type=push&url=" + encodeURIComponent(burl);
  144. }
  145. }else{
  146. burl = 'push://' + burl;
  147. }
  148. loopresult = title + '$' + burl;
  149. listq.push(loopresult);
  150. }else if (burl.startsWith("magnet")){
  151. listm.push(loopresult);
  152. }else if (burl.startsWith("ed2k")){
  153. liste.push(loopresult);
  154. }
  155. });
  156. if (false){
  157. d = pdfa(html, 'div:has(>div#post_content) div.widget:has(>h3)');
  158. d.forEach(function(it){
  159. let index = pdfh(it, 'h3&&Text');
  160. let burl = pd(it, 'a&&href', HOST);
  161. let title = pdfh(it, 'a&&Text');
  162. log('xb6v title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  163. log('xb6v burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  164. let m3u8_html = request(burl);
  165. let playerUrl = pd(m3u8_html, 'div.video&&iframe&&src', HOST);
  166. log('xb6v playerUrl >>>>>>>>>>>>>>>>>>>>>>>>>>' + playerUrl);
  167. if (!listm3u8.hasOwnProperty(index)){
  168. listm3u8[index] = [];
  169. }
  170. let loopresult = title + '$' + ' ';
  171. if (/(\/player\/|\/share\/)/.test(playerUrl)){
  172. let player_html = request(playerUrl);
  173. let m3u8Url="";
  174. try{
  175. m3u8Url = player_html.match(/'([^']*.m3u8)'/)[1];
  176. }catch(e){
  177. try{
  178. m3u8Url = player_html.match(/"([^"]*.m3u8)"/)[1];
  179. }catch(e){
  180. m3u8Url = "";
  181. }
  182. }
  183. if (m3u8Url !== ""){
  184. m3u8Url = urljoin2(playerUrl, m3u8Url);
  185. log('xb6v m3u8Url >>>>>>>>>>>>>>>>>>>>>>>>>>' + m3u8Url);
  186. loopresult = title + '$' + m3u8Url;
  187. }
  188. }
  189. listm3u8[index].push(loopresult);
  190. });
  191. }
  192. if (listm.length>0){
  193. LISTS.push(listm);
  194. }
  195. if (liste.length>0){
  196. LISTS.push(liste);
  197. }
  198. if (lista.length + listq.length > 1){
  199. LISTS.push(["選擇右側綫路,或3秒後自動跳過$http://127.0.0.1:10079/delay/"]);
  200. }
  201. lista.forEach(function(it){
  202. LISTS.push([it]);
  203. });
  204. listq.forEach(function(it){
  205. LISTS.push([it]);
  206. });
  207. for ( const key in listm3u8 ){
  208. if (listm3u8.hasOwnProperty(key)){
  209. LISTS.push(listm3u8[key]);
  210. }
  211. };
  212. `,
  213. },
  214. 搜索:`js:
  215. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  216. let params = 'tempid=1&tbname=article&keyboard=' + KEY + '&show=title%2Csmalltext&Submit=%CB%D1%CB%F7';
  217. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  218. let postData = {
  219. method: "POST",
  220. body: params
  221. };
  222. delete(_fetch_params.headers['Content-Type']);
  223. Object.assign(_fetch_params, postData);
  224. log("dygang search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  225. let search_html = request( HOST + '/e/search/index123.php', _fetch_params, true);
  226. //log("dygang search result>>>>>>>>>>>>>>>" + search_html);
  227. let d=[];
  228. let dlist = pdfa(search_html, 'table.border1');
  229. dlist.forEach(function(it){
  230. let title = pdfh(it, 'img&&alt');
  231. if (searchObj.quick === true){
  232. if (title.includes(KEY)){
  233. title = KEY;
  234. }
  235. }
  236. let img = pd(it, 'img&&src', HOST);
  237. let content = pdfh(it, 'img&&alt');
  238. let desc = pdfh(it, 'img&&alt');
  239. let url = pd(it, 'a&&href', HOST);
  240. d.push({
  241. title:title,
  242. img:img,
  243. content:content,
  244. desc:desc,
  245. url:url
  246. })
  247. });
  248. setResult(d);
  249. `,
  250. }