腾讯视频.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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: 'H4sIAAAAAAAAA+2UzUrDQBCA32XOEZLUJrGvIj0saaDBNisxBkIJCG3Fi4oepIg3EQoieqiH+vM23Zq+hRuaZLZ4ce9z2/lmd2d2+NgR+H0e+gF0DkdwFGTQgRMeJ2BAxIaSwvrqVnxcyzhlg9PttqjED2c/45cSy8DyIDcavr57q/lBw8XTd/E6qbnT8M3zTFyc72RtC/Jumd+2c8wy7KZ4nxSL5Z9uxHS+Gc+r83sWVp1eVttl4Dluk1h93YubWZVwduplAYuxoFguVp+P/y5om/Z+/YxyqfAW8pbKbeS2yi3kO/ebyE2Fy1nXXBm7DDzknspd5K7KHeSOytvI2+XAugYkKWlD2mhrM+RpSB8OmaNvTsriMEgycofc0XbHZ3HCeUTukDv67vTDQY/MIXO0zelxn5M4JI6mOPkvgswSEpgPAAA=',
  16. headers: {
  17. 'User-Agent': 'PC_UA'
  18. },
  19. timeout: 5000,
  20. // class_parse:'.site_channel a;a&&Text;a&&href;channel/(.*)',
  21. cate_exclude: '会员|游戏|全部',
  22. class_name: '精选&电视剧&电影&综艺&动漫&少儿&纪录片',
  23. class_url: 'choice&tv&movie&variety&cartoon&child&doco',
  24. limit: 20,
  25. // play_parse:true,
  26. // 手动调用解析请求json的url,此lazy不方便
  27. 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',
  28. 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  29. 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  30. 二级: $js.toString(() => {
  31. VOD = {};
  32. let d = [];
  33. let video_list = [];
  34. let video_lists = [];
  35. let list = [];
  36. let QZOutputJson;
  37. let html = fetch(input, fetch_params);
  38. let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
  39. let cid = sourceId;
  40. let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
  41. log("详情页:" + detailUrl);
  42. pdfh = jsp.pdfh;
  43. pd = jsp.pd;
  44. try {
  45. let json = JSON.parse(html);
  46. VOD = {
  47. vod_url: input,
  48. vod_name: json.c.title,
  49. type_name: json.typ.join(","),
  50. vod_actor: json.nam.join(","),
  51. vod_year: json.c.year,
  52. vod_content: json.c.description,
  53. vod_remarks: json.rec,
  54. vod_pic: urljoin2(input, json.c.pic)
  55. }
  56. } catch (e) {
  57. log("解析片名海报等基础信息发生错误:" + e.message)
  58. }
  59. if (/get_playsource/.test(input)) {
  60. eval(html);
  61. let indexList = QZOutputJson.PlaylistItem.indexList;
  62. indexList.forEach(function (it) {
  63. 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";
  64. eval(fetch(dataUrl, fetch_params));
  65. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  66. vdata.forEach(function (item) {
  67. d.push({
  68. title: item.title,
  69. pic_url: item.pic,
  70. desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
  71. url: item.playUrl
  72. })
  73. });
  74. video_lists = video_lists.concat(vdata)
  75. })
  76. } else {
  77. let json = JSON.parse(html);
  78. video_lists = json.c.video_ids;
  79. let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
  80. if (video_lists.length === 1) {
  81. let vid = video_lists[0];
  82. url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
  83. d.push({
  84. title: "在线播放",
  85. url: url
  86. })
  87. } else if (video_lists.length > 1) {
  88. for (let i = 0; i < video_lists.length; i += 30) {
  89. video_list.push(video_lists.slice(i, i + 30))
  90. }
  91. video_list.forEach(function (it, idex) {
  92. 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(",");
  93. let o_html = fetch(o_url, fetch_params);
  94. eval(o_html);
  95. QZOutputJson.results.forEach(function (it1) {
  96. it1 = it1.fields;
  97. let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
  98. d.push({
  99. title: it1.title,
  100. pic_url: it1.pic160x90.replace("/160", ""),
  101. desc: it1.video_checkup_time,
  102. url: url,
  103. type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
  104. })
  105. })
  106. })
  107. }
  108. }
  109. let yg = d.filter(function (it) {
  110. return it.type && it.type !== "正片"
  111. });
  112. let zp = d.filter(function (it) {
  113. return !(it.type && it.type !== "正片")
  114. });
  115. VOD.vod_play_from = yg.length < 1 ? "qq" : "qq$$$qq 预告及花絮";
  116. VOD.vod_play_url = yg.length < 1 ? d.map(function (it) {
  117. return it.title + "$" + it.url
  118. }).join("#") : [zp, yg].map(function (it) {
  119. return it.map(function (its) {
  120. return its.title + "$" + its.url
  121. }).join("#")
  122. }).join("$$$");
  123. }),
  124. 搜索: $js.toString(() => {
  125. let d = [];
  126. pdfa = jsp.pdfa;
  127. pdfh = jsp.pdfh;
  128. pd = jsp.pd;
  129. let html = request(input);
  130. let baseList = pdfa(html, "body&&.result_item_v");
  131. baseList.forEach(function (it) {
  132. let longText = pdfh(it, ".result_title&&a&&Text");
  133. let shortText = pdfh(it, ".type&&Text");
  134. let fromTag = pdfh(it, ".result_source&&Text");
  135. let score = pdfh(it, ".figure_info&&Text");
  136. let content = pdfh(it, ".desc_text&&Text");
  137. let url = pdfh(it, ".result_title&&a&&href");
  138. let img = pd(it, ".figure_pic&&src");
  139. url = "https://node.video.qq.com/x/api/float_vinfo2?cid=" + url.match(/.*\/(.*?)\.html/)[1];
  140. log(shortText + "|" + url);
  141. if (fromTag.match(/腾讯/)) {
  142. d.push({
  143. title: longText.split(shortText)[0],
  144. img: img,
  145. url: url,
  146. content: content,
  147. desc: shortText + " " + score
  148. })
  149. }
  150. });
  151. setResult(d);
  152. }),
  153. }