nangua.js 11 KB

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