荐片.js 8.2 KB

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