UNPKG

rsshub

Version:
56 lines (54 loc) 1.56 kB
import "./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 "./helpers-DxBp0Pty.mjs"; import { t as got_default } from "./got-KxxWdaxq.mjs"; import { load } from "cheerio"; //#region lib/routes/bandcamp/live.ts const route = { path: "/live", categories: ["multimedia"], example: "/bandcamp/live", parameters: {}, features: { requireConfig: false, requirePuppeteer: false, antiCrawler: false, supportBT: false, supportPodcast: false, supportScihub: false }, radar: [{ source: ["bandcamp.com/live_schedule"] }], name: "Upcoming Live Streams", maintainers: ["nczitzk"], handler, url: "bandcamp.com/live_schedule" }; async function handler() { const currentUrl = `https://bandcamp.com/live_schedule`; const $ = load((await got_default({ method: "get", url: currentUrl })).data); $(".curated-wrapper").remove(); const items = $(".live-listing").toArray().map((item) => { item = $(item); return { link: item.find(".title-link").attr("href"), title: item.find(".show-title").text(), author: item.find(".show-artist").text(), pubDate: parseDate(item.find(".show-time-container").text().trim().split(" UTC")[0]), description: `<img src="${item.find(".show-thumb-image").attr("style").match(/background-image: url\((.*)\);/)[1]}">` }; }); return { title: $("title").text(), link: currentUrl, item: items }; } //#endregion export { route };