* refactor(route/chikubi): switch to native /feed for article URL fetching * feat: add new routes * refactor: remove decodeURIComponent * fix: Handle unescaped characters in tag URLs * chore: use '@/utils/rss-parser' instead of 'rss-parser' * chore: update description * feat(utils): add getPostById and getPostsByIdList for REST API content fetching * refactor(search): use getPostsByIdList instead of processItems * fix: Handle unescaped characters * refactor: Separate index and navigation * feat: optimize post fetching by id and add category & tag functions * refactor: use api to get posts for tags and categories * chore: directly use url * fix: use API to fetch 'best' * fix: destructure post object in map function * feat: optimize getPosts function for reusability * refactor: remove wrapper functions for getBySlug and getPostsBy
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { Route, Data } from '@/types';
|
|
import { processItems } from './utils';
|
|
import parser from '@/utils/rss-parser';
|
|
|
|
export const route: Route = {
|
|
path: '/nipple-video-maker/:keyword',
|
|
categories: ['multimedia'],
|
|
example: '/chikubi/nipple-video-maker/nipple-video-maker-nh',
|
|
parameters: { keyword: 'Keyword' },
|
|
features: {
|
|
requireConfig: false,
|
|
requirePuppeteer: false,
|
|
antiCrawler: false,
|
|
supportBT: false,
|
|
supportPodcast: false,
|
|
supportScihub: false,
|
|
},
|
|
name: 'AVメーカー',
|
|
maintainers: ['SnowAgar25'],
|
|
handler,
|
|
radar: [
|
|
{
|
|
title: 'AVメーカー',
|
|
source: ['chikubi.jp/nipple-video-maker/:keyword'],
|
|
target: '/nipple-video-maker/:keyword',
|
|
},
|
|
],
|
|
};
|
|
|
|
async function handler(ctx): Promise<Data> {
|
|
const { keyword } = ctx.req.param();
|
|
const baseUrl = 'https://chikubi.jp';
|
|
const url = `/nipple-video-maker/${encodeURIComponent(keyword)}`;
|
|
|
|
const feed = await parser.parseURL(`${baseUrl}${url}/feed`);
|
|
|
|
const list = feed.items.map((item) => ({
|
|
title: item.title,
|
|
link: item.link,
|
|
}));
|
|
|
|
const items = await processItems(list);
|
|
|
|
return {
|
|
title: `AVメーカー: ${feed.title?.split('-')[0]} - chikubi.jp`,
|
|
link: `${baseUrl}${url}`,
|
|
item: items,
|
|
};
|
|
}
|