rsshub
Version:
Make RSS Great Again!
59 lines (57 loc) • 1.81 kB
JavaScript
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 "./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";
import { load } from "cheerio";
//#region lib/routes/ipsw.dev/index.ts
init_esm_shims();
const route = {
path: "/index/:productID",
categories: ["program-update"],
example: "/ipsw.dev/index/iPhone16,1",
parameters: { productID: "Product ID" },
name: "Apple latest beta firmware",
maintainers: ["RieN7"],
handler
};
async function handler(ctx) {
const { productID } = ctx.req.param();
const link = `https://ipsw.dev/product/version/${productID}`;
const $ = load((await got_default({
method: "get",
url: link,
headers: { Referer: "https://ipsw.dev/" }
})).data);
const productName = $("#IdentifierModal > div > div > div.modal-body > p:nth-child(1) > em").text();
const list = $(".firmware").toArray().map((element) => {
const ele = $(element);
const version = ele.find("td:nth-child(1) > div > div > strong").text();
const build = ele.find("td:nth-child(1) > div > div > div > code").text();
const date = ele.find("td:nth-child(3)").text();
const size = ele.find("td:nth-child(4)").text();
return {
title: `${productName} - ${version}`,
link: `https://ipsw.dev/download/${productID}/${build}`,
pubDate: new Date(date).toLocaleDateString(),
guid: build,
description: art(path.join(__dirname, "templates/description-7a78a0a0.art"), {
version,
build,
date,
size
})
};
});
return {
title: `${productName} Released`,
link,
item: list
};
}
//#endregion
export { route };