荐片.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. var rule = {
  2. title: '荐片',
  3. //host: 'http://api2.rinhome.com',
  4. host:'http://api2.a.jhuunrf.cn',
  5. //host:'http://api2.shifen.me',
  6. homeUrl: '/api/tag/hand?code=unknown601193cf375db73d&channel=wandoujia',//网站的首页链接,用于分类获取和推荐获取
  7. // url:'/api/crumb/list?area=0&category_id=fyclass&page=fypage&type=0&limit=24&fyfilter',
  8. url: '/api/crumb/list?page=fypage&type=0&limit=24&fyfilter',
  9. class_name: '电视剧&电影&综艺&动漫', // 筛选 /api/term/ad_fenlei?limit=10&page=1
  10. class_url: '2&1&4&3',
  11. detailUrl: '/api/node/detail?channel=wandoujia&token=&id=fyid',//二级详情拼接链接(json格式用)
  12. searchUrl: '/api/video/search?key=**&page=fypage',
  13. searchable: 2,
  14. quickSearch: 0,
  15. filterable: 1,
  16. filter: {
  17. "0":[{"key":"area","name":"地区","value":[{"n":"全部","v":"0"},{"n":"国产","v":"1"},{"n":"中国香港","v":"3"},{"n":"中国台湾","v":"6"},{"n":"美国","v":"5"},{"n":"韩国","v":"18"},{"n":"日本","v":"2"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":"0"},{"n":"2023","v":"153"},{"n":"2022","v":"101"},{"n":"2021","v":"118"},{"n":"2020","v":"16"},{"n":"2019","v":"7"},{"n":"2018","v":"2"},{"n":"2017","v":"3"},{"n":"2016","v":"22"}]},{"key":"sort","name":"排序","value":[{"n":"热门","v":"hot"},{"n":"评分","v":"rating"},{"n":"更新","v":"update"}]}],
  18. "1":[{"key":"cateId","name":"分类","value":[{"n":"全部","v":"1"},{"n":"首推","v":"5"},{"n":"动作","v":"6"},{"n":"喜剧","v":"7"},{"n":"战争","v":"8"},{"n":"恐怖","v":"9"},{"n":"剧情","v":"10"},{"n":"爱情","v":"11"},{"n":"科幻","v":"12"},{"n":"动画","v":"13"}]},{"key":"area","name":"地區","value":[{"n":"全部","v":"0"},{"n":"国产","v":"1"},{"n":"中国香港","v":"3"},{"n":"中国台湾","v":"6"},{"n":"美国","v":"5"},{"n":"韩国","v":"18"},{"n":"日本","v":"2"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":"0"},{"n":"2023","v":"153"},{"n":"2022","v":"101"},{"n":"2021","v":"118"},{"n":"2020","v":"16"},{"n":"2019","v":"7"},{"n":"2018","v":"2"},{"n":"2017","v":"3"},{"n":"2016","v":"22"}]},{"key":"sort","name":"排序","value":[{"n":"热门","v":"hot"},{"n":"评分","v":"rating"},{"n":"更新","v":"update"}]}],
  19. "2":[{"key":"cateId","name":"分类","value":[{"n":"全部","v":"2"},{"n":"首推","v":"14"},{"n":"国产","v":"15"},{"n":"港台","v":"16"},{"n":"日韩","v":"17"},{"n":"海外","v":"18"}]},{"key":"area","name":"地區","value":[{"n":"全部","v":"0"},{"n":"国产","v":"1"},{"n":"中国香港","v":"3"},{"n":"中国台湾","v":"6"},{"n":"美国","v":"5"},{"n":"韩国","v":"18"},{"n":"日本","v":"2"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":"0"},{"n":"2023","v":"153"},{"n":"2022","v":"101"},{"n":"2021","v":"118"},{"n":"2020","v":"16"},{"n":"2019","v":"7"},{"n":"2018","v":"2"},{"n":"2017","v":"3"},{"n":"2016","v":"22"}]},{"key":"sort","name":"排序","value":[{"n":"热门","v":"hot"},{"n":"评分","v":"rating"},{"n":"更新","v":"update"}]}],
  20. "3":[{"key":"cateId","name":"分类","value":[{"n":"全部","v":"3"},{"n":"首推","v":"19"},{"n":"海外","v":"20"},{"n":"日本","v":"21"},{"n":"国产","v":"22"}]},{"key":"area","name":"地區","value":[{"n":"全部","v":"0"},{"n":"国产","v":"1"},{"n":"中国香港","v":"3"},{"n":"中国台湾","v":"6"},{"n":"美国","v":"5"},{"n":"韩国","v":"18"},{"n":"日本","v":"2"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":"0"},{"n":"2023","v":"153"},{"n":"2022","v":"101"},{"n":"2021","v":"118"},{"n":"2020","v":"16"},{"n":"2019","v":"7"},{"n":"2018","v":"2"},{"n":"2017","v":"3"},{"n":"2016","v":"22"}]},{"key":"sort","name":"排序","value":[{"n":"热门","v":"hot"},{"n":"评分","v":"rating"},{"n":"更新","v":"update"}]}],
  21. "4":[{"key":"cateId","name":"分类","value":[{"n":"全部","v":"4"},{"n":"首推","v":"23"},{"n":"国产","v":"24"},{"n":"海外","v":"25"},{"n":"港台","v":"26"}]},{"key":"area","name":"地區","value":[{"n":"全部","v":"0"},{"n":"国产","v":"1"},{"n":"中国香港","v":"3"},{"n":"中国台湾","v":"6"},{"n":"美国","v":"5"},{"n":"韩国","v":"18"},{"n":"日本","v":"2"}]},{"key":"year","name":"年代","value":[{"n":"全部","v":"0"},{"n":"2023","v":"153"},{"n":"2022","v":"101"},{"n":"2021","v":"118"},{"n":"2020","v":"16"},{"n":"2019","v":"7"},{"n":"2018","v":"2"},{"n":"2017","v":"3"},{"n":"2016","v":"22"}]},{"key":"sort","name":"排序","value":[{"n":"热门","v":"hot"},{"n":"评分","v":"rating"},{"n":"更新","v":"update"}]}]
  22. },
  23. filter_url: 'area={{fl.area or "0"}}&sort={{fl.sort or "update"}}&year={{fl.year or "0"}}&category_id={{fl.cateId}}',
  24. filter_def: {
  25. 0:{cateId:'0'},
  26. 1:{cateId:'1'},
  27. 2:{cateId:'2'},
  28. 3:{cateId:'3'},
  29. 4:{cateId:'4'}
  30. },
  31. headers: {
  32. 'User-Agent': 'jianpian-android/350',
  33. 'JPAUTH': 'y261ow7kF2dtzlxh1GS9EB8nbTxNmaK/QQIAjctlKiEv'
  34. },
  35. timeout: 5000,
  36. limit: 8,
  37. play_parse: true,
  38. play_json: [{
  39. re: '*',
  40. json: {
  41. parse: 0,
  42. jx: 0
  43. }
  44. }],
  45. lazy: '',
  46. 图片来源: '@Referer=www.jianpianapp.com@User-Agent=jianpian-version353',
  47. // 推荐:'json:.video;*;*;*;*',
  48. 推荐: `js:
  49. var d = [];
  50. let html = request(input);
  51. html = JSON.parse(html).data[0].video;
  52. html.forEach(it => {
  53. d.push({
  54. title: it.title,
  55. img: it.path,
  56. desc: it.playlist.title + ' ⭐' + it.score,
  57. url: it.id
  58. })
  59. });
  60. setResult(d);
  61. `,
  62. // 一级:'json:data;title;path;playlist.title;id',
  63. 一级: `js:
  64. if (cateObj.tid.endsWith('_clicklink')) {
  65. cateObj.tid = cateObj.tid.split('_')[0];
  66. input = HOST + '/api/video/search?key=' + cateObj.tid + '&page=' + + MY_PAGE;
  67. }
  68. var d = [];
  69. let html = request(input);
  70. html = JSON.parse(html).data;
  71. html.forEach(it => {
  72. d.push({
  73. title: it.title,
  74. img: it.thumbnail||it.path,
  75. desc: (it.mask || it.playlist.title) + ' ⭐' + it.score,
  76. url: it.id
  77. })
  78. });
  79. setResult(d);
  80. `,
  81. 二级: `js:
  82. function getLink(data) {
  83. let link = data.map(it => {
  84. return '[a=cr:' + JSON.stringify({'id':it.name+'_clicklink','name':it.name}) + '/]' + it.name + '[/a]'
  85. }).join(', ');
  86. return link
  87. }
  88. try {
  89. let html = request(input);
  90. html = JSON.parse(html);
  91. let node = html.data;
  92. VOD = {
  93. vod_id: node.id,
  94. vod_name: node.title,
  95. vod_pic: node.thumbnail,
  96. type_name: node.types[0].name,
  97. vod_year: node.year.title,
  98. vod_area: node.area.title,
  99. vod_remarks: node.score,
  100. vod_actor: getLink(node.actors),
  101. vod_director: getLink(node.directors),
  102. vod_content: node.description.strip()
  103. };
  104. if (typeof play_url === 'undefined') {
  105. var play_url = ''
  106. }
  107. let playMap = {};
  108. if (node.have_ftp_ur == 1) {
  109. playMap["边下边播超清版"] = node.new_ftp_list.map(it => {
  110. return it.title + "$" + (/m3u8/.test(it.url) ? play_url + it.url : "tvbox-xg:" + it.url)
  111. }).join('#');
  112. }
  113. if (node.have_m3u8_ur == 1) {
  114. playMap["在线点播普清版"] = node.new_m3u8_list.map(it => {
  115. return it.title + "$" + (/m3u8/.test(it.url) ? play_url + it.url : "tvbox-xg:" + it.url)
  116. }).join('#');
  117. }
  118. let playFrom = [];
  119. let playList = [];
  120. Object.keys(playMap).forEach(key => {
  121. playFrom.append(key);
  122. playList.append(playMap[key])
  123. });
  124. VOD.vod_play_from = playFrom.join('$$$');
  125. VOD.vod_play_url = playList.join('$$$');
  126. } catch (e) {
  127. log("获取二级详情页发生错误:" + e.message);
  128. }
  129. `,
  130. // 搜索:'json:data;*;thumbnail;mask;*',
  131. 搜索: `js:
  132. var d = [];
  133. let html = request(input);
  134. html = JSON.parse(html).data;
  135. html.forEach(it => {
  136. d.push({
  137. title: it.title,
  138. img: it.thumbnail,
  139. desc: it.mask + ' ⭐' + it.score,
  140. url: it.id
  141. })
  142. });
  143. setResult(d);
  144. `,
  145. }