4.0.3 • Published 3 years ago

kongou v4.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Kongou

A simple typescript nhentai wrapper.

Constructor

Kongou has support for proxy sites that use the same api.

Support is half baked!
Please do tell me if you find an API that has the same URL format.

new Kongou(defaultSite: string, staticSite: { thumbnails: string, images: string })

Functions

<Kongou>().getBook(id: string | number): Promise<Response>

  • id = nhentai Gallery Id.
    • eg: 363636
new Kongou().getBook(363636)

Returns data identical to Response interface.


<Kongou>().getByQuery(object: queryParam): Promise<QueryResponse>

Param must be a queryParam Type!

import { queryParam } from "Kongou/Interfaces/parser"

const param: queryParam = { keywords: 'Ichigo Cake to Mont Blanc', lang: 'english', page: 1, sort: 'popular' }

new Kongou().getByQuery(params)

Returns data identical to QueryResponse


<Kongou>().getHomePage(object: filters): Promise<HomePageResponse>

As the name implies returns the "latest" and "popular now" like results.
For now filter only supports language.

new Kongou().getHomePage({ langauge: 'english' })

Returns data identical to HomePageResponse


Contribute?

Before making a pull or such, please do lint the files with the config given and comment on what something does.

I'm sure there are lots of grammartical errors with both docs and other comments, if you do come across one please do let me know!

Contributors

You guys made me a javascript addict, made me obssesed with Kongou.
Anyways, you guys made me eager to open up VSC and stonk my JS skill everyday!

Thank you! <3

Interfaces

Already typed into the library. Go check that out!

Response

{
    /**
     * id of this object.
     * `eg: 363636`
     */
    id: number
    /**
     * media_id of this object.
     * `eg: 1940023`
     */
    media_id: number
    /**
     * Site URL of this object.
     * https://nhentai.net/g/363636
     */
    url: string
    /**
     * Titles of this object.
     */
    title: {
        /**
         * English title of this object.
         * `[Azuma Tesshin] Ichigo Cake to Mont Blanc | Strawberry Cake & Mont Blanc - The cherry boy with Bitch sister. (COMIC Kairakuten 2018-05) [English] [Tamamo | GDS] [Digital]"`
         */
        english: string
        /**
         * Native title of this object.
         * `[東鉄神] イチゴのケーキとモンブラン (COMIC 快楽天 2018年5月号) [英訳] [DL版]`
         */
        native: string
        /**
         * Pretty title of this object.
         * `Ichigo Cake to Mont Blanc | Strawberry Cake & Mont Blanc - The cherry boy with Bitch sister.`
         */
        pretty: string
    }
    /**
     * Images of this object.
     */
    images: {
        /**
         * Full size image urls.
         */
        pages: string[]
        /**
         * Cover sized image url.
         */
        cover: string
        /**
         * Thumbnail sized image url.
         */
        thumbnail: string
    }
    /**
     * Scanlator of this object.
     * Not available still. :-(
     */
    scanlator: string | undefined
    /**
     * Uploaded date of this object.
     */
    upload_date: Date
    /**
     * Tags of this object.
     */
    tags: {
        artists: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        category: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        characters: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        groups: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        languages: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        parodies: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
        tags: [{
            /**
             * nhentai id for this tag.
             */
            id: number
            /**
             * Name of this tag.
             * `big boobs`
             */
            name: string
            /**
             * Site URL of this tag.
             * `https://nhentai.net/tag/big-boobs`
             */
            url: string
            /**
             * Amount of titles in this tag.
             */
            count: number
        }]
    }
    /**
     * Number of pages this object has.
     */
    num_pages: number
    /**
     * Number of favorites of this object in nhentai
     */
    num_favorites: number
}

QueryResponse

{
    /**
     * Array of {@link Response}
     * ``results = per_page * num_pages``
     */
    result: Response[]
    /**
     * Number of pages for this query.
     */
    num_pages: number
    /**
     * Number of {@link Response} per page.
     */
    per_page: number
}

HomePageResponse

{
    /**
     * Results identical to "Latest" on the HomePage of the website in {@link QueryResponse} format.
     */
    latest: QueryResponse
    /**
     * Results identical to "Popular" on the HomePage of the website in {@link QueryResponse} format.
     */
    popular: QueryResponse
}

QueryParam

{
    keywords: string
    page?: number,
    sort?: 'popular' | 'popular-today' | 'popular-weekly'
    lang?: 'english' | 'japanese' | 'chinese'
}
4.1.0-beta

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

4.0.0-pre

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

2.5.6

3 years ago

2.5.5

3 years ago

2.5.7

3 years ago

2.5.4

3 years ago

2.5.2

3 years ago

2.5.1

3 years ago

2.5.3

3 years ago

2.5.0

3 years ago

2.4.3

3 years ago

2.4.2

3 years ago

2.4.0

3 years ago

2.3.0

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.1

3 years ago

2.2.0

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago