腾讯视频.js 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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+Gc+r83sWVp1eVttl4Dluk1h93YubWZVw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WYkwMSX2KjQVrGnMoamPKDLQfVqDh5gjjcpF6Xtyi6tU02uhMAyS+8Mw0DbUv8+WzZWknJW5rI7CiSjWWSrP93Pt0hd00OlyOHidDko/78GUJbAqaG7+brtP4M6Yvtk8zH3pmh9JlUeNugnlz7ArC3T0Tkw51xERGJFfqTAnVa87T6T8+WeAZ95FNccnxoMAAwWBIcHAEY7FY9DDUbJbO+KK+zybJg1TmjtCvmUXg83J+CEWk5FI1ooUkdxyltkFdxmj/rOU6jozelIJGNpru1FmpAQ+D37dH7PE4qsvPe7btyftuE5ezknPgriXTvPPidy/H7ELlmd6yTHeEO0wPqH/52C2DoHzvZsqtHdvqAZE5lBiYrGbNZoAWDFnmPBS6uQv/VzT1mjDV/KsWPjV5n9113mwZ8r2V+fSuVIJsQNJ+WjRZmAX5/YBpLUiLYrIVJBvxon+yw2SEPGpYDmLX4dUDzgG5npEyKbwPQnrGepDAP2/09NvcvaIIuCAgUAAA=',
  18. headers: {
  19. 'User-Agent': 'PC_UA'
  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. // 手动调用解析请求json的url,此lazy不方便
  31. 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',
  32. 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  33. 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  34. 二级: $js.toString(() => {
  35. VOD = {};
  36. let d = [];
  37. let video_list = [];
  38. let video_lists = [];
  39. let list = [];
  40. let QZOutputJson;
  41. let html = fetch(input, fetch_params);
  42. let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
  43. let cid = sourceId;
  44. let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
  45. log("详情页:" + detailUrl);
  46. pdfh = jsp.pdfh;
  47. pd = jsp.pd;
  48. try {
  49. let json = JSON.parse(html);
  50. VOD = {
  51. vod_url: input,
  52. vod_name: json.c.title,
  53. type_name: json.typ.join(","),
  54. vod_actor: json.nam.join(","),
  55. vod_year: json.c.year,
  56. vod_content: json.c.description,
  57. vod_remarks: json.rec,
  58. vod_pic: urljoin2(input, json.c.pic)
  59. }
  60. } catch (e) {
  61. log("解析片名海报等基础信息发生错误:" + e.message)
  62. }
  63. if (/get_playsource/.test(input)) {
  64. eval(html);
  65. let indexList = QZOutputJson.PlaylistItem.indexList;
  66. indexList.forEach(function (it) {
  67. 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";
  68. eval(fetch(dataUrl, fetch_params));
  69. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  70. vdata.forEach(function (item) {
  71. d.push({
  72. title: item.title,
  73. pic_url: item.pic,
  74. desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
  75. url: item.playUrl
  76. })
  77. });
  78. video_lists = video_lists.concat(vdata)
  79. })
  80. } else {
  81. let json = JSON.parse(html);
  82. video_lists = json.c.video_ids;
  83. let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
  84. if (video_lists.length === 1) {
  85. let vid = video_lists[0];
  86. url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
  87. d.push({
  88. title: "在线播放",
  89. url: url
  90. })
  91. } else if (video_lists.length > 1) {
  92. for (let i = 0; i < video_lists.length; i += 30) {
  93. video_list.push(video_lists.slice(i, i + 30))
  94. }
  95. video_list.forEach(function (it, idex) {
  96. 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(",");
  97. let o_html = fetch(o_url, fetch_params);
  98. eval(o_html);
  99. QZOutputJson.results.forEach(function (it1) {
  100. it1 = it1.fields;
  101. let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
  102. d.push({
  103. title: it1.title,
  104. pic_url: it1.pic160x90.replace("/160", ""),
  105. desc: it1.video_checkup_time,
  106. url: url,
  107. type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
  108. })
  109. })
  110. })
  111. }
  112. }
  113. let yg = d.filter(function (it) {
  114. return it.type && it.type !== "正片"
  115. });
  116. let zp = d.filter(function (it) {
  117. return !(it.type && it.type !== "正片")
  118. });
  119. VOD.vod_play_from = yg.length < 1 ? "qq" : "qq$$$qq 预告及花絮";
  120. VOD.vod_play_url = yg.length < 1 ? d.map(function (it) {
  121. return it.title + "$" + it.url
  122. }).join("#") : [zp, yg].map(function (it) {
  123. return it.map(function (its) {
  124. return its.title + "$" + its.url
  125. }).join("#")
  126. }).join("$$$");
  127. }),
  128. 搜索: $js.toString(() => {
  129. let d = [];
  130. pdfa = jsp.pdfa;
  131. pdfh = jsp.pdfh;
  132. pd = jsp.pd;
  133. let html = request(input);
  134. let baseList = pdfa(html, "body&&.result_item_v");
  135. log(baseList.length);
  136. baseList.forEach(function (it) {
  137. let longText = pdfh(it, ".result_title&&a&&Text");
  138. let shortText = pdfh(it, ".type&&Text");
  139. let fromTag = pdfh(it, ".result_source&&Text");
  140. let score = pdfh(it, ".figure_info&&Text");
  141. let content = pdfh(it, ".desc_text&&Text");
  142. // let url = pdfh(it, ".result_title&&a&&href");
  143. let url = pdfh(it, "div&&r-data");
  144. // log(longText);
  145. // log(shortText);
  146. // log('url:'+url);
  147. let img = pd(it, ".figure_pic&&src");
  148. url = "https://node.video.qq.com/x/api/float_vinfo2?cid=" + url.match(/.*\/(.*?)\.html/)[1];
  149. log(shortText + "|" + url);
  150. if (fromTag.match(/腾讯/)) {
  151. d.push({
  152. title: longText.split(shortText)[0],
  153. img: img,
  154. url: url,
  155. content: content,
  156. desc: shortText + " " + score
  157. })
  158. }
  159. });
  160. setResult(d);
  161. }),
  162. }