-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(route): add route "Nautiljon" (#18255)
- Loading branch information
Showing
2 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', | ||
}; |