Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nekopoi-scraper

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nekopoi-scraper - npm Package Compare versions

Comparing version 2.6.8 to 2.6.9

dist/@types/Config/index.d.ts

36

dist/@types/index.d.ts
/**
* Get recent hentai
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getRecent: () => Promise<object>;
export { getRecent as latest };
export declare const latest: () => Promise<object>;
/**
* Get all list ** by type.
* @param {String} tipe (optional), eg. "jav" or "hentai", default "hentai".
* @param {String|Number} page (optional), eg. 2 or idk it can be return error maybe.
* @returns {Promise<Object>}
* @param {String} _type (optional), eg. "jav" or "hentai", default "hentai".
* @param {Number} page (optional), eg. 2, default 1.
* @return {Promise<Object>}
*/
export declare const list: (tipe?: string, page?: number | string) => Promise<object>;
export declare const list: (_type?: string, page?: number) => Promise<object>;
/**

@@ -18,24 +17,19 @@ * get hentai by query.

* @param {Number} limit (optional), for number of output, eg. 10
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const Search: (query: string, limit?: number | string) => Promise<object>;
export { Search as search };
export declare const search: (query: string, limit?: number) => Promise<object>;
/**
* get hentai detail by id
* @param {Number} id
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getId: (id: number) => Promise<object>;
export { getId as detail };
declare const nekopoi: {
search: (query: string, limit?: number | string) => Promise<object>;
export declare const detail: (id: number) => Promise<object>;
declare const kucingPoi: {
search: (query: string, limit?: number) => Promise<object>;
latest: () => Promise<object>;
list: (tipe?: string, page?: number | string) => Promise<object>;
list: (_type?: string, page?: number) => Promise<object>;
detail: (id: number) => Promise<object>;
Search: (query: string, limit?: number | string) => Promise<object>;
getRecent: () => Promise<object>;
getId: (id: number) => Promise<object>;
};
export default nekopoi;
/** @encode */
export default kucingPoi;
/** Hello :) */
//# sourceMappingURL=index.d.ts.map
/**
* Get recent hentai
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getRecent: () => Promise<object>;
export { getRecent as latest };
export declare const latest: () => Promise<object>;
/**
* Get all list ** by type.
* @param {String} tipe (optional), eg. "jav" or "hentai", default "hentai".
* @param {String|Number} page (optional), eg. 2 or idk it can be return error maybe.
* @returns {Promise<Object>}
* @param {String} _type (optional), eg. "jav" or "hentai", default "hentai".
* @param {Number} page (optional), eg. 2, default 1.
* @return {Promise<Object>}
*/
export declare const list: (tipe?: string, page?: number | string) => Promise<object>;
export declare const list: (_type?: string, page?: number) => Promise<object>;
/**

@@ -18,24 +17,19 @@ * get hentai by query.

* @param {Number} limit (optional), for number of output, eg. 10
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const Search: (query: string, limit?: number | string) => Promise<object>;
export { Search as search };
export declare const search: (query: string, limit?: number) => Promise<object>;
/**
* get hentai detail by id
* @param {Number} id
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getId: (id: number) => Promise<object>;
export { getId as detail };
declare const nekopoi: {
search: (query: string, limit?: number | string) => Promise<object>;
export declare const detail: (id: number) => Promise<object>;
declare const kucingPoi: {
search: (query: string, limit?: number) => Promise<object>;
latest: () => Promise<object>;
list: (tipe?: string, page?: number | string) => Promise<object>;
list: (_type?: string, page?: number) => Promise<object>;
detail: (id: number) => Promise<object>;
Search: (query: string, limit?: number | string) => Promise<object>;
getRecent: () => Promise<object>;
getId: (id: number) => Promise<object>;
};
export default nekopoi;
/** @encode */
export default kucingPoi;
/** Hello :) */
//# sourceMappingURL=index.d.ts.map

@@ -6,24 +6,23 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.detail = exports.getId = exports.search = exports.Search = exports.list = exports.latest = exports.getRecent = void 0;
exports.detail = exports.search = exports.list = exports.latest = void 0;
/**
* @warning
* @author FrierenDv
* @version 2.6.8
* @see @link https://github.com/xct007/nekopoi-scraper
* @version 2.6.9
*
* Don't forget to star the repo :)
* @link (https://github.com/xct007/nekopoi-scraper)
*/
const axios_1 = __importDefault(require("axios"));
const Config_js_1 = require("./Config.js");
const index_js_1 = require("./Config/index.js");
/**
* Get recent hentai
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
const getRecent = async () => {
const latest = async () => {
let result = [];
const data = await axios_1.default
.get(Config_js_1.URL_RECENT, {
...Config_js_1.Config,
.get(index_js_1.URL_RECENT, {
...index_js_1.Config,
})
.catch((e) => {
return e.response;
});
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && data.data.carousel) {

@@ -39,3 +38,3 @@ for (const i of data.data.carousel) {

return {
status: false,
error: true,
message: "failed to fetch data from {URL_RECENT}",

@@ -46,20 +45,17 @@ };

};
exports.getRecent = getRecent;
exports.latest = exports.getRecent;
exports.latest = latest;
/**
* Get all list ** by type.
* @param {String} tipe (optional), eg. "jav" or "hentai", default "hentai".
* @param {String|Number} page (optional), eg. 2 or idk it can be return error maybe.
* @returns {Promise<Object>}
* @param {String} _type (optional), eg. "jav" or "hentai", default "hentai".
* @param {Number} page (optional), eg. 2, default 1.
* @return {Promise<Object>}
*/
const list = async (tipe, page) => {
const list = async (_type, page) => {
let result = [];
const data = await axios_1.default
.get((0, Config_js_1.URL_LIST)(tipe ? tipe : "hentai", page ? page : 1), {
...Config_js_1.Config,
.get((0, index_js_1.URL_LIST)(_type ? _type : "hentai", page ? page : 1), {
...index_js_1.Config,
})
.catch((e) => {
return e.response;
});
if (data.data && data.data.result.length) {
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && Array.isArray(data.data.result)) {
for (const i of data.data.result) {

@@ -73,4 +69,4 @@ result.push({

return {
status: false,
message: "failed to fetch data from {URL_LIST()}",
error: true,
message: "failed to fetch data from {URL_LIST}",
};

@@ -85,14 +81,12 @@ }

* @param {Number} limit (optional), for number of output, eg. 10
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
const Search = async (query, limit) => {
const search = async (query, limit) => {
let result = [];
const data = await axios_1.default
.get((0, Config_js_1.URL_SEARCH)(query), {
...Config_js_1.Config,
.get((0, index_js_1.URL_SEARCH)(query), {
...index_js_1.Config,
})
.catch((e) => {
return e.response;
});
if (data.data && data.data.result.length) {
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && Array.isArray(data.data.result)) {
let _tmp = [];

@@ -102,3 +96,3 @@ for (const i of data.data.result) {

}
_tmp = _tmp.filter((val, i) => i < (limit ? Number(limit) : 10));
_tmp = _tmp.filter((val, i) => i < (limit ? limit : 10));
result = _tmp;

@@ -108,3 +102,3 @@ }

return {
status: false,
error: true,
message: "failed to fetch data from {URL_SEARCH}",

@@ -115,21 +109,17 @@ };

};
exports.Search = Search;
exports.search = exports.Search;
exports.search = search;
/**
* get hentai detail by id
* @param {Number} id
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
const getId = async (id) => {
const detail = async (id) => {
let result;
let data = await axios_1.default
.get((0, Config_js_1.URL_SERIES)(id), {
...Config_js_1.Config,
.get((0, index_js_1.URL_SERIES)(id), {
...index_js_1.Config,
})
.catch((e) => {
return e.response;
});
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && data.data.episode) {
const temp = data.data;
let genre;
if (temp.info_meta.genre && temp.info_meta.genre.length) {

@@ -149,4 +139,4 @@ let _temp = [];

data = await axios_1.default
.get((0, Config_js_1.URL_POST)(id), {
...Config_js_1.Config,
.get((0, index_js_1.URL_POST)(id), {
...index_js_1.Config,
})

@@ -156,3 +146,3 @@ .catch((e) => {

});
if (data.data && data.data.stream.length) {
if (data.data && Array.isArray(data.data.stream)) {
/** remove some unused <Object> */

@@ -165,4 +155,4 @@ delete data.data["content"];

else {
result = {
status: false,
return {
error: true,
message: "Empty stream result {URL_POST} maybe wrong id or idk",

@@ -174,15 +164,11 @@ };

};
exports.getId = getId;
exports.detail = exports.getId;
const nekopoi = {
search: exports.Search,
latest: exports.getRecent,
exports.detail = detail;
const kucingPoi = {
search: exports.search,
latest: exports.latest,
list: exports.list,
detail: exports.getId,
Search: exports.Search,
getRecent: exports.getRecent,
getId: exports.getId
detail: exports.detail,
};
exports.default = nekopoi;
/** @encode */
exports.default = kucingPoi;
/** Hello :) */
//# sourceMappingURL=index.js.map
/**
* Get recent hentai
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getRecent: () => Promise<object>;
export { getRecent as latest };
export declare const latest: () => Promise<object>;
/**
* Get all list ** by type.
* @param {String} tipe (optional), eg. "jav" or "hentai", default "hentai".
* @param {String|Number} page (optional), eg. 2 or idk it can be return error maybe.
* @returns {Promise<Object>}
* @param {String} _type (optional), eg. "jav" or "hentai", default "hentai".
* @param {Number} page (optional), eg. 2, default 1.
* @return {Promise<Object>}
*/
export declare const list: (tipe?: string, page?: number | string) => Promise<object>;
export declare const list: (_type?: string, page?: number) => Promise<object>;
/**

@@ -18,24 +17,19 @@ * get hentai by query.

* @param {Number} limit (optional), for number of output, eg. 10
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const Search: (query: string, limit?: number | string) => Promise<object>;
export { Search as search };
export declare const search: (query: string, limit?: number) => Promise<object>;
/**
* get hentai detail by id
* @param {Number} id
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export declare const getId: (id: number) => Promise<object>;
export { getId as detail };
declare const nekopoi: {
search: (query: string, limit?: number | string) => Promise<object>;
export declare const detail: (id: number) => Promise<object>;
declare const kucingPoi: {
search: (query: string, limit?: number) => Promise<object>;
latest: () => Promise<object>;
list: (tipe?: string, page?: number | string) => Promise<object>;
list: (_type?: string, page?: number) => Promise<object>;
detail: (id: number) => Promise<object>;
Search: (query: string, limit?: number | string) => Promise<object>;
getRecent: () => Promise<object>;
getId: (id: number) => Promise<object>;
};
export default nekopoi;
/** @encode */
export default kucingPoi;
/** Hello :) */
//# sourceMappingURL=index.d.ts.map
/**
* @warning
* @author FrierenDv
* @version 2.6.8
* @see @link https://github.com/xct007/nekopoi-scraper
* @version 2.6.9
*
* Don't forget to star the repo :)
* @link (https://github.com/xct007/nekopoi-scraper)
*/
import axios from "axios";
import { Config, URL_RECENT, URL_LIST, URL_SEARCH, URL_POST, URL_SERIES, } from "./Config.js";
import { Config, URL_RECENT, URL_LIST, URL_SEARCH, URL_POST, URL_SERIES, } from "./Config/index.js";
/**
* Get recent hentai
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export const getRecent = async () => {
export const latest = async () => {
let result = [];

@@ -19,5 +20,3 @@ const data = await axios

})
.catch((e) => {
return e.response;
});
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && data.data.carousel) {

@@ -33,3 +32,3 @@ for (const i of data.data.carousel) {

return {
status: false,
error: true,
message: "failed to fetch data from {URL_RECENT}",

@@ -40,19 +39,16 @@ };

};
export { getRecent as latest };
/**
* Get all list ** by type.
* @param {String} tipe (optional), eg. "jav" or "hentai", default "hentai".
* @param {String|Number} page (optional), eg. 2 or idk it can be return error maybe.
* @returns {Promise<Object>}
* @param {String} _type (optional), eg. "jav" or "hentai", default "hentai".
* @param {Number} page (optional), eg. 2, default 1.
* @return {Promise<Object>}
*/
export const list = async (tipe, page) => {
export const list = async (_type, page) => {
let result = [];
const data = await axios
.get(URL_LIST(tipe ? tipe : "hentai", page ? page : 1), {
.get(URL_LIST(_type ? _type : "hentai", page ? page : 1), {
...Config,
})
.catch((e) => {
return e.response;
});
if (data.data && data.data.result.length) {
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && Array.isArray(data.data.result)) {
for (const i of data.data.result) {

@@ -66,4 +62,4 @@ result.push({

return {
status: false,
message: "failed to fetch data from {URL_LIST()}",
error: true,
message: "failed to fetch data from {URL_LIST}",
};

@@ -77,5 +73,5 @@ }

* @param {Number} limit (optional), for number of output, eg. 10
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export const Search = async (query, limit) => {
export const search = async (query, limit) => {
let result = [];

@@ -86,6 +82,4 @@ const data = await axios

})
.catch((e) => {
return e.response;
});
if (data.data && data.data.result.length) {
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && Array.isArray(data.data.result)) {
let _tmp = [];

@@ -95,3 +89,3 @@ for (const i of data.data.result) {

}
_tmp = _tmp.filter((val, i) => i < (limit ? Number(limit) : 10));
_tmp = _tmp.filter((val, i) => i < (limit ? limit : 10));
result = _tmp;

@@ -101,3 +95,3 @@ }

return {
status: false,
error: true,
message: "failed to fetch data from {URL_SEARCH}",

@@ -108,9 +102,8 @@ };

};
export { Search as search };
/**
* get hentai detail by id
* @param {Number} id
* @returns {Promise<Object>}
* @return {Promise<Object>}
*/
export const getId = async (id) => {
export const detail = async (id) => {
let result;

@@ -121,8 +114,5 @@ let data = await axios

})
.catch((e) => {
return e.response;
});
.catch((e) => e === null || e === void 0 ? void 0 : e.response);
if (data.data && data.data.episode) {
const temp = data.data;
let genre;
if (temp.info_meta.genre && temp.info_meta.genre.length) {

@@ -148,3 +138,3 @@ let _temp = [];

});
if (data.data && data.data.stream.length) {
if (data.data && Array.isArray(data.data.stream)) {
/** remove some unused <Object> */

@@ -157,4 +147,4 @@ delete data.data["content"];

else {
result = {
status: false,
return {
error: true,
message: "Empty stream result {URL_POST} maybe wrong id or idk",

@@ -166,14 +156,10 @@ };

};
export { getId as detail };
const nekopoi = {
search: Search,
latest: getRecent,
const kucingPoi = {
search,
latest,
list,
detail: getId,
Search,
getRecent,
getId
detail,
};
export default nekopoi;
/** @encode */
export default kucingPoi;
/** Hello :) */
//# sourceMappingURL=index.js.map
{
"name": "nekopoi-scraper",
"version": "2.6.8",
"version": "2.6.9",
"description": "Simple nekopoi scraper",

@@ -42,3 +42,2 @@ "exports": {

"devDependencies": {
"@types/jquery": "^3.5.14",
"rimraf": "^3.0.2",

@@ -45,0 +44,0 @@ "ts-node": "^10.9.1",

@@ -7,3 +7,3 @@ <a name="readme-top"></a>

<a href="#">
<img src="images/logo.png" alt="Logo" width="80" height="80">
<img src="https://static.zerochan.net/Frieren.full.3233127.jpg" alt="Logo">
</a>

@@ -13,5 +13,11 @@

<img alt="npm" src="https://img.shields.io/npm/dw/nekopoi-scraper">
<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Fxct007%2Fnekopoi-scraper"><img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fxct007%2Fnekopoi-scraper&countColor=%232ccce4&style=flat" /></a>
<img alt="NPM" src="https://img.shields.io/npm/l/nekopoi-scraper">
<a href="https://visitorbadge.io/status?path=https%3A%2F%2Fgithub.com%2Fxct007%2Fnekopoi-scraper"></a>
<img src="https://api.visitorbadge.io/api/visitors?path=https%3A%2F%2Fgithub.com%2Fxct007%2Fnekopoi-scraper&countColor=%232ccce4&style=flat" />
<img alt="CodeFactor Grade" src="https://img.shields.io/codefactor/grade/github/xct007/nekopoi-scraper/main">
</div>
## Note:
`Dont forget to star the repo :)`
### How To Use

@@ -33,19 +39,7 @@

```js
/** Export name
search or Search
latest or getRecent
detail or getId
list
*/
const { Search, getRecent, list, getId } = require("nekopoi-scraper");
const { search, latest, list, detail } = require("nekopoi-scraper");
```
- `ESM`
```js
/** Export name
search or Search
latest or getRecent
detail or getId
list
*/
import { Search, getRecent, list, getId } from "nekopoi-scraper";
```ts
import { search, latest, list, detail } from "nekopoi-scraper";
```

@@ -55,11 +49,12 @@

<details><summary><b>Get hentai by query</b></summary>
<details><summary><b>Search hentai by query</b></summary>
```js
import { Search } from "nekopoi-scraper";
import { search } from "nekopoi-scraper";
const query = "love";
const limit = 10; // limit output. default 10
Search(query, limit).then(async (data) => {
console.log(data);
const limit = 10; // (optional) limit output. default 10
search(query, limit).then((data) => {
console.log(data);
});

@@ -84,8 +79,8 @@

<details><summary><b>Get latest/recent hentai</b></summary>
<details><summary><b>Get latest hentai</b></summary>
```js
import { getRecent } from "nekopoi-scraper";
import { latest } from "nekopoi-scraper";
getRecent().then(async (data) => {
latest().then((data) => {
console.log(data);

@@ -105,2 +100,3 @@ });

},
...
];

@@ -114,5 +110,5 @@ ```

```js
import { getId } from "nekopoi-scraper";
import { detail } from "nekopoi-scraper";
getId(21910).then(async (data) => {
detail(21910).then((data) => {
console.log(data);

@@ -195,3 +191,3 @@ });

const page = 1; // optional
list(type, page).then(async (data) => {
list(type, page).then((data) => {
console.log(data);

@@ -218,6 +214,11 @@ });

## TODO
## Contributing
- [x] Make code more readable
- [ ] Etc.
If have a suggestion that whould make this better, please fork and create a pull request. You can also simply open an issue. Don't forget to give the repo a star!
```
1. Fork the repo
2. Commit your Changes
3. Push to the Branch
4. Open a Pull Request
```

@@ -224,0 +225,0 @@ ## Contact

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc