aboutsummaryrefslogtreecommitdiff
path: root/wholesome.js
blob: 551fb82b3d82767766019e3cddd8e9b00eb15f6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const fetch = require("node-fetch")
const child = require("child_process")

const link = "https://nhentai.net/g/"
const ids = []

fetch("https://wholesomelist.com/list")
	.then(data => data.text())
	.then(data => {
		while (true) {
			const pos = data.search(link)

			if (pos == -1)
				break;

			data = data.slice(pos + link.length)
			const id = parseInt(data)
			if (id)
				ids.push(id)
		}

		child.spawn("nhentai", ["--id", ids.join(",")], { stdio: "inherit" })
	})