腾讯二级.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. js:
  2. VOD = {};
  3. let d = [];
  4. let video_list = [];
  5. let video_lists = [];
  6. let list = [];
  7. let QZOutputJson;
  8. let html = fetch(input,fetch_params);
  9. // print(html);
  10. let sourceId = /get_playsource/.test(input)?input.match(/id=(\d*?)&/)[1]:input.split('cid=')[1];
  11. let cid = sourceId;
  12. let detailUrl = 'https://v.%71%71.com/detail/m/' + cid + '.html';
  13. log('详情页:'+detailUrl);
  14. // let detail_html = fetch(detailUrl,fetch_params);
  15. var pdfh = jsp.pdfh;
  16. var pd = jsp.pd;
  17. //影片信息
  18. try{
  19. let json = JSON.parse(html);
  20. VOD = {
  21. // vod_id:json.c.vid,
  22. vod_url:input,
  23. vod_name:json.c.title,
  24. type_name:json.typ.join(','),
  25. vod_actor:json.nam.join(','),
  26. vod_year:json.c.year,
  27. // vod_director:director,
  28. // vod_area:area,
  29. vod_content:json.c.description,
  30. vod_remarks:json.rec,
  31. vod_pic:urljoin2(input,json.c.pic),
  32. };
  33. // print(VOD);
  34. }catch(e){log('解析片名海报等基础信息发生错误:'+e.message) }
  35. //掏直链
  36. if (/get_playsource/.test(input)) {
  37. // print('流程1');
  38. eval(html);
  39. let indexList = QZOutputJson.PlaylistItem.indexList;
  40. indexList.forEach(function (it) {
  41. 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';
  42. eval(fetch(dataUrl, fetch_params));
  43. let vdata = QZOutputJson.PlaylistItem.videoPlayList;
  44. vdata.forEach(function (item) {
  45. d.push({
  46. title:item.title,
  47. pic_url:item.pic,
  48. desc:item.episode_number + '\t\t\t播放量:' + item.thirdLine,
  49. url:item.playUrl,
  50. });
  51. });
  52. video_lists = video_lists.concat(vdata);
  53. });
  54. }else{
  55. let json = JSON.parse(html);
  56. video_lists = json.c.video_ids;
  57. // print(video_lists);
  58. let url = 'https://v.qq.com/x/cover/' + sourceId + '.html';
  59. // if (json.c.type === 10) {//综艺
  60. // // print('流程2-1');
  61. // let dataUrl = 'https://s.video.qq.com/get_playsource?id=' + json.c.column_id + '&plat=2&type=2&data_type=3&video_type=8&plname=qq&otype=json';
  62. // // print(dataUrl);
  63. // let o_html = fetch(dataUrl, fetch_params);
  64. // eval(o_html);
  65. // video_lists = [];
  66. // let indexList = QZOutputJson.PlaylistItem.indexList;
  67. // indexList.forEach(function (it){
  68. // let dataUrl = 'https://s.video.qq.com/get_playsource?id=' + json.c.column_id + '&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. // }
  82. if (video_lists.length === 1) {//电影或者电视剧只有1集
  83. let vid = video_lists[0];
  84. url = 'https://v.qq.com/x/cover/' + cid + '/' + vid + '.html';
  85. // print('流程2-2');
  86. d.push({
  87. title: '在线播放',
  88. url: url,
  89. });
  90. } else if (video_lists.length > 1) { // 电视剧 或者动漫? 电影也分普通话版和英语版
  91. // print('流程2-3');
  92. for (let i = 0; i < video_lists.length; i += 30) {
  93. video_list.push(video_lists.slice(i, i + 30))
  94. }
  95. // print(video_list);
  96. video_list.forEach(function (it,idex){
  97. let o_url = 'https://union.video.qq.com/fcgi-bin/data?otype=json&tid=682&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. // print(d);
  115. let yg = d.filter(function (it){
  116. return (it.type&&it.type!=='正片')
  117. });
  118. let zp = d.filter(function (it){
  119. return !(it.type&&it.type!=='正片')
  120. });
  121. VOD.vod_play_from = yg.length<1?'qq':'qq$$$qq 预告及花絮';
  122. VOD.vod_play_url = yg.length<1?d.map(function (it){
  123. return it.title + '$' + it.url;
  124. }).join('#'):[zp,yg].map(function (it){
  125. return it.map(function (its){
  126. return its.title + '$' + its.url;
  127. }).join('#');
  128. }).join('$$$');