feat(route): add route "Nautiljon" (#18255)

This commit is contained in:
Juan-Lucas
2025-02-03 14:57:08 +08:00
committed by GitHub
parent 4d4b3ea15f
commit f85edc69f3
2 changed files with 68 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
import { load } from 'cheerio';
import { config } from '@/config';
import { Route } from '@/types';
import ofetch from '@/utils/ofetch';
import { parseDate } from '@/utils/parse-date';
const host = 'https://www.nautiljon.com';
export const route: Route = {
path: '/releases/manga',
categories: ['reading'],
example: 'nautiljon/releases/manga',
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false,
},
radar: [
{
source: ['nautiljon.com/'],
},
],
name: 'France manga releases',
maintainers: ['Fafnor'],
handler,
url: 'nautiljon.com',
};
async function handler() {
const response = await ofetch(`${host}/planning/manga/`, {
headers: {
'User-Agent': config.trueUA,
},
});
const $ = load(response);
const items = $('table#planning tbody tr')
.toArray()
.map((item) => {
item = $(item);
const a = item.find('td.p_titre').find('a.sim').first();
const img = item.find('td:nth-child(2) a').first();
return {
title: a.text(),
link: `${host}${a.attr('href')}`,
pubDate: parseDate(item.find('td').first().text(), 'DD/MM/YYYY'),
image: `${host}${img.attr('im')}`,
category: item.find('td.p_titre div.fl').first().text(),
};
});
return {
title: 'Nautiljon France Manga Releases',
link: `${host}/planning/manga/`,
item: items,
};
}
+7
View File
@@ -0,0 +1,7 @@
import type { Namespace } from '@/types';
export const namespace: Namespace = {
name: 'Nautiljon',
url: 'nautiljon.com',
lang: 'fr',
};