畅梦影视.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  2. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  3. // 注入全局方法 (仅支持tvbox的js1以及c#版drpy的js0,暂不支持drpy官方py版的js0)
  4. globalThis.getHeaders= function(input){
  5. let t = new Date().getTime().toString();
  6. let headers = {
  7. 'version_name': '1.0.6',
  8. 'version_code': '6',
  9. 'package_name': 'com.app.nanguatv',
  10. 'sign': md5('c431ea542cee9679#uBFszdEM0oL0JRn@' + t).toUpperCase(),
  11. 'imei': 'c431ea542cee9679',
  12. 'timeMillis': t,
  13. 'User-Agent': 'okhttp/4.6.0'
  14. };
  15. return headers
  16. }
  17. var rule = {
  18. title:'畅梦影视',
  19. host:'http://ys.changmengyun.com',
  20. homeUrl:'/api.php/provide/vod_rank?app=ylys&sort_type=month&imei=c431ea542cee9679&id=2&page=1',
  21. url:'/api.php/provide/vod_list?app=ylys&id=fyclassfyfilter&page=fypage&imei=c431ea542cee9679',
  22. detailUrl:'/api.php/provide/vod_detail?app=ylys&imei=c431ea542cee9679&id=fyid',
  23. searchUrl:'/api.php/provide/search_result_more?app=ylys&video_name=**&pageSize=20&tid=0&imei=c431ea542cee9679&page=fypage',
  24. searchable:2,
  25. quickSearch:0,
  26. filterable:1,
  27. filter_url:'&area={{fl.area}}&year={{fl.year}}&type={{fl.class}}&total={{fl.total or "状态"}}&order={{fl.by or "新上线"}}',
  28. filter:{
  29. "2":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"国产剧","v":"国产剧"},{"n":"港台剧","v":"港台剧"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"内地","v":"内地"},{"n":"香港地区","v":"香港地区"},{"n":"台湾地区","v":"台湾地区"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}],
  30. "1":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"动作片","v":"动作片"},{"n":"喜剧片","v":"喜剧片"},{"n":"爱情片","v":"爱情片"},{"n":"科幻片","v":"科幻片"},{"n":"恐怖片","v":"恐怖片"},{"n":"剧情片","v":"剧情片"},{"n":"战争片","v":"战争片"},{"n":"惊悚片","v":"惊悚片"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"华语","v":"华语"},{"n":"香港地区","v":"香港地区"},{"n":"美国","v":"美国"},{"n":"欧洲","v":"欧洲"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"台湾地区","v":"台湾地区"},{"n":"泰国","v":"泰国"},{"n":"台湾地区","v":"台湾地区"},{"n":"印度","v":"印度"},{"n":"其它","v":"其它"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}],
  31. "4":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"国产漫","v":"国产漫"},{"n":"欧美漫","v":"欧美漫"},{"n":"日韩漫","v":"日韩漫"},{"n":"港台漫","v":"港台漫"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"中国大陆","v":"中国大陆"},{"n":"日本","v":"日本"},{"n":"韩国","v":"韩国"},{"n":"欧美","v":"欧美"},{"n":"其它","v":"其它"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"新上线","v":"新上线"}]},{"key":"total","name":"状态","value":[{"n":"全部","v":"状态"},{"n":"连载","v":"连载"},{"n":"完结","v":"完结"}]}],
  32. "3":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"大陆","v":"大陆"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"内地","v":"内地"},{"n":"港台","v":"港台"},{"n":"日韩","v":"日韩"},{"n":"欧美","v":"欧美"},{"n":"其它","v":"其它"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"新上线","v":"新上线"}]}],
  33. "46":[{"key":"class","name":"类型","value":[{"n":"全部","v":"类型"},{"n":"日韩剧","v":"日韩剧"},{"n":"欧美剧","v":"欧美剧"},{"n":"海外剧","v":"海外剧"}]},{"key":"area","name":"地区","value":[{"n":"全部","v":"地区"},{"n":"韩国","v":"韩国"},{"n":"美剧","v":"美剧"},{"n":"日本","v":"日本"},{"n":"泰国","v":"泰国"},{"n":"英国","v":"英国"},{"n":"新加坡","v":"新加坡"},{"n":"其他","v":"其他"}]},{"key":"year","name":"年份","value":[{"n":"全部","v":"年份"},{"n":"2023","v":"2023"},{"n":"2022","v":"2022"},{"n":"2021","v":"2021"},{"n":"2020","v":"2020"},{"n":"2019","v":"2019"},{"n":"2018","v":"2018"},{"n":"2017","v":"2017"},{"n":"2016","v":"2016"},{"n":"2015","v":"2015"},{"n":"10年代","v":"10年代"},{"n":"00年代","v":"00年代"},{"n":"90年代","v":"90年代"},{"n":"80年代","v":"80年代"}]},{"key":"by","name":"排序","value":[{"n":"热播榜","v":"热播榜"},{"n":"好评榜","v":"好评榜"},{"n":"新上线","v":"新上线"}]}]
  34. },
  35. headers:{
  36. "User-Agent":"okhttp/4.6.0"
  37. },
  38. timeout:5000,
  39. class_name:'电视剧&电影&动漫&综艺&海外精选', // /api.php/provide/home_nav
  40. class_url:'2&1&4&3&46',
  41. limit:20,
  42. play_parse:true,
  43. lazy:`js:
  44. try {
  45. function getvideo(url) {
  46. let jData = JSON.parse(request(url, {
  47. headers: getHeaders(url)
  48. }));
  49. if (jData.code == 1) {
  50. return jData.data.url
  51. } else {
  52. return 'http://43.154.104.152:1234/jhapi/cs.php?url=' + url.split('=')[1]
  53. }
  54. }
  55. if (/,/.test(input)) {
  56. let mjurl = input.split(',')[1]
  57. let videoUrl = getvideo(mjurl);
  58. input = {
  59. jx: 0,
  60. url: videoUrl,
  61. parse: 0,
  62. header: JSON.stringify({
  63. 'user-agent': 'Lavf/58.12.100'
  64. })
  65. }
  66. } else {
  67. let videoUrl = getvideo(input);
  68. if (/jhapi/.test(videoUrl)) {
  69. videoUrl = getvideo(videoUrl);
  70. input = {
  71. jx: 0,
  72. url: videoUrl,
  73. parse: 0,
  74. header: JSON.stringify({
  75. 'user-agent': 'Lavf/58.12.100'
  76. })
  77. }
  78. } else {
  79. input = {
  80. jx: 0,
  81. url: videoUrl,
  82. parse: 0
  83. }
  84. }
  85. }
  86. } catch (e) {
  87. log(e.toString())
  88. }
  89. `,
  90. 推荐:`js:
  91. var d = [];
  92. let html = request(input, {
  93. headers: getHeaders(input)
  94. });
  95. html = JSON.parse(html);
  96. html.forEach(function(it) {
  97. d.push({
  98. title: it.name,
  99. img: it.img,
  100. desc: it.remarks,
  101. url: it.id
  102. })
  103. });
  104. setResult(d);
  105. `,
  106. 一级:`js:
  107. var d = [];
  108. let html = request(input, {
  109. headers: getHeaders(input)
  110. });
  111. html = JSON.parse(html);
  112. html.list.forEach(function(it) {
  113. d.push({
  114. title: it.name,
  115. img: it.img,
  116. desc: it.msg,
  117. url: it.id
  118. })
  119. });
  120. setResult(d);
  121. `,
  122. 二级:`js:
  123. var d = [];
  124. VOD = {
  125. vod_id: input.split('id=')[1]
  126. };
  127. try {
  128. let html = request(input, {
  129. headers: getHeaders(input)
  130. });
  131. html = JSON.parse(html);
  132. let node = html.data;
  133. VOD = {
  134. vod_name: node['name'],
  135. vod_pic: node['img'],
  136. type_name: node['type'],
  137. vod_year: node['year'],
  138. vod_remarks: '更新至: ' + node['msg'] + ' / 评分: ' + node['score'],
  139. vod_content: node['info'].strip()
  140. };
  141. let episodes = node.player_info;
  142. let playMap = {};
  143. if (typeof play_url === 'undefined') {
  144. var play_url = ''
  145. }
  146. episodes.forEach(function(ep) {
  147. let playurls = ep['video_info'];
  148. playurls.forEach(function(playurl) {
  149. let source = ep['show'];
  150. if (!playMap.hasOwnProperty(source)) {
  151. playMap[source] = []
  152. }
  153. playMap[source].append(playurl['name'].strip() + '$' + play_url + urlencode(playurl['url']))
  154. })
  155. });
  156. let playFrom = [];
  157. let playList = [];
  158. Object.keys(playMap)
  159. .forEach(function(key) {
  160. playFrom.append(key);
  161. playList.append(playMap[key].join('#'))
  162. });
  163. let vod_play_from = playFrom.join('$$$');
  164. let vod_play_url = playList.join('$$$');
  165. VOD['vod_play_from'] = vod_play_from;
  166. VOD['vod_play_url'] = vod_play_url
  167. } catch (e) {
  168. log('获取二级详情页发生错误:' + e.message)
  169. }
  170. `,
  171. 搜索:`js:
  172. var d = [];
  173. let html = request(input, {
  174. headers: getHeaders(input)
  175. });
  176. html = JSON.parse(html);
  177. html.data.forEach(function(it) {
  178. d.push({
  179. title: it.video_name,
  180. img: it.img,
  181. desc: it.qingxidu + '/' + it.category,
  182. url: it.id,
  183. content: it.blurb
  184. })
  185. });
  186. setResult(d);
  187. `,
  188. }