UNPKG

rsshub

Version:
91 lines (89 loc) 2.65 kB
import { n as init_esm_shims, t as __dirname } from "./esm-shims-CzJ_djXG.mjs"; import "./config-C37vj7VH.mjs"; import "./dist-BInvbO1W.mjs"; import "./logger-Czu8UMNd.mjs"; import "./ofetch-BIyrKU3Y.mjs"; import { t as parseDate } from "./parse-date-BrP7mxXf.mjs"; import { t as cache_default } from "./cache-Bo__VnGm.mjs"; import "./helpers-DxBp0Pty.mjs"; import { t as art } from "./render-BQo6B4tL.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import path from "node:path"; //#region lib/routes/shoac/recent-show.ts init_esm_shims(); const route = { path: "/recent-show", categories: ["shopping"], example: "/shoac/recent-show", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["shoac.com.cn/"] }], name: "演出月历", maintainers: ["TonyRL"], handler, url: "shoac.com.cn/" }; async function handler() { const baseUrl = "https://www.shoac.com.cn"; const headers = { Channel: "theatre_pc", Location: "121.458563,31.250315", Theater: 1323, "Flagship-Store": true }; const { data: products } = await got_default.post(`${baseUrl}/platform-backend/good/theater/dongyi-products`, { headers, json: { page: 1, size: 12, calendar: false, timeSort: true, venueId: "" } }); const list = products.data.records.map((item) => ({ title: item.productNameShort, category: [item.categoryName, item.subCategoryName], link: `${baseUrl}/#/detail?projectId=${item.projectId}`, projectId: item.projectId, minPrice: item.minPrice, maxPrice: item.maxPrice, placeCname: item.placeCname })); return { title: "演出月历 - 上海东方艺术中心管理有限公司", link: baseUrl, item: await Promise.all(list.map((item) => cache_default.tryGet(item.link, async () => { const { data: detail } = await got_default(`${baseUrl}/platform-backend/good/project/detail/old/${item.projectId}`, { headers, searchParams: { distributionSeriesId: "", distributionChannelId: "" } }); const { data: show } = await got_default(`${baseUrl}/platform-backend/good/shows/old/${item.projectId}`, { headers, searchParams: { distributionSeriesId: "", distributionChannelId: "" } }); item.description = art(path.join(__dirname, "templates/detail-25b153ac.art"), { item, detail: detail.data, show: show.data }); item.pubDate = show.data.showInfoDetailList ? parseDate(show.data.showInfoDetailList[0].saleBeginTime, "x") : null; return item; }))) }; } //#endregion export { route };