From e703cb76fff8c68e05b9aed5d71574bc289c518f Mon Sep 17 00:00:00 2001 From: Weirdo <59109940+Hermes1030@users.noreply.github.com> Date: Sun, 21 Dec 2025 20:15:26 +0800 Subject: [PATCH] =?UTF-8?q?feat(route):=20=E6=B7=BB=E5=8A=A0BT=E5=BD=B1?= =?UTF-8?q?=E8=A7=86=E6=9B=B4=E6=96=B0=E5=88=97=E8=A1=A8=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=20(#20737)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(route): 添加BT影视更新列表路由 * 更新 gxlist.ts --- lib/routes/btbtla/gxlist.ts | 46 ++++++++++++++++++++++++++++++++++ lib/routes/btbtla/namespace.ts | 7 ++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/routes/btbtla/gxlist.ts create mode 100644 lib/routes/btbtla/namespace.ts diff --git a/lib/routes/btbtla/gxlist.ts b/lib/routes/btbtla/gxlist.ts new file mode 100644 index 0000000000..698d1a71ad --- /dev/null +++ b/lib/routes/btbtla/gxlist.ts @@ -0,0 +1,46 @@ +import { load } from 'cheerio'; + +import type { Route } from '@/types'; +import ofetch from '@/utils/ofetch'; + +export const route: Route = { + categories: ['multimedia'], + example: '/btbtla/gxlist', + handler, + maintainers: ['Hermes1030'], + name: 'BTBTLA', + path: '/gxlist', + url: 'btbtla.com/tt/gxlist.html', +}; + +async function handler() { + const link = 'https://btbtla.com/tt/gxlist.html'; + + const response = await ofetch(link); + const $ = load(response); + + const items = $('.tgxtablerow') + .toArray() + .map((element) => { + const $row = $(element); + const title = $row.find('.clickable-row b').text(); + const link = $row.find('.clickable-row a').attr('href'); + const size = $row.find('.tgxtablecell:nth-child(3) .badge').text(); + const views = $row.find('.tgxtablecell:nth-child(4) b').text(); + const time = $row.find('.tgxtablecell:nth-child(5) small').text(); + return { + title, + link: link ? `https://btbtla.com${link}` : '', + description: `大小: ${size}, 下载量: ${views}, 时间: ${time}`, + }; + }); + + const moduleTitle = $('.module-title').text(); + + return { + title: moduleTitle, + link, + description: moduleTitle, + item: items, + }; +} diff --git a/lib/routes/btbtla/namespace.ts b/lib/routes/btbtla/namespace.ts new file mode 100644 index 0000000000..2178121134 --- /dev/null +++ b/lib/routes/btbtla/namespace.ts @@ -0,0 +1,7 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: 'BT影视', + url: 'btbtla.com', + description: 'BT影视更新列表', +};