ikanbot3.js 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. var 二级=`js:
  2. try {
  3. VOD={};
  4. let html1 = request(input);
  5. pdfh = jsp.pdfh;
  6. VOD.vod_id = pdfh(html1, "#current_id&&value");
  7. VOD.vod_name = pdfh(html1, "h2&&Text");
  8. // VOD.vod_pic = pdfh(html1, ".item-root&&img&&src");
  9. VOD.vod_pic = pdfh(html1, ".item-root&&img&&data-src");
  10. // VOD.vod_actor = pdfh(html1, ".celebrity&&Text");
  11. VOD.vod_actor = pdfh(html1, ".meta:eq(4)&&Text");
  12. // VOD.vod_area = pdfh(html1, ".country&&Text");
  13. VOD.vod_area = pdfh(html1, ".meta:eq(3)&&Text");
  14. // VOD.vod_year = pdfh(html1, ".year&&Text");
  15. VOD.vod_year = pdfh(html1, ".meta:eq(2)&&Text");
  16. VOD.vod_remarks = "";
  17. VOD.vod_director = "";
  18. VOD.vod_content = "";
  19. log(VOD);
  20. var v_tks = '';
  21. // let script = pdfa(html1,'script').find(it=>it.includes('v_tks+=')).replace(/<script>|<\\/script>/g,'');
  22. // eval(script);
  23. input = "https://www.ikanbot.com/api/getResN?videoId=" + input.split("/").pop() + "&mtype=2&token="+v_tks;
  24. // input = "https://www.ikanbot.com/api/getResN?videoId=" + input.split("/").pop() + "&mtype=2";
  25. let html = request(input, {
  26. headers: {
  27. // 'User-Agent':'PC_UA',
  28. // 'User-Agent':'MOBILE_UA',
  29. 'User-Agent':'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',
  30. 'Referer': input,
  31. }
  32. });
  33. print(html);
  34. html = JSON.parse(html);
  35. let episodes = html.data.list;
  36. let playMap = {};
  37. if (typeof play_url === "undefined") {
  38. var play_url = ""
  39. }
  40. let map = {}
  41. let arr = []
  42. episodes.forEach(function(ep) {
  43. let data = JSON.parse(ep["resData"]);
  44. data.map(val => {
  45. if(!map[val.flag]){
  46. map[val.flag] = [val.url.replaceAll('##','#')]
  47. } else {
  48. map[val.flag].push(val.url.replaceAll('##','#'))
  49. }
  50. })
  51. });
  52. for(var key in map){
  53. if('kuaikan'==key){
  54. arr.push({
  55. flag: '快看',
  56. url: map[key],
  57. sort:1
  58. })}
  59. else if('bfzym3u8'==key){
  60. arr.push({
  61. flag: '暴风',
  62. url: map[key],
  63. sort:2
  64. })}
  65. else if('ffm3u8'==key){
  66. arr.push({
  67. flag: '非凡',
  68. url: map[key],
  69. sort:3
  70. })}
  71. else if('lzm3u8'==key){
  72. arr.push({
  73. flag: '量子',
  74. url: map[key],
  75. sort:4
  76. })}
  77. else{
  78. arr.push({
  79. flag: key,
  80. url: map[key],
  81. sort:5
  82. })}
  83. }
  84. arr.sort((a, b) => a.sort - b.sort);
  85. let playFrom = [];
  86. let playList = [];
  87. arr.map(val => {
  88. playFrom.push(val.flag);
  89. playList.push(val.url);
  90. })
  91. let vod_play_from = playFrom.join("$$$");
  92. let vod_play_url = playList.join("$$$");
  93. VOD["vod_play_from"] = vod_play_from;
  94. VOD["vod_play_url"] = vod_play_url;
  95. log(VOD);
  96. } catch (e) {
  97. log("获取二级详情页发生错误:" + e.message)
  98. }
  99. `;
  100. var rule = {
  101. title:'爱看机器人2',
  102. host:'https://www.ikanbot.com',
  103. url:'/hot/index-fyclass-fyfilter-p-fypage.html[/hot/index-fyclass-fyfilter.html]',
  104. //https://www.ikanbot.com/search?q=%E6%96%97%E7%BD%97%E5%A4%A7&p=2
  105. // searchUrl:'/search?q=**&p=fypage',
  106. // searchUrl:'/search?q=**',
  107. searchUrl:'/search?q=**&p=fypage[/search?q=**]',
  108. searchable:2,
  109. quickSearch:0,
  110. filterable:1,
  111. filter_url:'{{fl.tag}}',
  112. // 图片来源:'@Referer=https://api.douban.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  113. 图片来源:'@Referer=https://www.ikanbot.com/@User-Agent=Mozilla/5.0%20(Windows%20NT%2010.0;%20Win64;%20x64)%20AppleWebKit/537.36%20(KHTML,%20like%20Gecko)%20Chrome/113.0.0.0%20Safari/537.36',
  114. filter:{
  115. "movie":[{"key":"tag","name":"标签","value":[{"n":"热门","v":"热门"},{"n":"最新","v":"最新"},{"n":"经典","v":"经典"},{"n":"豆瓣高分","v":"豆瓣高分"},{"n":"冷门佳片","v":"冷门佳片"},{"n":"华语","v":"华语"},{"n":"欧美","v":"欧美"},{"n":"韩国","v":"韩国"},{"n":"日本","v":"日本"},{"n":"动作","v":"动作"},{"n":"喜剧","v":"喜剧"},{"n":"爱情","v":"爱情"},{"n":"科幻","v":"科幻"},{"n":"悬疑","v":"悬疑"},{"n":"恐怖","v":"恐怖"},{"n":"治愈","v":"治愈"},{"n":"豆瓣top250","v":"豆瓣top250"}]}]
  116. ,"tv":[{"key":"tag","name":"标签","value":[{"n":"热门","v":"热门"},{"n":"美剧","v":"美剧"},{"n":"英剧","v":"英剧"},{"n":"韩剧","v":"韩剧"},{"n":"日剧","v":"日剧"},{"n":"国产剧","v":"国产剧"},{"n":"港剧","v":"港剧"},{"n":"日本动画","v":"日本动画"},{"n":"综艺","v":"综艺"},{"n":"纪录片","v":"纪录片"}]}]
  117. },
  118. filter_def:{
  119. movie:{tag:'热门'},
  120. tv:{tag:'国产剧'},
  121. },
  122. filter获取方法:`
  123. let value = [];
  124. $('ul').eq(2).find('li').each(function() {
  125. // console.log($(this).text());
  126. let n = $(this).text().trim();
  127. value.push({
  128. 'n': n, 'v': n
  129. });
  130. });
  131. // 电影执行:
  132. let data = {'movie': [{'key': 'tag', 'name': '标签', 'value': value}]};
  133. console.log(JSON.stringify(data));
  134. //剧集执行:
  135. let data = {'tv': [{'key': 'tag', 'name': '标签', 'value': value}]};
  136. console.log(JSON.stringify(data));
  137. `,
  138. headers:{'User-Agent':'PC_UA',},
  139. class_name:'电影&剧集',
  140. class_url:'movie&tv',
  141. play_parse:true,
  142. double:true,
  143. 推荐:'.v-list;div.item;*;*;*;*', //这里可以为空,这样点播不会有内容
  144. // 一级:'.v-list&&div.item;p&&Text;img&&src;;a&&href', //一级的内容是推荐或者点播时候的一级匹配
  145. 一级:'.v-list&&div.item;p&&Text;img&&data-src;;a&&href', //一级的内容是推荐或者点播时候的一级匹配
  146. 二级:二级,
  147. // 搜索:'#search-result&&.media;h5&&a&&Text;a&&img&&data-src;.label&&Text;a&&href',//第三个是描述,一般显示更新或者完结
  148. 搜索:'.col-md-8&&.media;h5&&a&&Text;a&&img&&data-src;.label&&Text;a&&href',//第三个是描述,一般显示更新或者完结
  149. }