6080_open.js 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. import {
  2. Crypto, load, _
  3. }
  4. from 'assets://js/lib/cat.js';
  5. let key = '新视觉影视';
  6. let HOST = 'https://www.6080yy4.com';
  7. let siteKey = '';
  8. let siteType = 0;
  9. const UA = 'Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1';
  10. async function request(reqUrl, agentSp) {
  11. let res = await req(reqUrl, {
  12. method: 'get',
  13. headers: {
  14. 'User-Agent': agentSp || UA,
  15. 'Referer': HOST
  16. },
  17. });
  18. return res.content;
  19. }
  20. // cfg = {skey: siteKey, ext: extend}
  21. async function init(cfg) {
  22. siteKey = cfg.skey;
  23. siteType = cfg.stype;
  24. }
  25. async function home(filter) {
  26. let classes = [{
  27. 'type_id': '1',
  28. 'type_name': '电影'
  29. }, {
  30. 'type_id': '2',
  31. 'type_name': '电视剧'
  32. }, {
  33. 'type_id': '3',
  34. 'type_name': '综艺'
  35. }, {
  36. 'type_id': '4',
  37. 'type_name': '动漫'
  38. }, {
  39. 'type_id': '63',
  40. 'type_name': '记录'
  41. }];
  42. let filterObj = {};
  43. return JSON.stringify({
  44. class: classes,
  45. filters: filterObj,
  46. });
  47. }
  48. async function homeVod() {}
  49. async function category(tid, pg, filter, extend) {
  50. const link = HOST + '/vodshow/' + tid + '--------' + pg + '---.html';
  51. const html = await request(link);
  52. const $ = load(html);
  53. const items = $('div.module-list > div.module-items > div.module-item');
  54. let videos = _.map(items, (item) => {
  55. const $item = $(item);
  56. return {
  57. vod_id: $item.find('div.module-item-titlebox > a').attr('href'),
  58. vod_name: $item.find('div.module-item-titlebox > a').attr('title'),
  59. vod_pic: $item.find('div.module-item-cover > div > img').attr('data-src'),
  60. vod_remarks: $item.find('div.module-item-text').text(),
  61. };
  62. });
  63. return JSON.stringify({
  64. page: parseInt(pg),
  65. pagecount: 0,
  66. limit: 0,
  67. total: 0,
  68. list: videos,
  69. });
  70. }
  71. async function detail(id) {
  72. const html = await request(HOST + id);
  73. const $ = load(html);
  74. const vod = {
  75. vod_id: id,
  76. vod_name: $('h1').text(),
  77. vod_pic: $('div.module-item-pic > img.lazyload').attr('data-src'),
  78. vod_remarks: '',
  79. vod_content: '[关注公众号:影视资源站] ' + $('div.vod_content > span').text(),
  80. };
  81. //console.debug(vod);
  82. const playMap = {};
  83. const tabs = $('div.module-tab-content > div.module-tab-item');
  84. const playlists = $('div.module-list > div.module-blocklist > div');
  85. _.each(tabs, (tab, i) => {
  86. const from = $(tab).find('span').text();
  87. let list = playlists[i];
  88. list = $(list).find('a');
  89. _.each(list, (it) => {
  90. const title = $(it).find('span').text();
  91. const playUrl = it.attribs.href;
  92. if (!playMap.hasOwnProperty(from)) {
  93. playMap[from] = [];
  94. }
  95. playMap[from].push(title + '$' + playUrl);
  96. });
  97. });
  98. vod.vod_play_from = _.keys(playMap).join('$$$');
  99. const urls = _.values(playMap);
  100. const vod_play_url = _.map(urls, (urlist) => {
  101. return urlist.join('#');
  102. });
  103. vod.vod_play_url = vod_play_url.join('$$$');
  104. return JSON.stringify({
  105. list: [vod],
  106. });
  107. }
  108. async function play(flag, id, flags) {
  109. const link = HOST + id;
  110. const html = await request(link);
  111. let $ = load(html);
  112. let js = JSON.parse($('script:contains(player_)').html().replace('var player_aaaa=', ''));
  113. const playurl = "https://jiexi.xn--1lq90i13mxk5bolhm8k.xn--fiqs8s/player/ec.php?code=ak&if=1&url=" + js.url;
  114. const result = await request(playurl);
  115. $ = load(result);
  116. js = JSON.parse($('script:contains(let ConFig =)').html().replace('let ConFig = ','').replace(',box = $("#player"),lg = ConFig.lg;',''));
  117. const encUrl = js.url;
  118. const uid = js.config.uid;
  119. const playUrl = AES_Decrypt(encUrl, "2890" + uid + "tB959C", '2F131BE91247866E');
  120. return JSON.stringify({
  121. parse: 0,
  122. url: playUrl,
  123. header: {
  124. 'User-Agent': UA,
  125. },
  126. });
  127. }
  128. function AES_Decrypt(word, k, v) {
  129. var key = Crypto.enc.Utf8.parse(k);
  130. var iv = Crypto.enc.Utf8.parse(v);
  131. var srcs = word;
  132. var decrypt = Crypto.AES.decrypt(srcs, key, {
  133. iv: iv,
  134. mode: Crypto.mode.CBC,
  135. padding: Crypto.pad.Pkcs7
  136. });
  137. return decrypt.toString(Crypto.enc.Utf8);
  138. }
  139. async function search(wd, quick) {
  140. let data = JSON.parse(await request(HOST + '/index.php/ajax/suggest?mid=1&limit=50&wd=' + wd)).list;
  141. let videos = [];
  142. for (const vod of data) {
  143. videos.push({
  144. vod_id: vod.id,
  145. vod_name: vod.name,
  146. vod_pic: vod.pic,
  147. vod_remarks: '',
  148. });
  149. }
  150. return JSON.stringify({
  151. list: videos,
  152. });
  153. }
  154. export function __jsEvalReturn() {
  155. return {
  156. init: init,
  157. home: home,
  158. homeVod: homeVod,
  159. category: category,
  160. detail: detail,
  161. play: play,
  162. //search: search,
  163. };
  164. }