* fix: allow multiple radar rules per route * fix: github folder * feat: add namespace to radar target * docs: fix types url
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { Route } from '@/types';
|
|
import { TITLE, HOST } from './const';
|
|
import { fetchBrandInfo } from './service';
|
|
|
|
export const route: Route = {
|
|
path: '/brand/:id',
|
|
categories: ['shopping'],
|
|
example: '/showstart/brand/34707',
|
|
parameters: { id: '厂牌 ID' },
|
|
features: {
|
|
requireConfig: false,
|
|
requirePuppeteer: false,
|
|
antiCrawler: false,
|
|
supportBT: false,
|
|
supportPodcast: false,
|
|
supportScihub: false,
|
|
},
|
|
radar: [
|
|
{
|
|
source: ['www.showstart.com/host/:id'],
|
|
},
|
|
],
|
|
name: '厂牌 - 演出更新',
|
|
maintainers: ['lchtao26'],
|
|
handler,
|
|
description: `:::tip
|
|
厂牌 ID 查询: \`/showstart/search/brand/:keyword\`,如: [https://rsshub.app/showstart/search/brand/ 声场](https://rsshub.app/showstart/search/brand/声场)
|
|
:::`,
|
|
};
|
|
|
|
async function handler(ctx) {
|
|
const id = ctx.req.param('id');
|
|
const brand = await fetchBrandInfo({
|
|
brandId: id,
|
|
});
|
|
return {
|
|
title: `${TITLE} - ${brand.name}`,
|
|
description: brand.content,
|
|
link: `${HOST}/host/${brand.id}`,
|
|
item: brand.activityList,
|
|
};
|
|
}
|