an nhentai api wrapper.
Project description
nhentai.py
API
nhentai.get_doujin(id:int) -> Doujin
Returns a doujin by given /g/id.
nhentai.get_random_id() -> int
Returns a random and valid /g/id.
nhentai.get_homepage(page:int) -> List[Doujin]
Returns a list of the most recently uploaded doujins on the homepage.
nhentai.search(query:str, page:int, sort_by:str) -> List[Doujin]
Returns a list of doujins related to a given keyword.
nhentai.search_tagged(tag_id:int, page:int, sort_by:str) -> List[Doujin]
Returns a list of doujins that have the given tag id.
Examples
Getting doujin using a /g/id
>>> d = nhentai.get_doujin(123)
>>>
>>> # URL to first page's image.
>>> d[0].url
'https://i.nhentai.net/galleries/635/1.jpg'
>>>
>>> d.__dict__
{'id': 123,
'media_id': '635',
'thumbnail': 'https://t.nhentai.net/galleries/635/thumb.jpg',
'cover': 'https://t.nhentai.net/galleries/635/cover.jpg'}
'titles': {'english': '(C69) [Nakayohi Mogudan (Mogudan)] Omakehon 2005 (Neon Genesis Evangelion)', 'japanese': '(C69) [なかよひモグダン (モグダン)] おまけ本 2005 (新世紀エヴァンゲリオン)', 'pretty': 'Omakehon 2005'},
'tags': [Tag(id=17202, type='artist', name='mogudan', url='/artist/mogudan/', count=213)
...
Getting a random doujin
>>> id = nhentai.get_random_id()
>>> id
118927
>>>
>>> nhentai.get_doujin(id).tags
[Tag(id=17249, type='language', name='translated', url='/language/translated/', count=109734),
...]
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nhentai.py-2.1.0.tar.gz.
File metadata
- Download URL: nhentai.py-2.1.0.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3221f329e58f22055cf1af13b6256e32727c198d0242b1caf238704855d686f5
|
|
| MD5 |
801544ad1419e67908cf0bbe6d97f1aa
|
|
| BLAKE2b-256 |
5929f743e2d4d0b25d8a4225d7ae497151bcc22d8ee4f1a0887bff825423577c
|
File details
Details for the file nhentai.py-2.1.0-py3-none-any.whl.
File metadata
- Download URL: nhentai.py-2.1.0-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f56dbbc2e516676c15dde3729b1e36ad82f28f7d59e1a65db09a9222974d2df8
|
|
| MD5 |
e1aff981b2ce68830fa6cc765b621695
|
|
| BLAKE2b-256 |
38816d76467811145e176850d1116da0c6d3be4715087c2834b7a15d0d15716a
|