Manga Provider
Difficulty: Easy
Types
declare type SearchResult = {
id: string
title: string
synonyms?: string[]
year?: number
image?: string
}
declare type ChapterDetails = {
id: string
url: string
title: string
chapter: string
index: number
scanlator?: string
language?: string
rating?: number
updatedAt?: string
}
declare type ChapterPage = {
url: string
index: number
headers: { [key: string]: string }
}
declare type QueryOptions = {
query: string
year?: number
}
declare type Settings = {
supportsMultiLanguage?: boolean
supportsMultiScanlator?: boolean
}
declare abstract class MangaProvider {
search(opts: QueryOptions): Promise<SearchResult[]>
findChapters(id: string): Promise<ChapterDetails[]>
findChapterPages(id: string): Promise<ChapterPage[]>
getSettings(): Settings
}Code
Do not change the name of the class. It must be Provider.
Workflow
search is called twice when the user opens the manga page. Each time with a different manga title as query (English, Romaji).
The best match will automatically be selected and findChapters will be called with the manga ID from the search result to get the list of chapters.

findChapterPages is called when the user requests to read or download the chapter.

Manga ID, Chapter ID
Depending on the source website you’re getting the data from, the URLs might get a little complex.
For example, if a manga’s chapter page is: https://example.com/manga/999/chapter-1 consisting of 2 URL sections (in this case, the manga ID and the chapter ID), you can construct the Seanime chapter ID by combining the two parts and splitting them in findChapterPages .

Settings
If your manga source supports multiple languages for chapters and you want your extension to give this option to the users, set
supportsMultiLanguagetotrueand set thelanguageproperty for each of theChapterDetails. Preferably ISO 639-1.Similarly, you can also give the option to choose a scanlator by setting
supportsMultiScanlatortotrueand setting thescanlatorproperty for each of theChapterDetails.

Example
Last updated