rsshub
Version:
Make RSS Great Again!
41 lines (39 loc) • 1.24 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import { t as ofetch_default } from "./ofetch-BIyrKU3Y.mjs";
import "./parse-date-BrP7mxXf.mjs";
import "./render-BQo6B4tL.mjs";
import { t as parseItems } from "./utils-DVy9XjTd.mjs";
import { load } from "cheerio";
//#region lib/routes/javtiful/channel.ts
const route = {
path: "/channel/:id",
name: "Channel",
maintainers: ["huanfe1"],
example: "/javtiful/channel/madonna",
parameters: { id: "Channel name" },
handler,
categories: ["multimedia"],
radar: [{
source: ["javtiful.com/channel/:id", "javtiful.com/channel/:id/*"],
target: "/channel/:id"
}],
features: { nsfw: true }
};
async function handler(ctx) {
const { id } = ctx.req.param();
const $ = load(await ofetch_default(`https://javtiful.com/channel/${id}`));
const items = $("section .card:not(:has(.bg-danger))").toArray().map((item) => parseItems($(item)));
return {
title: $(".channel-item__name_details a").text(),
link: `https://javtiful.com/channel/${id}`,
allowEmpty: true,
item: items,
image: $(".content-section-title img").attr("src"),
language: $("html").attr("lang")
};
}
//#endregion
export { route };