腾讯弹幕.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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+hRuaZLZ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ZY/YZlwZsfi1kIa34NysEvfIJsIrtZI82/xltsfqFiuG7vnxp7RIiE9OtuX1naDdM23l0rLuBaJhsNTv5JxtYiuoWwVauSl0XO2SCrJbkjrDl0v0cKhvO4c7lutrNTpJHlqNjj5DV3hOMBLAeJozMNQYCK1IetSq86bD5LRjHlpng8VlIGVonWYkwMSX2KjQVrGnMoamPKDLQfVqDh5gjjcpF6Xtyi6tU02uhMAyS+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. play_parse: true,
  33. lazy: $js.toString(() => {
  34. try {
  35. let api = "" + input.split("?")[0];
  36. console.log(api);
  37. let response = fetch(api, {
  38. method: 'get',
  39. headers: {
  40. 'User-Agent': 'okhttp/3.14.9',
  41. 'Content-Type': 'application/x-www-form-urlencoded'
  42. }
  43. });
  44. let bata = JSON.parse(response);
  45. if (bata.url.includes("qq")) {
  46. input = {
  47. parse: 0,
  48. url: bata.url,
  49. jx: 0,
  50. danmaku: "http://43.242.202.175:9595/nnjsdm.php?key=789456123&id=" + input.split("?")[0]
  51. };
  52. } else {
  53. input = {
  54. parse: 0,
  55. url: input.split("?")[0],
  56. jx: 1,
  57. danmaku: "http://43.242.202.175:9595/nnjsdm.php?key=789456123&id=" + input.split("?")[0]
  58. };
  59. }
  60. } catch {
  61. input = {
  62. parse: 0,
  63. url: input.split("?")[0],
  64. jx: 1,
  65. danmaku: "http://43.242.202.175:9595/nnjsdm.php?key=789456123&id=" + input.split("?")[0]
  66. };
  67. }
  68. }),
  69. 推荐: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  70. 一级: '.list_item;img&&alt;img&&src;a&&Text;a&&data-float',
  71. 二级: $js.toString(() => {
  72. VOD = {};
  73. let d = [];
  74. let video_list = [];
  75. let video_lists = [];
  76. let list = [];
  77. let QZOutputJson;
  78. let html = fetch(input, fetch_params);
  79. let sourceId = /get_playsource/.test(input) ? input.match(/id=(\d*?)&/)[1] : input.split("cid=")[1];
  80. let cid = sourceId;
  81. let detailUrl = "https://v.%71%71.com/detail/m/" + cid + ".html";
  82. log("详情页:" + detailUrl);
  83. pdfh = jsp.pdfh;
  84. pd = jsp.pd;
  85. try {
  86. let json = JSON.parse(html);
  87. VOD = {
  88. vod_url: input,
  89. vod_name: json.c.title,
  90. type_name: json.typ.join(","),
  91. vod_actor: json.nam.join(","),
  92. vod_year: json.c.year,
  93. vod_content: json.c.description,
  94. vod_remarks: json.rec,
  95. vod_pic: urljoin2(input, json.c.pic)
  96. }
  97. } catch (e) {
  98. log("解析片名海报等基础信息发生错误:" + e.message)
  99. }
  100. if (/get_playsource/.test(input)) {
  101. eval(html);
  102. let indexList = QZOutputJson.PlaylistItem.indexList;
  103. indexList.forEach(function(it) {
  104. 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";
  105. eval(fetch(dataUrl, fetch_params));
  106. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  107. vdata.forEach(function(item) {
  108. d.push({
  109. title: item.title,
  110. pic_url: item.pic,
  111. desc: item.episode_number + "\t\t\t播放量:" + item.thirdLine,
  112. url: item.playUrl
  113. })
  114. });
  115. video_lists = video_lists.concat(vdata)
  116. })
  117. } else {
  118. let json = JSON.parse(html);
  119. video_lists = json.c.video_ids;
  120. let url = "https://v.qq.com/x/cover/" + sourceId + ".html";
  121. if (video_lists.length === 1) {
  122. let vid = video_lists[0];
  123. url = "https://v.qq.com/x/cover/" + cid + "/" + vid + ".html";
  124. d.push({
  125. title: "在线播放",
  126. url: url
  127. })
  128. } else if (video_lists.length > 1) {
  129. for (let i = 0; i < video_lists.length; i += 30) {
  130. video_list.push(video_lists.slice(i, i + 30))
  131. }
  132. video_list.forEach(function(it, idex) {
  133. 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(",");
  134. let o_html = fetch(o_url, fetch_params);
  135. eval(o_html);
  136. QZOutputJson.results.forEach(function(it1) {
  137. it1 = it1.fields;
  138. let url = "https://v.qq.com/x/cover/" + cid + "/" + it1.vid + ".html";
  139. d.push({
  140. title: it1.title,
  141. pic_url: it1.pic160x90.replace("/160", ""),
  142. desc: it1.video_checkup_time,
  143. url: url,
  144. type: it1.category_map && it1.category_map.length > 1 ? it1.category_map[1] : ""
  145. })
  146. })
  147. })
  148. }
  149. }
  150. let yg = d.filter(function(it) {
  151. return it.type && it.type !== "正片"
  152. });
  153. let zp = d.filter(function(it) {
  154. return !(it.type && it.type !== "正片")
  155. });
  156. VOD.vod_play_from = yg.length < 1 ? "qq" : "qq$$$qq 预告及花絮";
  157. VOD.vod_play_url = yg.length < 1 ? d.map(function(it) {
  158. return it.title + "$" + it.url
  159. }).join("#") : [zp, yg].map(function(it) {
  160. return it.map(function(its) {
  161. return its.title + "$" + its.url
  162. }).join("#")
  163. }).join("$$$");
  164. }),
  165. 搜索: $js.toString(() => {
  166. let d = [];
  167. pdfa = jsp.pdfa;
  168. pdfh = jsp.pdfh;
  169. pd = jsp.pd;
  170. let html = request(input);
  171. let baseList = pdfa(html, "body&&.result_item_v");
  172. log(baseList.length);
  173. baseList.forEach(function(it) {
  174. let longText = pdfh(it, ".result_title&&a&&Text");
  175. let shortText = pdfh(it, ".type&&Text");
  176. let fromTag = pdfh(it, ".result_source&&Text");
  177. let score = pdfh(it, ".figure_info&&Text");
  178. let content = pdfh(it, ".desc_text&&Text");
  179. // let url = pdfh(it, ".result_title&&a&&href");
  180. let url = pdfh(it, "div&&r-data");
  181. // log(longText);
  182. // log(shortText);
  183. // log('url:'+url);
  184. let img = pd(it, ".figure_pic&&src");
  185. url = "https://node.video.qq.com/x/api/float_vinfo2?cid=" + url.match(/.*\/(.*?)\.html/)[1];
  186. log(shortText + "|" + url);
  187. if (fromTag.match(/腾讯/)) {
  188. d.push({
  189. title: longText.split(shortText)[0],
  190. img: img,
  191. url: url,
  192. content: content,
  193. desc: shortText + " " + score
  194. })
  195. }
  196. });
  197. setResult(d);
  198. }),
  199. 搜索: $js.toString(() => {
  200. let d = [];
  201. let html = request(input);
  202. let json = JSON.parse(html);
  203. if (json.data.smartboxItemList.length > 0) {
  204. let cid = json.data.smartboxItemList[0].basicDoc.id;
  205. let url = 'https://node.video.qq.com/x/api/float_vinfo2?cid=' + cid;
  206. let html1 = request(url);
  207. let data = JSON.parse(html1);
  208. d.push({
  209. title: data.c.title,
  210. img: data.c.pic,
  211. url: url,
  212. content: data.c.description,
  213. desc: data.rec
  214. });
  215. }
  216. setResult(d);
  217. })
  218. }