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

Mine is shorter.
wget -P pictures -nd -r -l 1 -H -D i.4cdn.org -A png,gif,jpg,jpeg,webm ]

Attached: 1459095623488.png (235x235, 23K)

that would download thumbnails as well dumbo
also it doesn't talk to you. My script has SOUL

Ah yes. soul
if you wish to you can add a rm *s.* to remove the thumbs. I just type it manually tho.

meaning your shitty script still needs more input and wastes bandwidth
Mine automatically ignores thumbnails and will make directories for easy orgaization as needed.

Come one, the thumbnails are barely more than a single packet per image.
Also it's added convenience when you want to post images for ants.

You're still manually organizing shit though.
Also your command will download from HTTP which is dangerous

Jow Forums rename jpeg to jpg;
some boards you can upload pdf;

it downloads both jpeg and jpg, and you can just add pdf too

>You're still manually organizing shit though.
>He hasn't aliased his thread image download script.

just right click, open git-bash here, and threaddl [url]

I even added the rm as per your suggestion.

A powershell function to do that:

function Save-FloorchanImage {

4chin has an api, use it you pseudo nigger.

windows niggers get out and stay out
look at all that shit you had to type out jesus
that's not adaptable or stringable though.
You can take out the read shit and string it into an image converter for example.
Like
>download thread images
>pipe into imagemagick and stick them all into 1 pdf or giant png
>download webm pipe into ffmpeg to edit or convert them
>automatically convert downloaded gifs into webms

You can have it running in the background detecting and time you copy a Jow Forums thread url and automatically download it without even needing open up a terminal.
etc.
too complicated

Attached: asus.png (411x671, 116K)

Jesus christ man, just use python or node.js and use the fucking api you retard.

how does all that bloated shit work better than a simple little bash script?

Isn't the directory creation part broken? If the dir doesn't exist you ask the user whether or not he wants to create it. If the answer is no you exit, if the answer is yes you do nothing.
Only when the dir already exists do you call mkdir.
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
else
mkdir -p /home/user/.wget/image/Jow Forums/$dir
fi
fi

last bump

>interactive
lol fucking normie npc scum

>he doesn't like talking to his qt computer