nhentai 1.0.0-dev.11 nhentai: ^1.0.0-dev.11 copied to clipboard
Powerful client for nhentai.net undocumented APIs, with cookies, proxy, full data model and more.
Client for nhentai.net undocumented APIs #
Features #
- Full model (books, images, tags, comments, users).
- Search for text query.
- Search by tag(s).
- Get random book.
- Configurable hosts.
- Support for custom
Client
(viapackage:http
). - Out-of-box HTTP proxy support (configurable via URI).
- Out-of-box User Agent override and Cookies support.
Notes about web usage #
Using this module on web platform is experimental and has some drawbacks:
- You can't access nhentai directly due to CORS.
- Workaround: use CORS enabled mirror (for example you can use dev-mirror).
API#getRandomBook
doesn't work due to limitations ofXHR
.- Proxy isn't supported on web.
- User Agent override isn't supported.
- Cookies helper functions aren't supported.
Usage #
Import the package:
import 'package:nhentai/nhentai.dart';
Create client instance:
final api = API();
Get the data:
/// Throws if book is not found, or parse failed, see docs.
final Book book = await api.getBook(177013);
// Short book summary
print(
'Book: $book\n'
'Artists: ${book.tags.artists.join(', ')}\n'
'Languages: ${book.tags.languages.join(', ')}\n'
'Cover: ${book.cover.getUrl(api: api)}\n'
'First page: ${book.pages.first.getUrl(api: api)}\n'
'First page thumbnail: ${book.pages.first.thumbnail.getUrl(api: api)}\n',
);
See more usage at example folder.
License #
- ISC License