yuluo.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. rule = {
  2. host: 'http://dsakf23665.com/api.php',
  3. homeJS: `
  4. let reqUrl = HOST + '/v1.home/types';
  5. request(reqUrl);|||
  6. let json = JSON.parse(html).data.types;
  7. json.forEach(item => {
  8. classes.push({
  9. type_id: item.type_id,
  10. type_name: item.type_name,
  11. });
  12. });
  13. `,
  14. homeVodJS: `
  15. let json = JSON.parse(html).data.types;
  16. json.forEach(item => {
  17. videos = videos.concat(item.data.banners);
  18. });
  19. `,
  20. categoryVodJS: `
  21. request(HOST + '/v1.classify/content', {type_id: classId, page: page, limit: 20}, '', 'post');|||
  22. videos = JSON.parse(html).data.video_list;
  23. `,
  24. detailVodJS: `
  25. request(HOST + '/v1.player/details?vod_id=' + input);|||
  26. let detail = JSON.parse(html).data.detail;
  27. let playFrom = [];
  28. let playUrl = [];
  29. detail.play_url_list.forEach(item => {
  30. playFrom.push(item.show);
  31. flagParse[item.show] = item.parse;
  32. playUrl.push(
  33. _.map(item.urls, v => {
  34. return v.name + '$' + v.url;
  35. }).join('#')
  36. );
  37. });
  38. videos.push({
  39. vod_id: detail.vod_id,
  40. vod_name: detail.vod_name,
  41. vod_pic: detail.vod_pic,
  42. vod_remarks: detail.vod_remarks,
  43. vod_actor: detail.vod_actor,
  44. vod_director: detail.vod_director,
  45. vod_area: detail.vod_area,
  46. vod_year: detail.vod_year,
  47. vod_play_from: playFrom.join('$$$'),
  48. vod_play_url: playUrl.join('$$$'),
  49. vod_content: detail.vod_content,
  50. });
  51. `,
  52. lazy: `
  53. playUrl = flagParse[playFlag] + input;
  54. request(playUrl);|||
  55. if(flagParse[playFlag].length > 0) {
  56. let json = JSON.parse(html);
  57. playUrl = json.url;
  58. }
  59. `,
  60. searchVodJS: `
  61. request(HOST + '/v1.search/data?wd=' + input);|||
  62. let json = JSON.parse(html).data.search_data;
  63. json.forEach(item => {
  64. videos.push({
  65. vod_id: item.vod_id,
  66. vod_name: item.vod_name,
  67. vod_pic: item.vod_pic,
  68. });
  69. });`
  70. }