Since I notice how my scraping code took too long to load
the Nhentai website now checks for the browser to check if its a bot or not
and I am not gonna work with this anymore.
Thank you all who used this package!
kinda funny how the dev says it. Well I can actually bypass it but will take more processe/time to fetch which kinda could be shit when used on some discord bots.
The "N-hentai-api" is a fast and easy to use api for connecting to nhentai.net and nhentai.to data.
- Fast*
- Easy to use
- Reliable* :>
-
Discord friendly?
To install "N-hentai-api" type these:
npm i kasu.nhentaiapi.js
To get the basic info about the ID/Doujin:
const Example = require('kasu.nhentaiapi.js');
const ExampleApi = new Example();
/**
* or const ExampleApi = new Example('start', "https://nhentai.net");
* If you don't want to add the url and connection.start() after it.
* because it automatically start the connection.
*
* Check the documentation or the homepage for more info.
*/
// ----number | strings can do----
const ID = 228922 //or "228922" or "https://nhentai.net/g/228922"
async function json(){
// start the connection
ExampleApi.url = "https://nhentai.net"
ExampleApi.connection.start()
const val = await ExampleApi.getID(ID).json()
val.url
// OR
ExampleApi.getID(ID).json(data=>{data.url})
// OR
(await ExampleApi.getID(ID).json()).url
// result: https://nhentai.net/g/228922/
// closes the connection
ExampleApi.connection.close()
}
How to run:
nhentai 228922
check the changelogs for more info
C# of this project's parser is now available in beta. click here to go there.