腾讯视频.js 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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. searchUrl: 'https://pbaccess.video.%71%71.com/trpc.videosearch.smartboxServer.HttpRountRecall/Smartbox?query=**&appID=3172&appKey=lGhFIPeD3HsO9xEp&pageNum=(fypage-1)&pageSize=10',
  9. searchable: 2,
  10. filterable: 1,
  11. multi: 1,
  12. // url:'/channel/fyclass?listpage=fypage&channel=fyclass&sort=18&_all=1',
  13. url: '/x/bu/pagesheet/list?_all=1&append=1&channel=fyclass&listpage=1&offset=((fypage-1)*21)&pagesize=21&iarea=-1',
  14. // filter_url: 'sort={{fl.sort or 18}}&year={{fl.year}}&pay={{fl.pay}}',
  15. // filter_url: 'sort={{fl.sort or 75}}&year={{fl.year}}&pay={{fl.pay}}',
  16. 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}}',
  17. // filter: 'H4sIAAAAAAAAA+2UzUrDQBCA32XOEZLUJrGvIj0saaDBNisxBkIJCG3Fi4oepIg3EQoieqiH+vM23Zq+hRuaZLZ4ce9z2/lmd2d2+NgR+H0e+gF0DkdwFGTQgR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FiuG7vnxp7RIiE9OtuX1naDdM23l0rLuBaJhsNTv5JxtYiuoWwVauSl0XO2SCrJbkjrDl0v0cKhvO4c7lutrNTpJHlqNjj5DV3hOMBLAeJozMNQYCK1IetSq86bD5LRjHlpng8VlIGVonWYkwMSX2KjQVrGnMoamPKDLQfVqDh5gjjcpF6Xtyi6tU02uhMAyS+8Mw0DbUv8+WzZWknJW5rI7CiSjWWSrP93Pt0hd00OlyOHidDko/78GUJbAqaG7+brtP4M6Yvtk8zH3pmh9JlUeNugnlz7ArC3T0Tkw51xERGJFfqTAnVa87T6T8+WeAZ95FNccnxoMAAwWBIcHAEY7FY9DDUbJbO+KK+zybJg1TmjtCvmUXg83J+CEWk5FI1ooUkdxyltkFdxmj/rOU6jozelIJGNpru1FmpAQ+D37dH7PE4qsvPe7btyftuE5ezknPgriXTvPPidy/H7ELlmd6yTHeEO0wPqH/52C2DoHzvZsqtHdvqAZE5lBiYrGbNZoAWDFnmPBS6uQv/VzT1mjDV/KsWPjV5n9113mwZ8r2V+fSuVIJsQNJ+WjRZmAX5/YBpLUiLYrIVJBvxon+yw2SEPGpYDmLX4dUDzgG5npEyKbwPQnrGepDAP2/09NvcvaIIuCAgUAAA=',
  19. headers: {
  20. 'User-Agent': 'PC_UA'
  21. },
  22. timeout: 5000,
  23. // class_parse:'.site_channel a;a&&Text;a&&href;channel/(.*)',
  24. cate_exclude: '会员|游戏|全部',
  25. // class_name: '精选&电视剧&电影&综艺&动漫&少儿&纪录片',
  26. // class_url: 'choice&tv&movie&variety&cartoon&child&doco',
  27. class_name: '精选&电影&电视剧&综艺&动漫&少儿&纪录片',
  28. class_url: 'choice&movie&tv&variety&cartoon&child&doco',
  29. limit: 20,
  30. // play_parse:true,
  31. // 手动调用解析请求json的url,此lazy不方便
  32. lazy: 'js:input="https://cache.json.icu/home/api?type=ys&uid=292796&key=fnoryABDEFJNPQV269&url="+input.split("?")[0];log(input);let html=JSON.parse(request(input));log(html);input=html.url||input',
  33. 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  34. 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  35. 二级: $js.toString(() => {
  36. VOD = {};
  37. let d = [];
  38. let video_list = [];
  39. let video_lists = [];
  40. let list = [];
  41. let QZOutputJson;
  42. let html = fetch(input, fetch_params);
  43. let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
  44. let cid = sourceId;
  45. let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
  46. log("详情页:" + detailUrl);
  47. pdfh = jsp.pdfh;
  48. pd = jsp.pd;
  49. try {
  50. let json = JSON.parse(html);
  51. VOD = {
  52. vod_url: input,
  53. vod_name: json.c.title,
  54. type_name: json.typ.join(","),
  55. vod_actor: json.nam.join(","),
  56. vod_year: json.c.year,
  57. vod_content: json.c.description,
  58. vod_remarks: json.rec,
  59. vod_pic: urljoin2(input, json.c.pic)
  60. }
  61. } catch (e) {
  62. log("解析片名海报等基础信息发生错误:" + e.message)
  63. }
  64. if (/get_playsource/.test(input)) {
  65. eval(html);
  66. let indexList = QZOutputJson.PlaylistItem.indexList;
  67. indexList.forEach(function (it) {
  68. 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";
  69. eval(fetch(dataUrl, fetch_params));
  70. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  71. vdata.forEach(function (item) {
  72. d.push({
  73. title: item.title,
  74. pic_url: item.pic,
  75. desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
  76. url: item.playUrl
  77. })
  78. });
  79. video_lists = video_lists.concat(vdata)
  80. })
  81. } else {
  82. let json = JSON.parse(html);
  83. video_lists = json.c.video_ids;
  84. let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
  85. if (video_lists.length === 1) {
  86. let vid = video_lists[0];
  87. url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
  88. d.push({
  89. title: "在线播放",
  90. url: url
  91. })
  92. } else if (video_lists.length > 1) {
  93. for (let i = 0; i < video_lists.length; i += 30) {
  94. video_list.push(video_lists.slice(i, i + 30))
  95. }
  96. video_list.forEach(function (it, idex) {
  97. 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(",");
  98. let o_html = fetch(o_url, fetch_params);
  99. eval(o_html);
  100. QZOutputJson.results.forEach(function (it1) {
  101. it1 = it1.fields;
  102. let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
  103. d.push({
  104. title: it1.title,
  105. pic_url: it1.pic160x90.replace("/160", ""),
  106. desc: it1.video_checkup_time,
  107. url: url,
  108. type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
  109. })
  110. })
  111. })
  112. }
  113. }
  114. let yg = d.filter(function (it) {
  115. return it.type && it.type !== "正片"
  116. });
  117. let zp = d.filter(function (it) {
  118. return !(it.type && it.type !== "正片")
  119. });
  120. VOD.vod_play_from = yg.length < 1 ? "qq" : "qq$$$qq 预告及花絮";
  121. VOD.vod_play_url = yg.length < 1 ? d.map(function (it) {
  122. return it.title + "$" + it.url
  123. }).join("#") : [zp, yg].map(function (it) {
  124. return it.map(function (its) {
  125. return its.title + "$" + its.url
  126. }).join("#")
  127. }).join("$$$");
  128. }),
  129. 搜索: $js.toString(() => {
  130. let d = [];
  131. pdfa = jsp.pdfa;
  132. pdfh = jsp.pdfh;
  133. pd = jsp.pd;
  134. let html = request(input);
  135. let baseList = pdfa(html, "body&&.result_item_v");
  136. log(baseList.length);
  137. baseList.forEach(function (it) {
  138. let longText = pdfh(it, ".result_title&&a&&Text");
  139. let shortText = pdfh(it, ".type&&Text");
  140. let fromTag = pdfh(it, ".result_source&&Text");
  141. let score = pdfh(it, ".figure_info&&Text");
  142. let content = pdfh(it, ".desc_text&&Text");
  143. // let url = pdfh(it, ".result_title&&a&&href");
  144. let url = pdfh(it, "div&&r-data");
  145. // log(longText);
  146. // log(shortText);
  147. // log('url:'+url);
  148. let img = pd(it, ".figure_pic&&src");
  149. url = "https://node.video.qq.com/x/api/float_vinfo2?cid=" + url.match(/.*\/(.*?)\.html/)[1];
  150. log(shortText + "|" + url);
  151. if (fromTag.match(/腾讯/)) {
  152. d.push({
  153. title: longText.split(shortText)[0],
  154. img: img,
  155. url: url,
  156. content: content,
  157. desc: shortText + " " + score
  158. })
  159. }
  160. });
  161. setResult(d);
  162. }),
  163. 搜索: $js.toString(() => {
  164. let d = [];
  165. let html = request(input);
  166. let json = JSON.parse(html);
  167. if (json.data.smartboxItemList.length > 0) {
  168. let cid = json.data.smartboxItemList[0].basicDoc.id;
  169. let url = 'https://node.video.qq.com/x/api/float_vinfo2?cid=' + cid;
  170. let html1 = request(url);
  171. let data = JSON.parse(html1);
  172. d.push({
  173. title: data.c.title,
  174. img: data.c.pic,
  175. url: url,
  176. content: data.c.description,
  177. desc: data.rec
  178. });
  179. }
  180. setResult(d);
  181. })
  182. }