ddys.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. var lists = `js:
  2. log(TABS);
  3. let d = [];
  4. pdfh = jsp.pdfh;
  5. pdfa = jsp.pdfa;
  6. if (typeof play_url === "undefined") {
  7. var play_url = ""
  8. }
  9. function getLists(html)
  10. {
  11. let src = pdfh(html, ".wp-playlist-script&&Html");
  12. src = JSON.parse(src).tracks;
  13. let list1 = [];
  14. let list2 = [];
  15. let url1 = "";
  16. let url2 = "";
  17. src.forEach(function(it) {
  18. let src0 = it.src0;
  19. let src1 = it.src1;
  20. let title = it.caption;
  21. url1 = "https://v.ddys.pro" + src0;
  22. url2 = "https://ddys.pro/getvddr2/video?id=" + src1 + "&type=mix";
  23. let zm = "https://ddys.pro/subddr/" + it.subsrc;
  24. list1.push({
  25. title: title,
  26. url: url1,
  27. desc: zm
  28. });
  29. list2.push({
  30. title: title,
  31. url: url2,
  32. desc: zm
  33. })
  34. });
  35. return {
  36. list1: list1,
  37. list2: list2
  38. }
  39. }
  40. var data = getLists(html);
  41. var list1 = data.list1;
  42. var list2 = data.list2;
  43. let nums = pdfa(html, "body&&.post-page-numbers");
  44. nums.forEach
  45. (function(it)
  46. {
  47. let num = pdfh(it, "body&&Text");
  48. log(num);
  49. let nurl = input + num + "/";
  50. if (num == 1) {
  51. return
  52. }
  53. log(nurl);
  54. let html = request(nurl);
  55. let data = getLists(html);
  56. list1 = list1.concat(data.list1);
  57. list2 = list2.concat(data.list2)
  58. });
  59. list1 = list1.map(function(item) {
  60. return item.title + "$" + play_url + urlencode(item.url + "|" + input + "|" + item.desc)
  61. });
  62. list2 = list2.map(function(item) {
  63. return item.title + "$" + play_url + urlencode(item.url + "|" + input + "|" + item.desc)
  64. });
  65. LISTS=[];
  66. let dd = pdfa(html, 'div.wp-playlist~a');
  67. dd.forEach(function(it){
  68. let burl = pd(it, 'a&&href', HOST);
  69. if (/(pan.quark.cn|www.aliyundrive.com)/.test(burl)){
  70. let type="ali";
  71. if (burl.includes("www.aliyundrive.com")){
  72. type = "ali";
  73. }else if (burl.includes("pan.quark.cn")){
  74. type = "quark";
  75. }
  76. LISTS.push([burl+ '$' + play_url + urlencode('http://127.0.0.1:9978/proxy?do='+type+'&type=push&url='+encodeURIComponent(burl)) + '||']);
  77. }
  78. });
  79. LISTS = LISTS.concat([list1, list2]);
  80. `;
  81. var lazy = `js:
  82. let purl = input.split("|")[0];
  83. let referer = input.split("|")[1];
  84. let zm = input.split("|")[2];
  85. print("purl:" + purl);
  86. print("referer:" + referer);
  87. print("zm:" + zm);
  88. if (/getvddr/.test(purl)) {
  89. let html = request(purl, {
  90. headers: {
  91. Referer: HOST,
  92. "User-Agent": MOBILE_UA
  93. }
  94. });
  95. print(html);
  96. try {
  97. input = {jx:0,url:JSON.parse(html).url,parse:0} || {}
  98. } catch (e) {
  99. input = purl
  100. }
  101. } else {
  102. input = {
  103. jx: 0,
  104. url: purl,
  105. parse: 0,
  106. header: JSON.stringify({
  107. 'user-agent': MOBILE_UA,
  108. 'referer': HOST
  109. })
  110. }
  111. }
  112. `;
  113. // 网址发布页 https://ddys.site
  114. // 网址发布页 https://ddys.wiki
  115. var rule={
  116. title:'ddys',
  117. // host:'https://ddys.wiki',
  118. // hostJs:'print(HOST);let html=request(HOST,{headers:{"User-Agent":MOBILE_UA}});HOST = jsp.pdfh(html,"a:eq(1)&&href")',
  119. host:'https://ddys.pro',
  120. // host:'https://ddys.mov',
  121. url:'/fyclass/page/fypage/',
  122. searchUrl:'/?s=**&post_type=post',
  123. searchable:2,
  124. quickSearch:0,
  125. filterable:0,
  126. headers:{
  127. 'User-Agent':'MOBILE_UA',
  128. },
  129. class_parse:'#primary-menu li.menu-item;a&&Text;a&&href;\.pro/(.*)',
  130. cate_exclude:'站长|^其他$|关于|^电影$|^剧集$|^类型$',
  131. play_parse:true,
  132. // lazy:'js:let purl=input.split("|")[0];let referer=input.split("|")[1];let zm=input.split("|")[2];print("purl:"+purl);print("referer:"+referer);print("zm:"+zm);let myua="okhttp/3.15";if(/ddrkey/.test(purl)){let ret=request(purl,{Referer:referer,withHeaders:true,"User-Agent":myua});log(ret);input=purl}else{let html=request(purl,{headers:{Referer:referer,"User-Agent":myua}});print(html);try{input=JSON.parse(html).url||{}}catch(e){input=purl}}',
  133. lazy:lazy,
  134. limit:6,
  135. 推荐:'*',
  136. double:true, // 推荐内容是否双层定位
  137. 一级:'.post-box-list&&article;a:eq(-1)&&Text;.post-box-image&&style;a:eq(0)&&Text;a:eq(-1)&&href',
  138. 二级:{
  139. "title":".post-title&&Text;.cat-links&&Text",
  140. "img":".doulist-item&&img&&data-cfsrc",
  141. "desc":".published&&Text",
  142. "content":".abstract&&Text",
  143. "tabs":`js:
  144. TABS=[];
  145. let d = pdfa(html, 'div.wp-playlist~a');
  146. let tabsq=[];
  147. d.forEach(function(it){
  148. let burl = pd(it, 'a&&href', HOST);
  149. if (burl.includes("pan.quark.cn")){
  150. tabsq.push("夸克網盤");
  151. }else if (burl.includes("www.aliyundrive.com")){
  152. tabsq.push("阿里雲盤");
  153. }
  154. });
  155. if (tabsq.length == 1){
  156. TABS=TABS.concat(tabsq);
  157. }else{
  158. let tmpIndex=1;
  159. tabsq.forEach(function(it){
  160. TABS.push(it+tmpIndex);
  161. tmpIndex++;
  162. });
  163. }
  164. TABS=TABS.concat(['国内(改Exo播放器)','国内2']);
  165. `,
  166. "lists":lists
  167. },
  168. 搜索:'#main&&article;.post-title&&Text;;.published&&Text;a&&href'
  169. }