tengxun.js 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. var rule = {
  2. title: '腾云驾雾[官]',
  3. host: 'https://v.%71%71.com',
  4. // homeUrl: '/x/bu/pagesheet/list?_all=1&append=1&channel=choice&listpage=1&offset=0&pagesize=21&iarea=-1&sort=18',
  5. homeUrl: '/x/bu/pagesheet/list?_all=1&append=1&channel=cartoon&listpage=1&offset=0&pagesize=21&iarea=-1&sort=18',
  6. detailUrl: 'https://node.video.%71%71.com/x/api/float_vinfo2?cid=fyid',
  7. searchUrl: '/x/search/?q=**&stag=fypage',
  8. searchable: 2,
  9. filterable: 1,
  10. multi: 1,
  11. // url:'/channel/fyclass?listpage=fypage&channel=fyclass&sort=18&_all=1',
  12. url: '/x/bu/pagesheet/list?_all=1&append=1&channel=fyclass&listpage=1&offset=((fypage-1)*21)&pagesize=21&iarea=-1',
  13. // filter_url: 'sort={{fl.sort or 18}}&year={{fl.year}}&pay={{fl.pay}}',
  14. // filter_url: 'sort={{fl.sort or 75}}&year={{fl.year}}&pay={{fl.pay}}',
  15. filter_url: 'sort={{fl.sort or 75}}&iyear={{fl.iyear}}&year={{fl.year}}&itype={{fl.type}}&ifeature={{fl.feature}}&iarea={{fl.area}}&itrailer={{fl.itrailer}}&gender={{fl.sex}}',
  16. // filter: 'H4sIAAAAAAAAA+2UzUrDQBCA32XOEZLUJrGvIj0saaDBNisxBkIJCG3Fi4oepIg3EQoieqiH+vM23Zq+hRuaZLZ4ce9z2/lmd2d2+NgR+H0e+gF0DkdwFGTQgRMeJ2BAxIaSwvrqVnxcyzhlg9PttqjED2c/45cSy8DyIDcavr57q/lBw8XTd/E6qbnT8M3zTFyc72RtC/Jumd+2c8wy7KZ4nxSL5Z9uxHS+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MNQYCK1IetSq86bD5LRjHlpng8VlIGVonWYkwMSX2KjQVrGnMoamPKDLQfVqDh5gjjcpF6Xtyi6tU02uhMAyS+8Mw0DbUv8+WzZWknJW5rI7CiSjWWSrP93Pt0hd00OlyOHidDko/78GUJbAqaG7+brtP4M6Yvtk8zH3pmh9JlUeNugnlz7ArC3T0Tkw51xERGJFfqTAnVa87T6T8+WeAZ95FNccnxoMAAwWBIcHAEY7FY9DDUbJbO+KK+zybJg1TmjtCvmUXg83J+CEWk5FI1ooUkdxyltkFdxmj/rOU6jozelIJGNpru1FmpAQ+D37dH7PE4qsvPe7btyftuE5ezknPgriXTvPPidy/H7ELlmd6yTHeEO0wPqH/52C2DoHzvZsqtHdvqAZE5lBiYrGbNZoAWDFnmPBS6uQv/VzT1mjDV/KsWPjV5n9113mwZ8r2V+fSuVIJsQNJ+WjRZmAX5/YBpLUiLYrIVJBvxon+yw2SEPGpYDmLX4dUDzgG5npEyKbwPQnrGepDAP2/09NvcvaIIuCAgUAAA=',
  18. headers: {
  19. 'User-Agent': 'okhttp/4.12.0'
  20. },
  21. timeout: 5000,
  22. // class_parse:'.site_channel a;a&&Text;a&&href;channel/(.*)',
  23. cate_exclude: '会员|游戏|全部',
  24. // class_name: '精选&电视剧&电影&综艺&动漫&少儿&纪录片',
  25. // class_url: 'choice&tv&movie&variety&cartoon&child&doco',
  26. class_name: '精选&电影&电视剧&综艺&动漫&少儿&纪录片',
  27. class_url: 'choice&movie&tv&variety&cartoon&child&doco',
  28. limit: 20,
  29. play_parse:true,
  30. // play_parse:true,
  31. lazy: $js.toString(() => {
  32. let d = [];
  33. // 发起请求并解析返回的 JSON 数据
  34. let response = JSON.parse(request("" + input));
  35. // 获取所有字段名
  36. let keys = Object.keys(response);
  37. // 查找以 'url' 开头的字段名
  38. let urlKey = keys.find(key => key.startsWith('url'));
  39. // 提取对应的值
  40. let url = urlKey ? response[urlKey] : null;
  41. if (url) {
  42. // 处理 url,或将其用于 input
  43. input = {
  44. url: url,
  45. parse: 0,
  46. header: rule.headers
  47. };
  48. } else {
  49. // 处理没有找到 url 字段的情况
  50. console.error("没有找到以 'url' 开头的字段");
  51. }
  52. setResult(d);
  53. }),
  54. 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  55. 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  56. 二级: $js.toString(() => {
  57. VOD = {};
  58. let d = [];
  59. let video_list = [];
  60. let video_lists = [];
  61. let list = [];
  62. let QZOutputJson;
  63. let html = fetch(input, fetch_params);
  64. let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
  65. let cid = sourceId;
  66. let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
  67. log("详情页:" + detailUrl);
  68. pdfh = jsp.pdfh;
  69. pd = jsp.pd;
  70. try {
  71. let json = JSON.parse(html);
  72. VOD = {
  73. vod_url: input,
  74. vod_name: json.c.title,
  75. type_name: json.typ.join(","),
  76. vod_actor: json.nam.join(","),
  77. vod_year: json.c.year,
  78. vod_content: json.c.description,
  79. vod_remarks: json.rec,
  80. vod_pic: urljoin2(input, json.c.pic)
  81. }
  82. } catch (e) {
  83. log("解析片名海报等基础信息发生错误:" + e.message)
  84. }
  85. if (/get_playsource/.test(input)) {
  86. eval(html);
  87. let indexList = QZOutputJson.PlaylistItem.indexList;
  88. indexList.forEach(function (it) {
  89. let dataUrl = "https://s.video.qq.com/get_playsource?id=" + sourceId + "&plat=2&type=4&data_type=3&range=" + it + "&video_type=10&plname=qq&otype=json";
  90. eval(fetch(dataUrl, fetch_params));
  91. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  92. vdata.forEach(function (item) {
  93. d.push({
  94. title: item.title,
  95. pic_url: item.pic,
  96. desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
  97. url: item.playUrl
  98. })
  99. });
  100. video_lists = video_lists.concat(vdata)
  101. })
  102. } else {
  103. let json = JSON.parse(html);
  104. video_lists = json.c.video_ids;
  105. let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
  106. if (video_lists.length === 1) {
  107. let vid = video_lists[0];
  108. url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
  109. d.push({
  110. title: "在线播放",
  111. url: url
  112. })
  113. } else if (video_lists.length > 1) {
  114. for (let i = 0; i < video_lists.length; i += 30) {
  115. video_list.push(video_lists.slice(i, i + 30))
  116. }
  117. video_list.forEach(function (it, idex) {
  118. let o_url = "https://union.video.qq.com/fcgi-bin/data?otype=json&tid=1804&appid=20001238&appkey=6c03bbe9658448a4&union_platform=1&idlist=" + it.join(",");
  119. let o_html = fetch(o_url, fetch_params);
  120. eval(o_html);
  121. QZOutputJson.results.forEach(function (it1) {
  122. it1 = it1.fields;
  123. let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
  124. d.push({
  125. title: it1.title,
  126. pic_url: it1.pic160x90.replace("/160", ""),
  127. desc: it1.video_checkup_time,
  128. url: url,
  129. type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
  130. })
  131. })
  132. })
  133. }
  134. }
  135. let yg = d.filter(function (it) {
  136. return it.type && it.type !== "正片"
  137. });
  138. let zp = d.filter(function (it) {
  139. return !(it.type && it.type !== "正片")
  140. });
  141. VOD.vod_play_from = yg.length < 1 ? "腾讯视频" : "腾讯视频$$$腾讯视频 预告及花絮";
  142. VOD.vod_play_url = yg.length < 1 ? d.map(function (it) {
  143. return it.title + "$" + it.url
  144. }).join("#") : [zp, yg].map(function (it) {
  145. return it.map(function (its) {
  146. return its.title + "$" + its.url
  147. }).join("#")
  148. }).join("$$$");
  149. }),
  150. 搜索: $js.toString(() => {
  151. let d = [];
  152. pdfa = jsp.pdfa;
  153. pdfh = jsp.pdfh;
  154. pd = jsp.pd;
  155. let html = request(input);
  156. let baseList = pdfa(html, "body&&.result_item_v");
  157. log(baseList.length);
  158. baseList.forEach(function (it) {
  159. let longText = pdfh(it, ".result_title&&a&&Text");
  160. let shortText = pdfh(it, ".type&&Text");
  161. let fromTag = pdfh(it, ".result_source&&Text");
  162. let score = pdfh(it, ".figure_info&&Text");
  163. let content = pdfh(it, ".desc_text&&Text");
  164. // let url = pdfh(it, ".result_title&&a&&href");
  165. let url = pdfh(it, "div&&r-data");
  166. // log(longText);
  167. // log(shortText);
  168. // log('url:'+url);
  169. let img = pd(it, ".figure_pic&&src");
  170. url = "https://node.video.qq.com/x/api/float_vinfo2?cid=" + url.match(/.*\/(.*?)\.html/)[1];
  171. log(shortText + "|" + url);
  172. if (fromTag.match(/腾讯/)) {
  173. d.push({
  174. title: longText.split(shortText)[0],
  175. img: img,
  176. url: url,
  177. content: content,
  178. desc: shortText + " " + score
  179. })
  180. }
  181. });
  182. setResult(d);
  183. }),
  184. }