南瓜影视.js 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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:'H4sIAAAAAAAAA+2X0XLSQBSG3yXXXARoKfRVnF5EhyuxzrTVGabDTCtSC21B6wxai9WOLcGxlKC1QjDty2Q38BYmJHvOWZwJdoxe5Y7vPz+bZXf/s2FTSSrL9zaVh/misqw8KGjr60pCWdUe5V10+iN2sufyU63wJD/1rboyq3Qm5Y4no6eUCGq1jm21nOqLoIwMjmaLVXXiABYOZ7fPyxV0IINDf8WGI+IAFg6+/ZJvNdGBDPOo6tJTkGGM3be2WSVjAIOjXOPP3hEHcGnF8/irqq3lNVxU1jLYvhm+qIEHpnpQH/e6ouaDqE3aR3zQw0FnJViymzo7tsR6+QA/40LnV1/Fb/ABxv/wGb8XAHzvzTlvXYjv+QBzbhh8eCPNS5JgjG8Gjh/AXcdgBwYz27A+U4Ba5ZpdlkXNB7o5xby2RjZneGWPrDmb43vEA1JqaiGoTD8SPY16muop1FNUT6KepLqKukr0ZA509yPRs6hnqb6E+hLVM6hnqL6I+iLoSXW6AJ+CGqCoq3Jdna3n5Hputp6V64B00+4Xcct4/ZCZjd+2zCl3+WGXt1viyAPDyTi3xr3n6ECGs9k07EHNMW/F8QR2J7OSUFLRts5jyzZ1tw2J+QDDfNxUNwx0IEfbbnYqriJqPty13cyNbhzBOIIRRDAdbQTP9MnRjpiMD3L4pOTRi9C9GvEi9IBcru51i5erB/8trpFOOr5R4ziHxnleWBf+wX3Jf36R7kuP5VOMDmQ5A8QBLCeIOIAjDbE96Lrzl/qPJP3JK3foq3oc6DjQ0QYaHrXxeEMrkCjXrvnW9pwo+x7xnPHtydgSJzcAOJ2X+87otThYPgTtJBNpP/GzT96ugeUQEQcwOL7/YGdN4gCOtFuEJV2a4ez0QrpH2B/x8V4fawGQM8JqH9n7UzwjAZP+Yo+a2F88iPtL3F/+/v2/9AsqovmovxQAAA==',
  29. headers:{
  30. "User-Agent":"okhttp/4.6.0"
  31. },
  32. timeout:5000,
  33. class_name:'电视剧&电影&动漫&综艺&海外精选', // /api.php/provide/home_nav
  34. class_url:'2&1&4&3&46',
  35. limit:20,
  36. play_parse:true,
  37. tab_remove:['NG快播-1'],
  38. lazy: $js.toString(() => {
  39. try {
  40. function getvideo(url) {
  41. let jData = JSON.parse(request(url, {
  42. headers: getHeaders(url)
  43. }));
  44. if (jData.code == 1) {
  45. return jData.data.url
  46. } else {
  47. return 'http://43.154.104.152:1234/jhapi/cs.php?url=' + url.split('=')[1]
  48. }
  49. }
  50. if (/,/.test(input)) {
  51. let mjurl = input.split(',')[0]
  52. let videoUrl = getvideo(mjurl);
  53. input = {
  54. jx: 0,
  55. url: videoUrl,
  56. parse: 0,
  57. header: JSON.stringify({
  58. 'user-agent': 'Lavf/58.12.100'
  59. })
  60. }
  61. } else {
  62. let videoUrl = getvideo(input);
  63. if (/jhapi/.test(videoUrl)) {
  64. videoUrl = getvideo(videoUrl);
  65. input = {
  66. jx: 0,
  67. url: videoUrl,
  68. parse: 0,
  69. header: JSON.stringify({
  70. 'user-agent': 'Lavf/58.12.100'
  71. })
  72. }
  73. } else {
  74. input = {
  75. jx: 0,
  76. url: videoUrl,
  77. parse: 0
  78. }
  79. }
  80. }
  81. } catch (e) {
  82. log(e.toString())
  83. }
  84. }),
  85. 推荐:$js.toString(() => {
  86. var d = [];
  87. let html = request(input, {
  88. headers: getHeaders(input)
  89. });
  90. html = JSON.parse(html);
  91. html.forEach(function(it) {
  92. d.push({
  93. title: it.name,
  94. img: it.img,
  95. desc: it.remarks,
  96. url: it.id
  97. })
  98. });
  99. setResult(d);
  100. }),
  101. 一级:$js.toString(() => {
  102. var d = [];
  103. let html = request(input, {
  104. headers: getHeaders(input)
  105. });
  106. html = JSON.parse(html);
  107. html.list.forEach(function(it) {
  108. d.push({
  109. title: it.name,
  110. img: it.img,
  111. desc: it.msg,
  112. url: it.id
  113. })
  114. });
  115. setResult(d);
  116. }),
  117. 二级:$js.toString(() => {
  118. var d = [];
  119. VOD = {
  120. vod_id: input.split('id=')[1]
  121. };
  122. try {
  123. let html = request(input, {
  124. headers: getHeaders(input)
  125. });
  126. html = JSON.parse(html);
  127. let node = html.data;
  128. VOD = {
  129. vod_name: node['name'],
  130. vod_pic: node['img'],
  131. type_name: node['type'],
  132. vod_year: node['year'],
  133. vod_remarks: '更新至: ' + node['msg'] + ' / 评分: ' + node['score'],
  134. vod_content: node['info'].strip()
  135. };
  136. let episodes = node.player_info;
  137. let playMap = {};
  138. if (typeof play_url === 'undefined') {
  139. var play_url = ''
  140. }
  141. episodes.forEach(function(ep) {
  142. let playurls = ep['video_info'];
  143. playurls.forEach(function(playurl) {
  144. let source = ep['show'];
  145. if (!playMap.hasOwnProperty(source)) {
  146. playMap[source] = []
  147. }
  148. playMap[source].append(playurl['name'].strip() + '$' +
  149. //play_url + urlencode(playurl['url'][0])
  150. play_url + playurl['url'][0]
  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.toString(() => {
  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. }