Skip to content

Commit

Permalink
feat(route): add route "Nautiljon" (#18255)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fafnor authored Feb 3, 2025
1 parent 4d4b3ea commit f85edc6
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
61 changes: 61 additions & 0 deletions lib/routes/nautiljon/manga-releases.ts
Original file line number Diff line number Diff line change
@@ -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 changes: 7 additions & 0 deletions lib/routes/nautiljon/namespace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { Namespace } from '@/types';

export const namespace: Namespace = {
name: 'Nautiljon',
url: 'nautiljon.com',
lang: 'fr',
};

0 comments on commit f85edc6

Please sign in to comment.