Zekfad / nhentai-api

Node.JS client for nhentai.net undocumented API.
https://zekfad.github.io/nhentai-api/
ISC License
42 stars 6 forks source link

update endpoints (add sort) #5

Closed Zekfad closed 2 years ago

Zekfad commented 4 years ago

We need to check all endpoints for new available parameters.

Sort example: https://github.com/CodexScript/nhentai-api/blob/c0eacbbec060500478bae1149b97b9a3d4606693/src/api.js#L37

Zekfad commented 2 years ago

Workaround for searching with sort: Right now queries are unescaped so, you can do following:

let q = encodeURIComponent('Some search');
let sort = ['popular', 'popular-today', 'popular-week'][0] // 0, 1, 2, 3
search(text + (sort ? '&sort=' + sort : '')).then(/* ... */);