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
pip install --upgrade NHentai-API
# or pip3 install --upgrade NHentai-API
Library Features
- Home page pagination,
- Doujin information,
- Random doujin,
- Search by id and tag,
- Character List
Usage
Home
from Nhentai import NHentai
if __name__ == '__main__':
nhentai = NHentai()
random_doujin: HomePage = nhentai.get_pages(page=1)
the expected output is a HomePage instance:
HomePage(
doujins: [
DoujinThumbnail(
id: str,
title: str,
lang: str,
cover: str,
data_tags: List[str])],
total_pages: int)
Random
from NHentai import NHentai
if __name__ == '__main__':
nhentai = NHentai()
random_doujin: Doujin = nhentai.get_random()
The expected output is a Doujin instance:
Doujin(
id: str
title: str
secondary_title: str
tags: List[str]
artists: List[str]
languages: List[str]
categories: List[str]
characters: List[str]
parodies: List[str]
groups: List[str]
images: List[str]
total_pages: int)
It's good always remember that some doujins doesnt have many properties that are listed above like artists, characters, parodies and more. This is only the default Doujin dataclass template.
Search
from NHentai import NHentai
if __name__ == '__main__':
nhentai = NHentai()
search_obj: SearchPage = nhentai.search(query='naruto', sort='popular', page=1)
search_obj: SearchPage = nhentai.search(query='30955', sort='popular', page=1)
expected output:
SearchPage(
query: str,
sort: str,
total_results: int,
doujins: [
DoujinThumbnail(
id: str,
title: str,
lang: str,
cover: str,
data_tags: List[str])],
total_pages: int)
Doujin
from NHentai import NHentai
if __name__ == '__main__':
nhentai = NHentai()
doujin: Doujin = nhentai._get_doujin(id='287167')
expected output:
Doujin(
id: str
title: str
secondary_title: str
tags: List[str]
artists: List[str]
languages: List[str]
categories: List[str]
characters: List[str]
parodies: List[str]
groups: List[str]
images: List[str]
total_pages: int)
Characters
from NHentai import NHentai
if __name__ == '__main__':
nhentai = NHentai()
doujin: Doujin = nhentai.get_characters(page=1)
expected output:
CharacterListPage(
page=int,
total_pages=int,
characters=[
CharacterLink(
section: str
title: str
url: str
total_entries: int)])
Project details
Release history Release notifications | RSS feed
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.15.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for NHentai_API-0.0.15-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5b0cc90dbad25cda356027f8217c679882f74f8c05d3635363fde4a81d1d5d44 |
|
MD5 | 8bfeb0748f61dfb022a819a7f04a9b60 |
|
BLAKE2b-256 | 076d9f7e85702741841f45ca3629f6c82fa2c9cdd2be5294a45a84b5cf4656e1 |