Image downloading scripts

What's up fellow data-hoarders
I made an interactive Jow Forums image downloading script.
You give it the thread url and it asks you where you want to make a specific subfolder, I would go with g/traps or g/faggotry.
It'll even check if the folder exists before making it so that you don't have duplicates!
I want to make one for sites like e-hentai and nhentai so I can have an easy way of saving doujins but I don't even know where to start with those.
Any anons willing to help out with wget would be much obliged

I know there's big programs that download things for you but a script can be mapped to a keybind, can be combined with other scripts, can run headless, and can run on even the shittiest toaster, so there is merit to this.
#!/bin/bash
#use --limit-rate=Xk to limit bandwidth hogging
echo "Where to save images in 4shit folder?"
read dir
#use test to see if the parent directory is there or not
if [ ! -e /home/user/.wget/image/Jow Forums/$dir ]
then
echo "Directory doesn't exist, make it? [n/y]"
read answer
if [ $answer != 'y' ]
then
exit
fi
else
mkdir -p /home/user/.wget/image/Jow Forums/$dir
fi
#no -nH since the user will be picking the subdirectory rather than having wget lump all board images together. -nh will group images with a seperate directory per board name though, if you want to make this a non-interactive script.
spot=/home/user/.wget/image/Jow Forums/$dir
wget -P $spot\
-nd -c --exclude-directories="boards.Jow Forums.org/*/thread/"\
-r -l 1 -H -N\
--secure-protocol=auto --https-only\
-e robots=off -ER html,s.jpg\
-D i.4cdn.org -A png,gif,jpg,jpeg,webm $1
echo "Thread $1 Downloaded"

Attached: 1542082839564.jpg (795x658, 463K)

And here it is in practice
All I did was give it a board name/folder name
so like
g/fags
and here's the output
makes downloading shit from w and wg trivial

Attached: 2018-11-13-1542132876.png (415x421, 22K)

Also it doesn't download thumbnails, I know that's annoying

Saved
Thanks op, good project

No prob
You can put it in your $path too and run it like a regular program from any directory
I have no clue where to start with making an e-hentai script though

>interactive
Nice. I had to enter all my data by hand when I used to dl threads.

wget \
--recursive \
--no-directories \
--directory-prefix=$HOME/_directory_ \
--accept '.jpg,.jpeg,.png,.gif,.webm' \
--reject '*s.jpg' \
--span-hosts \
--domains=i.4cdn.org \
--execute robots=off \
--wait=2 \
--random-wait \
--limit-rate=200k \
_URL_

>fellow data-hoarders
stop this meme

NIce, thanks OP.

no prob bro
since you seem to hate google: you can use newsboat to watch your youtube feeds through mpv without even needing to visit the site

>-https-only
based
this nigga knows whats up