小纸条一级推送测试.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. let header = {
  2. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
  3. 'Referer': 'https://gitcafe.net/alipaper/'
  4. };
  5. const cates = '华语电视$hyds#日韩电视$rhds#欧美电视$omds#其他电视$qtds#华语电影$hydy#日韩电影$rhdy#欧美电影$omdy#其他电影$qtdy#华语动漫$hydm#日韩动漫$rhdm#欧美动漫$omdm#纪录片$jlp#综艺片$zyp#教育培训$jypx#其他视频$qtsp#华语音乐$hyyy#日韩音乐$rhyy#欧美音乐$omyy#其他音乐$qtyy';
  6. let homeJson = {}
  7. function init(ext) {
  8. let url = 'https://gitcafe.net/alipaper/home.json?v=1692110598065';
  9. let res = req(url, {
  10. headers: header,
  11. method: 'GET'
  12. });
  13. homeJson = JSON.parse(res.content);
  14. }
  15. function home(filter) {
  16. const data = cates.split('#');
  17. let classes = [];
  18. for (const item of data) {
  19. const cate = item.split('$');
  20. classes.push({
  21. 'type_id': cate[1],
  22. 'type_name': cate[0]
  23. });
  24. }
  25. console.log(JSON.stringify(classes));
  26. return JSON.stringify({
  27. 'class': classes
  28. });
  29. }
  30. function homeVod(params) {
  31. return category('hyds');
  32. }
  33. function category(tid, pg, filter, extend) {
  34. let videos = [];
  35. const data = homeJson.data[tid].catdata;
  36. for (const v of data) {
  37. const video = {
  38. 'vod_id': 'push://https://www.aliyundrive.com/s/' + v.alikey,
  39. 'vod_name':v.title
  40. };
  41. videos.push(video);
  42. }
  43. return JSON.stringify({
  44. 'page': 1,
  45. 'pagecount':1,
  46. 'limit': 1,
  47. 'total': 1,
  48. 'list': videos,
  49. 'type_des': ''
  50. });
  51. }
  52. __JS_SPIDER__ = {
  53. init: init,
  54. home: home,
  55. homeVod: homeVod,
  56. category: category,
  57. detail: null,
  58. play: null,
  59. search: null,
  60. extResult: null
  61. }