From 2ef74840a7433783a1a426c638f5bebc99e55fdf Mon Sep 17 00:00:00 2001 From: daniel <861397272@qq.com> Date: Sat, 14 Dec 2024 19:20:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(route/missav):=20=E4=BF=AE=E5=A4=8Dmissav?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=E8=AE=BF=E9=97=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/ipswdev/index.ts | 62 -------------------- lib/routes/ipswdev/namespace.ts | 7 --- lib/routes/ipswdev/templates/description.art | 20 ------- lib/routes/missav/new.ts | 7 ++- 4 files changed, 4 insertions(+), 92 deletions(-) delete mode 100644 lib/routes/ipswdev/index.ts delete mode 100644 lib/routes/ipswdev/namespace.ts delete mode 100644 lib/routes/ipswdev/templates/description.art diff --git a/lib/routes/ipswdev/index.ts b/lib/routes/ipswdev/index.ts deleted file mode 100644 index 5c566a24e54920..00000000000000 --- a/lib/routes/ipswdev/index.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { Data, Route } from '@/types'; -import got from '@/utils/got'; -import { load } from 'cheerio'; -import { art } from '@/utils/render'; -import path from 'node:path'; - -export const route: Route = { - path: '/index/:productID', - categories: ['program-update'], - example: '/ipswdev/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 resp = await got({ - method: 'get', - url: link, - headers: { - Referer: host, - }, - }); - - const $ = load(resp.data); - - const productName = $('#IdentifierModal > div > div > div.modal-body > p:nth-child(1) > em').text(); - - const list: Data[] = $('.firmware') - .map((index, 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.art'), { - version, - build, - date, - size, - }), - }; - }) - .get(); - - return { - title: `${productName} Released`, - link, - item: list, - }; -} diff --git a/lib/routes/ipswdev/namespace.ts b/lib/routes/ipswdev/namespace.ts deleted file mode 100644 index e6c6cb1ff9b805..00000000000000 --- a/lib/routes/ipswdev/namespace.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { Namespace } from '@/types'; - -export const namespace: Namespace = { - name: 'IPSW.dev', - url: 'ipsw.dev', - description: 'Download the latest beta firmware for iPhone, iPad, Mac, Apple Vision Pro, and Apple TV. Check the signing status of the beta firmware.', -}; diff --git a/lib/routes/ipswdev/templates/description.art b/lib/routes/ipswdev/templates/description.art deleted file mode 100644 index c0faef7bfac60d..00000000000000 --- a/lib/routes/ipswdev/templates/description.art +++ /dev/null @@ -1,20 +0,0 @@ -
Version | -{{ version }} | -
---|---|
Build | -{{ build }} | -
Released | -{{ released }} | -
Size | -{{ size }} | -