酷云二级.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. js:
  2. var d=[];
  3. VOD={vod_id:input};
  4. // print(input);
  5. try {
  6. let html=request(input);
  7. print(html);
  8. html = JSON.parse(html);
  9. let node = html.data;
  10. VOD = {
  11. "vod_id":node['id'],
  12. "vod_name":node['videoName'],
  13. "vod_pic":node['videoCover'],
  14. "type_name":node['subCategory'],
  15. "vod_year":node['year'],
  16. "vod_area":node['area'],
  17. "vod_remarks":node['msg'],
  18. "vod_actor":node['actor'],
  19. "vod_director":node['director'],
  20. "vod_content":node['brief'].strip()
  21. }
  22. // print(VOD);
  23. let tid = input.split('ids=')[1];
  24. let listUrl = 'http://api.kunyu77.com/api.php/provide/videoPlaylist?devid=453CA5D864457C7DB4D0EAA93DE96E66&package=com.sevenVideo.app.android&version=1.8.7&ids='+tid;
  25. html = request(listUrl);
  26. html = JSON.parse(html);
  27. let episodes = html.data.episodes;
  28. let playMap = {};
  29. if(typeof(play_url)==='undefined'){
  30. var play_url = '';
  31. }
  32. play_url = play_url.replace('&play_url=','&type=json&play_url=');
  33. episodes.forEach(function (ep){
  34. let playurls = ep['playurls'];
  35. playurls.forEach(function (playurl){
  36. let source = playurl['playfrom'];
  37. if(!playMap.hasOwnProperty(source)){
  38. playMap[source] = [];
  39. }
  40. playMap[source].append(playurl['title'].strip() + '$' + play_url+urlencode(playurl['playurl']));
  41. });
  42. });
  43. let playFrom = [];
  44. let playList = [];
  45. Object.keys(playMap).forEach(function (key){
  46. playFrom.append(key);
  47. playList.append(playMap[key].join('#'));
  48. });
  49. // print(playFrom);
  50. // print(playList);
  51. let vod_play_from = playFrom.join('$$$');
  52. let vod_play_url = playList.join('$$$');
  53. VOD['vod_play_from'] = vod_play_from;
  54. VOD['vod_play_url'] = vod_play_url;
  55. // print(VOD);
  56. }catch (e) {
  57. log('获取二级详情页发生错误:'+e.message);
  58. }