Git Product home page Git Product logo

hentai's Introduction

β€œDe gustibus non est disputandum.”

Python Hentai API Wrapper

This python package implements a wrapper class around nhentai's RESTful API. Please be aware that this is not an official API, technical questions about nhentai.net should be redirected to [email protected]. Further note that the content of this module is generally considered NSFW. Finally, I would like to comment at this point that you should under no circumstances use this module to make an unreasonable amount of requests in a short period of time.

Installation

Get the most recent stable release from PyPI:

pip install hentai

Alternatively, if you're looking to make a contribution fork this repository and run

python -m venv venv/
venv/Scripts/Activate.ps1
python -m pip install --upgrade pip
pip install -r requirements/dev.txt

Make sure to checkout rec-hentai so that your work is up-to-date with the next release candidate.

Basic Usage

Hentai makes it very easy to browse through nhentai.net. It implements a flat namespace for easy access of all their endpoints:

from hentai import Hentai, Format

doujin = Hentai(177013)

# True
Hentai.exists(doujin.id)

# METAMORPHOSIS
print(doujin.title(Format.Pretty))

# [Tag(id=3981, type='artist', name='shindol', url='/artist/shindol/', count=279)]
print(doujin.artist)

# ['dark skin', 'group', ... ]
print([tag.name for tag in doujin.tag])

# 2016-10-18 14:28:49
print(doujin.upload_date)

# ['https://i.nhentai.net/galleries/987560/1.jpg', ... ]
print(doujin.image_urls)

# get the source
doujin.download()

Apart from that, hentai.Utils also provides a handful of miscellaneous helper methods:

from hentai import Utils, Sort

print(Utils.get_random_id())

# recommend me something good!
print(Utils.get_random_hentai())

# advanced search with queries
for doujin in Utils.search_by_query('tag:loli', sort=Sort.PopularWeek):
    print(Hentai.get_title(doujin))

See also https://nhentai.net/info/ for more information on search queries.

Documentation

I know this is important. I will be working on automating this in a timely manner. Stay tuned! In the mean time, use the wiki as a first point of reference.

Get In Touch

You can reach me at [email protected] for private questions and inquires that don't belong to the issue tab.

hentai's People

Contributors

hentai-chan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.