爱奇艺二级.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. js:
  2. let d = [];
  3. let html = request(input);
  4. let json = JSON.parse(html).data;
  5. VOD = {
  6. vod_id:'',
  7. vod_url:input,
  8. vod_name:'',
  9. type_name:'',
  10. vod_actor:'',
  11. vod_year:'',
  12. vod_director:'',
  13. vod_area:'',
  14. vod_content:'',
  15. vod_remarks:'',
  16. vod_pic:'',
  17. };
  18. VOD.vod_name = json.name;
  19. try {
  20. if (json.latestOrder) {
  21. VOD.vod_remarks = "类型: " + (json.categories[0].name || "") + "\t" + (json.categories[1].name || "") + "\t" + (json.categories[2].name || "") + "\t" + '评分:' + (json.score || "") + "\n更新至:第" + json.latestOrder + "集(期)/共" + json.videoCount + "集(期)";
  22. } else {
  23. VOD.vod_remarks = "类型: " + (json.categories[0].name || "") + "\t" + (json.categories[1].name || "") + "\t" + (json.categories[2].name || "") + "\t" + '评分:' + (json.score || "") + json.period;
  24. }
  25. } catch (e) {
  26. VOD.vod_remarks = json.subtitle;
  27. }
  28. VOD.vod_area = (json.focus || "") + "\n资费:" + (json.payMark === 1 ? "VIP" : "免费") + "\n地区:" + ((json.areas) || "");
  29. let vsize = '579_772'
  30. try {
  31. vsize = json.imageSize[12];
  32. }catch (e) {}
  33. VOD.vod_pic = json.imageUrl.replace('.jpg', ('_'+vsize+'.jpg?caplist=jpg,webp'));
  34. // print(VOD.vod_pic);
  35. VOD.type_name = json.categories.map(function (it){return it.name}).join(',');
  36. if(json.people.main_charactor){
  37. let vod_actors = [];
  38. json.people.main_charactor.forEach(function (it){
  39. vod_actors.push(it.name);
  40. });
  41. VOD.vod_actor = vod_actors.join(',')
  42. }
  43. VOD.vod_content = json.description;
  44. let playlists = []
  45. if (json.channelId === 1 || json.channelId === 5) {
  46. playlists = [{
  47. "playUrl": json.playUrl,
  48. "imageUrl": json.imageUrl,
  49. //"subtitle": json.subtitle,
  50. "shortTitle": json.shortTitle,
  51. "focus": json.focus,
  52. "period": json.period
  53. }]
  54. } else {
  55. if (json.channelId === 6) {
  56. let qs = json.period.split('-')[0];
  57. let listUrl = "https://pcw-api.iqiyi.com/album/source/svlistinfo?cid=6&sourceid=" + json.albumId + "&timelist=" + qs;
  58. // print(listUrl);
  59. let playData = JSON.parse(request(listUrl)).data[qs];
  60. playData.forEach(function (it){
  61. playlists.push({
  62. "playUrl": it.playUrl,
  63. "imageUrl": it.imageUrl,
  64. //"subtitle": it.subtitle,
  65. "shortTitle": it.shortTitle,
  66. "focus": it.focus,
  67. "period": it.period
  68. })
  69. });
  70. } else {
  71. let listUrl = 'https://pcw-api.iqiyi.com/albums/album/avlistinfo?aid=' + json.albumId + '&size=200&page=1';
  72. let data = JSON.parse(request(listUrl)).data;
  73. let total = data.total;
  74. playlists = data.epsodelist;
  75. if(total>200){
  76. for(let i=2;i<(total/200)+1;i++){
  77. let listUrl = 'https://pcw-api.iqiyi.com/albums/album/avlistinfo?aid=' + json.albumId + '&size=200&page='+i;
  78. let data = JSON.parse(request(listUrl)).data;
  79. playlists = playlists.concat(data.epsodelist);
  80. }
  81. }
  82. //log(listUrl)
  83. }
  84. }
  85. playlists.forEach(function (it){
  86. d.push({
  87. title: (it.shortTitle) || ('第' + it.order + '集'),
  88. desc: it.subtitle || it.focus || it.period,
  89. img: it.imageUrl.replace('.jpg', '_480_270.jpg?caplist=jpg,webp'),
  90. url: it.playUrl,
  91. });
  92. });
  93. VOD.vod_play_from = 'qiyi';
  94. VOD.vod_play_url = d.map(function (it){
  95. return it.title + '$' + it.url;
  96. }).join('#');