Skip to main content

NHentai Python API made using webscraping.

Project description

NHentai API

A NHentai API made using python webscrapping For update notes follow me on Twitter.

Instalation

pip3 install --upgrade NHentai-API or pip install --upgrade NHentai-API

Library Features

  • Home page pagination,
  • Doujin information,
  • Random doujin,
  • Search by id and tag,
  • User page

Usage

Home
from nhentai import NHentai

if __name__ == '__main__':
    nhentai = NHentai()
    random_doujin: dict = nhentai.get_pages(page=1)

expected output:

    {
        'doujins': [{
            'id': str, 
            'title': str, 
            'lang': str, 
            'cover': str, 
            'data-tags': list[str]
        }], 
        'totalPages': int
    }
Random
from nhentai import NHentai

if __name__ == '__main__':
    nhentai = NHentai()
    random_doujin: dict = nhentai.get_random()

expected output:

    {
        'id': str, 
        'title': str, 
        'secondary_title': str, 
        'tags': list[str], 
        'artists': list[str], 
        'languages': list[str], 
        'categories': list[str], 
        'pages': list[str], 
        'images': list[str]
    }
Search
from nhentai import NHentai

if __name__ == '__main__':
    nhentai = NHentai()
    search_obj: dict = nhentai.search(query='naruto', sort='popular', page=1)
    search_obj: dict = nhentai.search(query='30955', sort='popular', page=1)

expected output:

    {
        'query': str, 
        'sort': str, 
        'totalResults': int, 
        'doujins': [{
            'id': str, 
            'title': str', 
            'lang': str, 
            'cover': str, 
            'data-tags': list[str]
        }], 
        'totalPages': int
    }
User page
from nhentai import NHentai

if __name__ == '__main__':
    nhentai = NHentai()
    user: dict = nhentai.get_user_page(uid='1278294', username='alexandresenpai')

expected output:

    {
        'uid': str, 
        'username': str, 
        'image': str, 
        'since': str, 
        'doujins': [{
            'id': str, 
            'cover': str, 
            'title': str, 
            'data-tags': list[str]
        }]
    }
Doujin
from nhentai import NHentai

if __name__ == '__main__':
    nhentai = NHentai()
    doujin: dict = nhentai._get_doujin(id='287167')

expected output:

    {
        'id': str, 
        'title': str, 
        'secondary_title': str, 
        'tags': list[str], 
        'artists': list[str], 
        'languages': list[str], 
        'categories': list[str], 
        'pages': list[str], 
        'images': list[str]
    }

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

NHentai-API-0.0.7.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

NHentai_API-0.0.7-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page