ehentai-js
Grab everything from e-hentai.org(exhentai).
Features
- gallery metadata
- hentaihome status
- Static ranges
- Quality, hathrate, hitrate...
- exchange status
- gallery point exchange
- hath exchange
- search support
- search keyword
- search image
- advance options
- user-related
- rate gallery
- favorite gallery
Installation
$ npm install ehentai-js
Configuration
Configuration file should be placed as os.homedir()/.ehentai.json
(~/.ehentai.json
)
path path;
Format:
Cookie is required for visiting exhentai site or getting user-related information;
Apiuid and apikey are required for user-related operations such as rating.
Using environment variables is also supported.
EH_COOKIE=
EH_APIUID=
EH_APIKEY=
gallery
const h = ; // two ways to provide target urlhgallery ;// orhgallery ;
{
title: '[Shinozuka Yuuji] Hajimete no Hitozuma | 初品嘗的美艷人妻 [Chinese]',
title_original: '[篠塚裕志] 初めてのヒトヅマ [中国翻訳]',
category: 'Manga',
tags: {
language: [ 'chinese', 'translated' ],
artist: [ 'shinozuka yuuji' ],
male: [
'dilf',
'cheating',
'schoolboy uniform',
'condom',
'muscle',
'big penis',
'glasses'
],
female: [
'big breasts', 'stockings',
'netorare', 'teacher',
'hairy', 'gyaru',
'blackmail', 'dark skin',
'paizuri', 'x-ray',
'ponytail', 'mother',
'milf', 'cheating',
'nakadashi', 'pantyhose',
'collar', 'impregnation',
'huge breasts', 'lactation'
],
misc: [ 'tankoubon', 'incest', 'inseki' ]
},
language: 'Chinese',
translated: true,
favorite_category: undefined,
source: {
site: 'exhentai',
gid: 1456937,
token: '9345049afa',
parent_gallery: undefined,
newer_versions: [],
url: 'https://exhentai.org/g/1456937/9345049afa/'
},
favcount: 7623,
rating: { average: 4.9, count: 468 },
thumbnail: 'https://exhentai.org/t/33/81/3381628f4615c218cdd262bf45e6bea6e4f44f7d-6050794-4341-3000-jpg_250.jpg',
uploader: 'dfsgg',
filecount: 236,
filesize: 717121126,
posted: 2019-08-04T09:07:00.000Z,
visible: 'Yes',
comments: [
{
text: '速度好快 今晚社保!!!5555',
date: 2019-08-04T09:25:00.000Z,
score: 7
},
{
text: '昨天才生肉,今天就出貨了,篠塚裕志的就是報社',
date: 2019-08-04T09:46:00.000Z,
score: 60
},
{
text: '我還是等未來數位的出了再買吧',
date: 2019-08-04T10:14:00.000Z,
score: 144
},
{ text: '🐍🐍🐍🐍🐍', date: 2019-08-04T10:14:00.000Z, score: 6 },
// ...
],
url: 'https://exhentai.org/g/1456937/9345049afa/',
generated: 2020-01-10T02:19:47.430Z
}
search
Support 5 different display modes (this will effect the tags field in search results).
Support keyword search & image search.
const h = ;hsearch; hsearch ;
[
{
url: 'https://exhentai.org/g/1458970/d7c3ad55be/',
name: '[Shinozuka Yuuji] Hajimete no Hitozuma [Digital]',
tags: [],
page: 240
},
{
url: 'https://exhentai.org/g/1458308/c4ceea2408/',
name: '[Shinozuka Yuuji] Hajimete no Hitozuma',
tags: [],
page: 237
},
{
url: 'https://exhentai.org/g/1456937/9345049afa/',
name: '[Shinozuka Yuuji] Hajimete no Hitozuma | 初品嘗的美艷人妻 [Chinese]',
tags: [ 'language:chinese' ],
page: 236
}
//...
]
const h = ;const filepath = "Gaol_001.jpg";hsearch;
url: "https://exhentai.org/g/1456937/9345049afa/" name: "[Shinozuka Yuuji] Hajimete no Hitozuma | 初品嘗的美艷人妻 [Chinese]" tags: "language:chinese" page: 236 ;
exchange
const h = ; hexchange;hexchange;
hentaihome
const h = ;hhentaihome;
[
{
cid: '*****',
status: 'Online',
created: 2019-12-19T00:00:00.000Z,
lastSeen: 'Today, 02:22',
served: 273739,
ip: '***.***.***.***',
port: '****',
trust: 1000,
quality: 9092,
hitrate: 14.8,
hathrate: 8.3,
country: 'United States'
}
]
const h = ;hhentaihome;
user
Rate
const h = ;huser ;
Favorite
const h = ;huser ; huser;
agent
Getting library's request agent interface crawlx - npm
const h = require("ehentai-js");
console.log(h.x.agentOptions.headers);
h.x({ url: "https://exhentai.org/", parse: "title" }).then(
({ res, parsed }) => {
console.log(res.status);
console.log(parsed);
}
);