littleApple_open.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. import { Crypto, load, _ } from 'assets://js/lib/cat.js';
  2. let siteUrl ='http://tipu.xjqxz.top';
  3. let siteKey = '';
  4. let siteType = 0;
  5. let headers = {
  6. 'token2' : 'enxerhSl0jk2TGhbZCygMdwoKqOmyxsk/Kw8tVy4dsRBE1o1xBhWhoFbh98=',
  7. 'token': 'RXQbgQKl3QkFZkIPGwGvH5kofvCokkkn/a893wC2IId7HQFmy0Eh24osz555X12xGVFxQLTaGuBqU/Y7KU4lStp4UjR7giPxdwoTOsU6R3oc4yZZTQc/yTKh1mH3ckZhx6VsQCEoFf6q',
  8. 'version': 'XPGBOX com.phoenix.tv1.3.3',
  9. 'user_id': 'XPGBOX',
  10. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
  11. 'screenx': '1280',
  12. 'screeny': '720',
  13. }
  14. function getHeaders() {
  15. headers['timestamp'] = Math.floor(Date.now() / 1e3);
  16. headers['hash'] = Crypto.MD5('||||DC6FFCB55FA||861824127032820||12702720||Asus/Asus/ASUS_I003DD:7.1.2/20171130.376229:user/release-keysXPGBOX com.phoenix.tv1.3.3'+headers['timestamp']).toString().toLowerCase().substring(8,12);
  17. return headers;
  18. }
  19. async function request(reqUrl, postData, post) {
  20. let res = await req(reqUrl, {
  21. method: post ? 'post' : 'get',
  22. headers: {
  23. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36',
  24. 'Referer': 'http://tipu.xjqxz.top/'
  25. },
  26. data: postData || {},
  27. postType: post ? 'form' : '',
  28. });
  29. let content = res.content;
  30. return content;
  31. }
  32. async function init(cfg) {
  33. siteKey = cfg.skey;
  34. siteType = cfg.stype;
  35. if (cfg.ext) {
  36. siteUrl = cfg.ext;
  37. }
  38. }
  39. async function home(filter) {
  40. let classes = [{
  41. type_id: '1',
  42. type_name: '电影',
  43. },{
  44. type_id: '2',
  45. type_name: '电视'
  46. },{
  47. type_id: '3',
  48. type_name: '综艺'
  49. },{
  50. type_id: '4',
  51. type_name: '动漫'
  52. },{
  53. type_id: '35',
  54. type_name: '直播'
  55. }];
  56. let filterObj = await genFilterObj();
  57. return JSON.stringify({
  58. class: classes,
  59. //filters: filterObj
  60. });
  61. }
  62. async function homeVod() {
  63. }
  64. async function category(tid, pg, filter, ext) {
  65. if (!pg) pg = 1;
  66. if (pg <= 0) pg = 1;
  67. let clazz = ext['class'];
  68. let year = ext['year'];
  69. let area = ext['area'];
  70. let url = `${siteUrl}/api.php/v2.vod/androidfilter10086?page=${pg}&type=${tid}`;
  71. if(clazz) {
  72. url = url + '&class=' + clazz;
  73. }
  74. if (area) {
  75. url = url + '&area=' + area;
  76. }
  77. if(year) {
  78. url = url + 'year=' + year;
  79. }
  80. console.log(url);
  81. let videos = await getVideos(url);
  82. return JSON.stringify({
  83. list: videos,
  84. page: pg,
  85. });
  86. }
  87. async function detail(id) {
  88. try {
  89. const data = JSON.parse(await request(siteUrl + '/api.php/v3.vod/androiddetail2?vod_id=' + id)).data;
  90. const playNameUrls = _.map(data.urls, item => {
  91. return item.key + '$' + item.url;
  92. }).join('#');
  93. const video = {
  94. vod_play_from: 'Leospring',
  95. vod_play_url: playNameUrls,
  96. vod_content: data.content,
  97. vod_director: data.director,
  98. vod_actor: data.actor,
  99. vod_year: data.year,
  100. vod_area: data.area,
  101. vod_type: data.className,
  102. };
  103. const list = [video];
  104. const result = { list };
  105. return JSON.stringify(result);
  106. } catch (e) {
  107. console.log('err', e);
  108. }
  109. return null;
  110. }
  111. async function search(wd, quick, pg) {
  112. let url = siteUrl + `/api.php/v2.vod/androidsearch10086?page=${pg}&wd=${wd}`;
  113. let videos = await getVideos(url);
  114. return JSON.stringify({
  115. list: videos,
  116. });
  117. }
  118. async function play(flag, id, flags) {
  119. return JSON.stringify({
  120. parse: 0,
  121. url: 'http://c.xpgtv.net/m3u8/' + id + '.m3u8',
  122. header: getHeaders(),
  123. });
  124. }
  125. function base64Decode(text) {
  126. return Crypto.enc.Utf8.stringify(Crypto.enc.Base64.parse(text));
  127. }
  128. async function genFilterObj() {
  129. return {
  130. '1': [{'key': 'class', 'name': '类型','value': []},
  131. {'key': 'area', 'name': '地区', 'value': []},
  132. {'key': 'year', 'name': '年份', 'value': []}
  133. ],
  134. '2': [{'key': 'class', 'name': '类型', 'value': []},
  135. {'key': 'area', 'name': '地区', 'value': []},
  136. {'key': 'year', 'name': '年份', 'value': []}
  137. ],
  138. };
  139. }
  140. async function getVideos(url) {
  141. const data = JSON.parse(await request(url)).data;
  142. let videos = _.map(data, (n) => {
  143. return {
  144. vod_id: n.id,
  145. vod_name: n.name,
  146. vod_pic: n.pic,
  147. vod_remarks: n.updateInfo,
  148. };
  149. });
  150. return videos;
  151. }
  152. export function __jsEvalReturn() {
  153. return {
  154. init: init,
  155. home: home,
  156. homeVod: homeVod,
  157. category: category,
  158. detail: detail,
  159. play: play,
  160. search: search,
  161. };
  162. }