`node stats-tags.js`: Displays tags sorted by how many doujins are available for each tag. May produce long output, you might want to pipe it into `head`, `grep` or `less`.
-`node wholesome.js`: Scrapes [wholesome hentais](https://wholesomelist.com/list). This takes a long time since it's about 2700 hentais in total (may consume 50GB of disk space), but you can abort it any time (and resume it later).
+`node scrape-wholesome.js`: Scrapes [wholesome hentais](https://wholesomelist.com/list). This takes a long time since it's about 2700 hentais in total (consumes about 32GB of disk space), but you can abort it any time (and resume it later).
+
+`node scrape.js <criterium> <value>`: Scrapes doujins by criterium, where criterium can be tag, artist, character, parody or group and value is the value. E.g. `node scrape.js tag full-color` scrapes fully colored doujins.
Note: you might want to create a subdirectory and put the doujins into there, they will all be put into the current working directory. (Run the scripts from a different directory to prevent spamming this directory)
Of course, you can also run these scripts in a directory where you already downloaded doujins using the `nhentai` tool, but make sure to run the symlinks script to "register" them all in the system.
"license": "GPL-3.0-or-later",
"dependencies": {
"node-fetch": "^2.0.0"
- },
- "devDependencies": {}
+ }
},
"node_modules/node-fetch": {
"version": "2.0.0",
"name": "nhentai-mgr",
"version": "1.0.0",
"main": "select.js",
- "devDependencies": {},
"scripts": {},
"repository": {
"type": "git",
--- /dev/null
+const fetch = require("node-fetch")
+const child = require("child_process")
+
+module.exports = async (page, link) => {
+ let data
+
+ try {
+ data = await (await fetch(page)).text()
+ } catch {}
+
+ if (!data)
+ return false
+
+ const ids = []
+
+ 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)
+ }
+
+ if (ids.length < 1)
+ return false
+
+ child.spawnSync("nhentai", ["--id", ids.join(",")], { stdio: "inherit" })
+ return true
+}
--- /dev/null
+require("./scrape-links")("https://wholesomelist.com/list", "https://nhentai.net/g/")
--- /dev/null
+const scrapeLinks = require("./scrape-links")
+const page = `https://nhentai.net/${process.argv[2]}/${process.argv[3]}/popular?page=`
+
+;(async _ => {
+ for (let i = 1; await scrapeLinks(page + i, "/g/"); i++)
+ ;
+})();
+
+++ /dev/null
-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" })
- })
-