dygang .js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. var rule = {
  2. title:'电影港[磁]',
  3. 编码:'gb2312',
  4. host:'https://www.dygang.tv',
  5. homeUrl:'/',
  6. url: '/fyclass/index_fypage.htm?',
  7. filter_url:'{{fl.class}}',
  8. filter:{
  9. },
  10. searchUrl: '/e/search/index.php#tbname=article&show=title,smalltext&tempid=1&Submit=%CB%D1%CB%F7&keyboard=**;post',
  11. searchable:2,
  12. quickSearch:1,
  13. filterable:0,
  14. headers:{
  15. 'User-Agent': 'PC_UA',
  16. 'Referer': 'https://www.dygang.tv/'
  17. },
  18. timeout:5000,
  19. class_name:'最新电影&经典高清&国配电影&经典港片&国剧&日韩剧&美剧&综艺&动漫&纪录片&高清原盘&4K高清区&3D电影&电影专题',
  20. class_url:'ys&bd&gy&gp&dsj&dsj1&yx&zy&dmq&jilupian&1080p&4K&3d&dyzt',
  21. play_parse:false,
  22. lazy:'',
  23. limit:6,
  24. 推荐:'div#tl table.border1;img&&alt;img&&src;;a&&href',
  25. 一级:'table.border1;img&&alt;img&&src;;a&&href',
  26. 二级:{
  27. title:"div.title a&&Text",
  28. img:"#dede_content img&&src",
  29. desc:"#dede_content p:eq(3)&&Text",
  30. content:"#dede_content p:eq(2)&&Text",
  31. tabs:`js:
  32. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  33. TABS=[]
  34. var d = pdfa(html, '#dede_content&&a');
  35. var index=0;
  36. d.forEach(function(it) {
  37. let burl = pdfh(it, 'a&&href');
  38. log("burl >>>>>>" + burl);
  39. if (burl.startsWith("magnet")){
  40. let result = 'magnet' + index;
  41. index = index + 1;
  42. TABS.push(result);
  43. }
  44. });
  45. log('TABS >>>>>>>>>>>>>>>>>>' + TABS);
  46. `,
  47. lists:`js:
  48. log(TABS);
  49. pdfh=jsp.pdfh;pdfa=jsp.pdfa;pd=jsp.pd;
  50. LISTS = [];
  51. var d = pdfa(html, '#dede_content&&a');
  52. TABS.forEach(function(tab) {
  53. log('tab >>>>>>>>' + tab);
  54. if (/^magnet/.test(tab)) {
  55. let targetindex = parseInt(tab.substring(6));
  56. let index = 0;
  57. d.forEach(function(it){
  58. let burl = pdfh(it, 'a&&href');
  59. if (burl.startsWith("magnet")){
  60. if (index == targetindex){
  61. let title = pdfh(it, 'a&&Text');
  62. log('title >>>>>>>>>>>>>>>>>>>>>>>>>>' + title);
  63. log('burl >>>>>>>>>>>>>>>>>>>>>>>>>>' + burl);
  64. let loopresult = title + '$' + burl;
  65. LISTS.push([loopresult]);
  66. }
  67. index = index + 1;
  68. }
  69. });
  70. }
  71. });
  72. `,
  73. },
  74. 搜索:'table.border1;img&&alt;img&&src;img&&alt;a&&href;img&&alt',
  75. 预处理:`
  76. let new_host=HOST;
  77. let new_html=request(new_host, {withHeaders:true});
  78. let json=JSON.parse(new_html);
  79. let setCk=Object.keys(json).find(it=>it.toLowerCase()==="set-cookie");
  80. let cookie=setCk?json[setCk].split(";")[0]:"";
  81. log("cookie:"+cookie);
  82. rule_fetch_params.headers.Cookie=cookie;
  83. setItem(RULE_CK,cookie);
  84. `,
  85. }