zxzjhd.user.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. // ==UserScript==
  2. // @name maccms-mxonepro
  3. // @namespace gmspider
  4. // @version 2025.1.11
  5. // @description maccms GMSpider
  6. // @author Luomo
  7. // @match *://*/*
  8. // @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.slim.min.js
  9. // @require https://cdn.jsdelivr.net/gh/CatVodSpider-GM/SFW-Spiders@main/Spiders-Lib/maccms-1.0.2.js
  10. // @grant unsafeWindow
  11. // ==/UserScript==
  12. console.log(JSON.stringify(GM_info));
  13. (function () {
  14. const GMSpiderArgs = {};
  15. if (typeof GmSpiderInject !== 'undefined') {
  16. let args = JSON.parse(GmSpiderInject.GetSpiderArgs());
  17. GMSpiderArgs.fName = args.shift();
  18. GMSpiderArgs.fArgs = args;
  19. } else {
  20. GMSpiderArgs.fName = "detailContent";
  21. GMSpiderArgs.fArgs = [1, 109];
  22. }
  23. Object.freeze(GMSpiderArgs);
  24. const GmSpider = MacCmsGMSpider({
  25. configPicUserAgent: false,
  26. pageCountStyle: ".stui-page__item li.hidden-xs:last:not(.active)",
  27. homeContent: {
  28. category: {
  29. select: ".stui-header__menu li",
  30. slice: [1, 7]
  31. }
  32. },
  33. detailContent: {
  34. customFunction: function (ids) {
  35. let items = {};
  36. $(".stui-content__detail .data").each(function () {
  37. const item = $(this).text().trim().split(":");
  38. items[item[0]] = item[1];
  39. });
  40. let vodPlayData = [];
  41. $(".stui-content__playlist:first").each(function (i) {
  42. let media = [];
  43. $(".stui-content__playlist:first a").each(function () {
  44. media.push({
  45. name: $(this).text().trim(),
  46. type: "webview",
  47. ext: {
  48. replace: {
  49. playUrl: $(this).attr("href"),
  50. }
  51. }
  52. });
  53. })
  54. vodPlayData.push({
  55. from: "在线之家",
  56. media: media
  57. })
  58. })
  59. return vod = {
  60. vod_id: ids[0],
  61. vod_name: $(".stui-content__detail .title").text().trim(),
  62. vod_pic: $(".stui-content__thumb img").data("original"),
  63. vod_remarks: items?.["更新"] || "",
  64. vod_director: items?.["导演"] || "",
  65. vod_actor: items?.["主演"] || "",
  66. vod_content: $(".stui-content__thumb .detail-content").text().trim(),
  67. vod_play_data: vodPlayData
  68. };
  69. }
  70. },
  71. getVodList: function () {
  72. let vodList = [];
  73. $("a.stui-vodlist__thumb").each(function () {
  74. vodList.push({
  75. vod_id: $(this).attr("href"),
  76. vod_name: $(this).attr("title"),
  77. vod_pic: $(this).data("original"),
  78. vod_remarks: $(this).find(".pic-text").text().trim()
  79. })
  80. });
  81. return vodList;
  82. },
  83. getCategoryFilter: function () {
  84. const filters = [];
  85. $("#screenbox .clearfix:gt(0)").each(function () {
  86. const filter = {
  87. key: "",
  88. name: $(this).find("li:first").text().trim(),
  89. value: []
  90. }
  91. $(this).find("a").each(function () {
  92. const params = $(this).attr("href").split(/[/.]/).at(2).split("-").slice(1);
  93. filter.key = "index" + params.findIndex((element) => element.length > 0)
  94. filter.value.push({
  95. n: $(this).text().trim(),
  96. v: params.find((element) => element.length > 0) || ""
  97. })
  98. })
  99. filters.push(filter);
  100. })
  101. return filters;
  102. }
  103. });
  104. $(document).ready(function () {
  105. const result = GmSpider[GMSpiderArgs.fName](...GMSpiderArgs.fArgs);
  106. console.log(JSON.stringify(result));
  107. if (typeof GmSpiderInject !== 'undefined') {
  108. GmSpiderInject.SetSpiderResult(JSON.stringify(result));
  109. }
  110. });
  111. })();