dygang.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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');
  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 = pd(it, 'a&&href',HOST);
  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 (false && 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');
  115. let lista = [];
  116. let listq = [];
  117. let listm = [];
  118. let liste = [];
  119. let listm3u8 = {};
  120. d.forEach(function(it){
  121. let burl = pd(it, 'a&&href',HOST);
  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 (true){
  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 (true){
  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 (listm.length>0){
  157. LISTS.push(listm);
  158. }
  159. if (liste.length>0){
  160. LISTS.push(liste);
  161. }
  162. lista.forEach(function(it){
  163. LISTS.push([it]);
  164. });
  165. listq.forEach(function(it){
  166. LISTS.push([it]);
  167. });
  168. for ( const key in listm3u8 ){
  169. if (listm3u8.hasOwnProperty(key)){
  170. LISTS.push(listm3u8[key]);
  171. }
  172. };
  173. `,
  174. },
  175. 搜索:`js:
  176. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  177. let params = 'tempid=1&tbname=article&keyboard=' + KEY + '&show=title%2Csmalltext&Submit=%CB%D1%CB%F7';
  178. let _fetch_params = JSON.parse(JSON.stringify(rule_fetch_params));
  179. let postData = {
  180. method: "POST",
  181. body: params
  182. };
  183. delete(_fetch_params.headers['Content-Type']);
  184. Object.assign(_fetch_params, postData);
  185. log("dygang search postData>>>>>>>>>>>>>>>" + JSON.stringify(_fetch_params));
  186. let search_html = request( HOST + '/e/search/index123.php', _fetch_params, true);
  187. //log("dygang search result>>>>>>>>>>>>>>>" + search_html);
  188. let d=[];
  189. let dlist = pdfa(search_html, 'table.border1');
  190. dlist.forEach(function(it){
  191. let title = pdfh(it, 'img&&alt');
  192. if (searchObj.quick === true){
  193. if (false && title.includes(KEY)){
  194. title = KEY;
  195. }
  196. }
  197. let img = pd(it, 'img&&src', HOST);
  198. let content = pdfh(it, 'img&&alt');
  199. let desc = pdfh(it, 'img&&alt');
  200. let url = pd(it, 'a&&href', HOST);
  201. d.push({
  202. title:title,
  203. img:img,
  204. content:content,
  205. desc:desc,
  206. url:url
  207. })
  208. });
  209. setResult(d);
  210. `,
  211. }