diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-09 20:38:41 +0200 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2022-05-09 20:38:41 +0200 |
commit | e1820ccf780f6ae62b606ed21f1816ba7d456476 (patch) | |
tree | 69703ee7b8db31e6d43d7e9ce86228e5a12e26c2 /wholesome.js | |
download | local-nhentai-e1820ccf780f6ae62b606ed21f1816ba7d456476.tar.xz |
Initial commit
Diffstat (limited to 'wholesome.js')
-rw-r--r-- | wholesome.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wholesome.js b/wholesome.js new file mode 100644 index 0000000..551fb82 --- /dev/null +++ b/wholesome.js @@ -0,0 +1,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" }) + }) + |