From 154bb8e1993e811629d3d58106d6738c5d0848a5 Mon Sep 17 00:00:00 2001 From: Indrawan I Date: Tue, 11 Apr 2023 22:16:38 +0700 Subject: [PATCH] feat: rebranded mod.land targets from types definitions (#21) * proper hentaifox img url * fix apidocs definitions * add getServer mocks --- README.md | 30 +++++++++---------- package.json | 4 +-- src/JandaPress.ts | 12 +++++++- src/controller/3hentai/3hentaiGet.ts | 6 ++-- src/controller/3hentai/3hentaiRandom.ts | 6 ++-- src/controller/3hentai/3hentaiSearch.ts | 8 ++--- src/controller/asmhentai/asmhentaiGet.ts | 6 ++-- src/controller/asmhentai/asmhentaiRandom.ts | 6 ++-- src/controller/asmhentai/asmhentaiSearch.ts | 6 ++-- src/controller/hentai2read/hentai2readGet.ts | 6 ++-- .../hentai2read/hentai2readSearch.ts | 6 ++-- src/controller/hentaifox/hentaifoxGet.ts | 6 ++-- src/controller/hentaifox/hentaifoxRandom.ts | 6 ++-- src/controller/hentaifox/hentaifoxSearch.ts | 8 ++--- src/controller/nhentai/nhentaiGet.ts | 6 ++-- src/controller/nhentai/nhentaiRandom.ts | 6 ++-- src/controller/nhentai/nhentaiRelated.ts | 6 ++-- src/controller/nhentai/nhentaiSearch.ts | 8 ++--- src/controller/pururin/pururinGet.ts | 6 ++-- src/controller/pururin/pururinRandom.ts | 6 ++-- src/controller/pururin/pururinSearch.ts | 8 ++--- .../simply-hentai/simply-hentaiGet.ts | 6 ++-- src/index.ts | 3 +- .../hentaifox/hentaifoxGetController.ts | 3 +- 24 files changed, 92 insertions(+), 82 deletions(-) diff --git a/README.md b/README.md index c0b5189..62a688a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
-jandapress +jandapress

RESTful and experimental API for the doujinboards

@@ -17,7 +17,7 @@ The motivation of this project is to bring you an actionable data related doujin --- - + - [Jandapress](#) - [The problem](#the-problem) @@ -196,8 +196,8 @@ The missing piece of nhentai.net - https://sinkaroid.github.io/jandapress/#api-n - sort parameters on search - "popular-today", "popular-week", "popular" - Example - - https://janda.mod.land/nhentai/get?book=177013 - - https://janda.mod.land/nhentai/search?key=futanari&page=2&sort=popular-today + - https://janda.sinkaroid.org/nhentai/get?book=177013 + - https://janda.sinkaroid.org/nhentai/search?key=futanari&page=2&sort=popular-today ### Pururin The missing piece of pururin.to - https://sinkaroid.github.io/jandapress/#api-pururin @@ -208,8 +208,8 @@ The missing piece of pururin.to - https://sinkaroid.github.io/jandapress/#api-pu - sort parameters on search - "newest", "most-popular", "highest-rated", "most-viewed", "title", "random" - Example - - https://janda.mod.land/pururin/get?book=63373 - - https://janda.mod.land/pururin/search?key=futanari&page=2&sort=most-viewed + - https://janda.sinkaroid.org/pururin/get?book=63373 + - https://janda.sinkaroid.org/pururin/search?key=futanari&page=2&sort=most-viewed ### Hentaifox The missing piece of hentaifox.com - https://sinkaroid.github.io/jandapress/#api-hentaifox @@ -220,8 +220,8 @@ The missing piece of hentaifox.com - https://sinkaroid.github.io/jandapress/#api - sort parameters on search - "latest", "popular" - Example - - https://janda.mod.land/hentaifox/get?book=97527 - - https://janda.mod.land/hentaifox/search?key=milf&page=2&sort=latest + - https://janda.sinkaroid.org/hentaifox/get?book=97527 + - https://janda.sinkaroid.org/hentaifox/search?key=milf&page=2&sort=latest ### Asmhentai The missing piece of asmhentai.com - https://sinkaroid.github.io/jandapress/#api-asmhentai @@ -232,8 +232,8 @@ The missing piece of asmhentai.com - https://sinkaroid.github.io/jandapress/#api - sort parameters on search - None - Example - - https://janda.mod.land/asmhentai/get?book=416773 - - https://janda.mod.land/asmhentai/search?key=futanari&page=2 + - https://janda.sinkaroid.org/asmhentai/get?book=416773 + - https://janda.sinkaroid.org/asmhentai/search?key=futanari&page=2 ### Hentai2read The missing piece of hentai2read.com - https://sinkaroid.github.io/jandapress/#api-hentai2read @@ -243,8 +243,8 @@ The missing piece of hentai2read.com - https://sinkaroid.github.io/jandapress/#a - sort parameters on search - TBA - Example - - https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1 - - https://janda.mod.land/hentai2read/search?key=futanari + - https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1 + - https://janda.sinkaroid.org/hentai2read/search?key=futanari ### Simply-hentai The missing piece of simply-hentai.com - https://sinkaroid.github.io/jandapress/#api-simply-hentai @@ -253,7 +253,7 @@ The missing piece of simply-hentai.com - https://sinkaroid.github.io/jandapress/ - sort parameters on search - TBA - Example - - https://janda.mod.land/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages + - https://janda.sinkaroid.org/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages ### 3hentai The missing piece of 3hentai.net - https://sinkaroid.github.io/jandapress/#api-3hentai @@ -264,8 +264,8 @@ The missing piece of 3hentai.net - https://sinkaroid.github.io/jandapress/#api-3 - sort parameters on search - "recent", "popular-24h", "popular-7d", "popular" - Example - - https://janda.mod.land/3hentai/get?book=608979 - - https://janda.mod.land/3hentai/search?key=futanari&page=2&sort=popular-7d + - https://janda.sinkaroid.org/3hentai/get?book=608979 + - https://janda.sinkaroid.org/3hentai/search?key=futanari&page=2&sort=popular-7d ## Status response `"success": true,` or `"success": false,` diff --git a/package.json b/package.json index 848d193..18fb195 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ }, "apidoc": { "title": "Jandapress API Documentation", - "url": "https://janda.mod.land", - "sampleUrl": "https://janda.mod.land", + "url": "https://janda.sinkaroid.org", + "sampleUrl": "https://janda.sinkaroid.org", "name": "Jandapress" }, "keywords": [], diff --git a/src/JandaPress.ts b/src/JandaPress.ts index 41acfe8..4792d40 100644 --- a/src/JandaPress.ts +++ b/src/JandaPress.ts @@ -1,4 +1,4 @@ -import p from "phin"; +import p, { IResponse } from "phin"; import Keyv from "keyv"; import { CookieJar } from "tough-cookie"; import { HttpsCookieAgent } from "http-cookie-agent/http"; @@ -131,6 +131,16 @@ class JandaPress { heap: `${Math.round(heap * 100) / 100}/${Math.round(heaptotal * 100) / 100} MB` }; } + + async getServer(): Promise { + const raw = await p({ + "url": "http://ip-api.com/json", + "parse": "json" + }) as IResponse; + const data = raw.body as unknown as { country: string, regionName: string }; + return `${data.country}, ${data.regionName}`; + + } } export default JandaPress; diff --git a/src/controller/3hentai/3hentaiGet.ts b/src/controller/3hentai/3hentaiGet.ts index fe83c58..84497df 100644 --- a/src/controller/3hentai/3hentaiGet.ts +++ b/src/controller/3hentai/3hentaiGet.ts @@ -23,19 +23,19 @@ export async function get3hentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/3hentai/get?book=123 + * curl -i https://janda.sinkaroid.org/3hentai/get?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/3hentai/get?book=123") + * axios.get("https://janda.sinkaroid.org/3hentai/get?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/3hentai/get?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/3hentai/get?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/3hentai/3hentaiRandom.ts b/src/controller/3hentai/3hentaiRandom.ts index e62f887..dadc03f 100644 --- a/src/controller/3hentai/3hentaiRandom.ts +++ b/src/controller/3hentai/3hentaiRandom.ts @@ -17,19 +17,19 @@ export async function random3hentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/3hentai/random + * curl -i https://janda.sinkaroid.org/3hentai/random * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/3hentai/random") + * axios.get("https://janda.sinkaroid.org/3hentai/random") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/3hentai/random") as resp: + * async with session.get("https://janda.sinkaroid.org/3hentai/random") as resp: * print(await resp.json()) * */ diff --git a/src/controller/3hentai/3hentaiSearch.ts b/src/controller/3hentai/3hentaiSearch.ts index 7b7140a..2f42ad1 100644 --- a/src/controller/3hentai/3hentaiSearch.ts +++ b/src/controller/3hentai/3hentaiSearch.ts @@ -27,20 +27,20 @@ export async function search3hentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/3hentai/search?key=yuri - * curl -i https://janda.mod.land/3hentai/search?key=yuri&page=2&sort=recent + * curl -i https://janda.sinkaroid.org/3hentai/search?key=yuri + * curl -i https://janda.sinkaroid.org/3hentai/search?key=yuri&page=2&sort=recent * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/3hentai/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/3hentai/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/3hentai/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/3hentai/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/asmhentai/asmhentaiGet.ts b/src/controller/asmhentai/asmhentaiGet.ts index 6c10900..e43c167 100644 --- a/src/controller/asmhentai/asmhentaiGet.ts +++ b/src/controller/asmhentai/asmhentaiGet.ts @@ -23,19 +23,19 @@ export async function getAsmhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/asmhentai/get?book=123 + * curl -i https://janda.sinkaroid.org/asmhentai/get?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/asmhentai/get?book=123") + * axios.get("https://janda.sinkaroid.org/asmhentai/get?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/asmhentai/get?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/asmhentai/get?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/asmhentai/asmhentaiRandom.ts b/src/controller/asmhentai/asmhentaiRandom.ts index 95fbb3d..78d96ef 100644 --- a/src/controller/asmhentai/asmhentaiRandom.ts +++ b/src/controller/asmhentai/asmhentaiRandom.ts @@ -17,19 +17,19 @@ export async function randomAsmhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/asmhentai/random + * curl -i https://janda.sinkaroid.org/asmhentai/random * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/asmhentai/random") + * axios.get("https://janda.sinkaroid.org/asmhentai/random") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/asmhentai/random") as resp: + * async with session.get("https://janda.sinkaroid.org/asmhentai/random") as resp: * print(await resp.json()) * */ diff --git a/src/controller/asmhentai/asmhentaiSearch.ts b/src/controller/asmhentai/asmhentaiSearch.ts index c431c82..6b3692c 100644 --- a/src/controller/asmhentai/asmhentaiSearch.ts +++ b/src/controller/asmhentai/asmhentaiSearch.ts @@ -24,19 +24,19 @@ export async function searchAsmhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/asmhentai/search?key=yuri + * curl -i https://janda.sinkaroid.org/asmhentai/search?key=yuri * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/asmhentai/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/asmhentai/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/asmhentai/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/asmhentai/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/hentai2read/hentai2readGet.ts b/src/controller/hentai2read/hentai2readGet.ts index 923cded..75beb37 100644 --- a/src/controller/hentai2read/hentai2readGet.ts +++ b/src/controller/hentai2read/hentai2readGet.ts @@ -23,19 +23,19 @@ export async function getHentai2read(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1 + * curl -i https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") + * axios.get("https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") as resp: + * async with session.get("https://janda.sinkaroid.org/hentai2read/get?book=butabako_shotaone_matome_fgo_hen/1") as resp: * print(await resp.json()) */ diff --git a/src/controller/hentai2read/hentai2readSearch.ts b/src/controller/hentai2read/hentai2readSearch.ts index abbac95..d0c9018 100644 --- a/src/controller/hentai2read/hentai2readSearch.ts +++ b/src/controller/hentai2read/hentai2readSearch.ts @@ -21,19 +21,19 @@ export async function searchHentai2read(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/hentai2read/search?key=yuri + * curl -i https://janda.sinkaroid.org/hentai2read/search?key=yuri * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/hentai2read/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/hentai2read/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/hentai2read/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/hentai2read/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/hentaifox/hentaifoxGet.ts b/src/controller/hentaifox/hentaifoxGet.ts index 6a38680..462a61e 100644 --- a/src/controller/hentaifox/hentaifoxGet.ts +++ b/src/controller/hentaifox/hentaifoxGet.ts @@ -23,19 +23,19 @@ export async function getHentaifox(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/hentaifox/get?book=123 + * curl -i https://janda.sinkaroid.org/hentaifox/get?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/hentaifox/get?book=123") + * axios.get("https://janda.sinkaroid.org/hentaifox/get?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/hentaifox/get?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/hentaifox/get?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/hentaifox/hentaifoxRandom.ts b/src/controller/hentaifox/hentaifoxRandom.ts index 156eada..5a85d11 100644 --- a/src/controller/hentaifox/hentaifoxRandom.ts +++ b/src/controller/hentaifox/hentaifoxRandom.ts @@ -17,19 +17,19 @@ export async function randomHentaifox(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/hentaifox/random + * curl -i https://janda.sinkaroid.org/hentaifox/random * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/hentaifox/random") + * axios.get("https://janda.sinkaroid.org/hentaifox/random") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/hentaifox/random") as resp: + * async with session.get("https://janda.sinkaroid.org/hentaifox/random") as resp: * print(await resp.json()) * */ diff --git a/src/controller/hentaifox/hentaifoxSearch.ts b/src/controller/hentaifox/hentaifoxSearch.ts index 4834df6..0294623 100644 --- a/src/controller/hentaifox/hentaifoxSearch.ts +++ b/src/controller/hentaifox/hentaifoxSearch.ts @@ -21,20 +21,20 @@ export async function searchHentaifox(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/hentaifox/search?key=yuri - * curl -i https://janda.mod.land/hentaifox/search?key=yuri&page=2&sort=latest + * curl -i https://janda.sinkaroid.org/hentaifox/search?key=yuri + * curl -i https://janda.sinkaroid.org/hentaifox/search?key=yuri&page=2&sort=latest * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/hentaifox/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/hentaifox/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/hentaifox/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/hentaifox/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/nhentai/nhentaiGet.ts b/src/controller/nhentai/nhentaiGet.ts index c5bf52d..f765493 100644 --- a/src/controller/nhentai/nhentaiGet.ts +++ b/src/controller/nhentai/nhentaiGet.ts @@ -22,19 +22,19 @@ export async function getNhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/nhentai/get?book=123 + * curl -i https://janda.sinkaroid.org/nhentai/get?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/nhentai/get?book=123") + * axios.get("https://janda.sinkaroid.org/nhentai/get?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/nhentai/get?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/nhentai/get?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/nhentai/nhentaiRandom.ts b/src/controller/nhentai/nhentaiRandom.ts index 4f6c519..53bbdca 100644 --- a/src/controller/nhentai/nhentaiRandom.ts +++ b/src/controller/nhentai/nhentaiRandom.ts @@ -18,19 +18,19 @@ export async function randomNhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/nhentai/random + * curl -i https://janda.sinkaroid.org/nhentai/random * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/nhentai/random") + * axios.get("https://janda.sinkaroid.org/nhentai/random") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/nhentai/random") as resp: + * async with session.get("https://janda.sinkaroid.org/nhentai/random") as resp: * print(await resp.json()) * */ diff --git a/src/controller/nhentai/nhentaiRelated.ts b/src/controller/nhentai/nhentaiRelated.ts index 5479dd9..9ed3f7a 100644 --- a/src/controller/nhentai/nhentaiRelated.ts +++ b/src/controller/nhentai/nhentaiRelated.ts @@ -22,19 +22,19 @@ export async function relatedNhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/nhentai/related?book=123 + * curl -i https://janda.sinkaroid.org/nhentai/related?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/nhentai/related?book=123") + * axios.get("https://janda.sinkaroid.org/nhentai/related?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/nhentai/related?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/nhentai/related?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/nhentai/nhentaiSearch.ts b/src/controller/nhentai/nhentaiSearch.ts index 6317cba..677a446 100644 --- a/src/controller/nhentai/nhentaiSearch.ts +++ b/src/controller/nhentai/nhentaiSearch.ts @@ -26,20 +26,20 @@ export async function searchNhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/nhentai/search?key=yuri - * curl -i https://janda.mod.land/nhentai/search?key=yuri&page=2&sort=popular-today + * curl -i https://janda.sinkaroid.org/nhentai/search?key=yuri + * curl -i https://janda.sinkaroid.org/nhentai/search?key=yuri&page=2&sort=popular-today * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/nhentai/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/nhentai/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/nhentai/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/nhentai/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/pururin/pururinGet.ts b/src/controller/pururin/pururinGet.ts index bd00d0a..2130ac4 100644 --- a/src/controller/pururin/pururinGet.ts +++ b/src/controller/pururin/pururinGet.ts @@ -23,19 +23,19 @@ export async function getPururin(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/pururin/get?book=123 + * curl -i https://janda.sinkaroid.org/pururin/get?book=123 * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/pururin/get?book=123") + * axios.get("https://janda.sinkaroid.org/pururin/get?book=123") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/pururin/get?book=123") as resp: + * async with session.get("https://janda.sinkaroid.org/pururin/get?book=123") as resp: * print(await resp.json()) */ diff --git a/src/controller/pururin/pururinRandom.ts b/src/controller/pururin/pururinRandom.ts index 383b23f..d80643c 100644 --- a/src/controller/pururin/pururinRandom.ts +++ b/src/controller/pururin/pururinRandom.ts @@ -19,19 +19,19 @@ export async function randomPururin(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/pururin/random + * curl -i https://janda.sinkaroid.org/pururin/random * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/pururin/random") + * axios.get("https://janda.sinkaroid.org/pururin/random") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/pururin/random") as resp: + * async with session.get("https://janda.sinkaroid.org/pururin/random") as resp: * print(await resp.json()) * */ diff --git a/src/controller/pururin/pururinSearch.ts b/src/controller/pururin/pururinSearch.ts index 85e4070..6099213 100644 --- a/src/controller/pururin/pururinSearch.ts +++ b/src/controller/pururin/pururinSearch.ts @@ -27,20 +27,20 @@ export async function searchPururin(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/pururin/search?key=yuri - * curl -i https://janda.mod.land/pururin/search?key=yuri&page=2&sort=newest + * curl -i https://janda.sinkaroid.org/pururin/search?key=yuri + * curl -i https://janda.sinkaroid.org/pururin/search?key=yuri&page=2&sort=newest * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/pururin/search?key=yuri") + * axios.get("https://janda.sinkaroid.org/pururin/search?key=yuri") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/pururin/search?key=yuri") as resp: + * async with session.get("https://janda.sinkaroid.org/pururin/search?key=yuri") as resp: * print(await resp.json()) */ diff --git a/src/controller/simply-hentai/simply-hentaiGet.ts b/src/controller/simply-hentai/simply-hentaiGet.ts index a99940d..268e91b 100644 --- a/src/controller/simply-hentai/simply-hentaiGet.ts +++ b/src/controller/simply-hentai/simply-hentaiGet.ts @@ -25,19 +25,19 @@ export async function getSimplyhentai(req: Request, res: Response) { * HTTP/1.1 400 Bad Request * * @apiExample {curl} curl - * curl -i https://janda.mod.land/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages + * curl -i https://janda.sinkaroid.org/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages * * @apiExample {js} JS/TS * import axios from "axios" * - * axios.get("https://janda.mod.land/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages") + * axios.get("https://janda.sinkaroid.org/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages") * .then(res => console.log(res.data)) * .catch(err => console.error(err)) * * @apiExample {python} Python * import aiohttp * async with aiohttp.ClientSession() as session: - * async with session.get("https://janda.mod.land/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages") as resp: + * async with session.get("https://janda.sinkaroid.org/simply-hentai/get?book=fate-grand-order/fgo-sanbunkatsuhou/all-pages") as resp: * print(await resp.json()) */ diff --git a/src/index.ts b/src/index.ts index b260d54..0b6d2fd 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,7 @@ const janda = new JandaPress(); const app = express(); -app.get("/", slow, limiter, (req, res) => { +app.get("/", slow, limiter, async (req, res) => { res.send({ success: true, message: "Hi, I'm alive!", @@ -20,6 +20,7 @@ app.get("/", slow, limiter, (req, res) => { date: new Date().toLocaleString(), rss: janda.currentProccess().rss, heap: janda.currentProccess().heap, + server: await janda.getServer(), version: `${pkg.version}`, }); logger.info({ diff --git a/src/scraper/hentaifox/hentaifoxGetController.ts b/src/scraper/hentaifox/hentaifoxGetController.ts index 980dc74..499c4ee 100644 --- a/src/scraper/hentaifox/hentaifoxGetController.ts +++ b/src/scraper/hentaifox/hentaifoxGetController.ts @@ -24,8 +24,7 @@ export async function scrapeContent(url: string) { }).get(); const imgSrc = $("img").map((i, el) => $(el).attr("data-src")).get(); - const parameterImg = imgSrc[0].split("/").slice(5).join("/"); - const parameterImg2 = parameterImg.split("/").slice(0, -1).join("/"); + const parameterImg2 = imgSrc[0].split("/").slice(0, 5).join("/"); const extensionImg = `.${imgSrc[0].split(".").slice(-1)[0]}`; const info = $("span.i_text.pages").map((i, abc) => { return $(abc).text();