南瓜.js 11 KB

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