Skip to content

Instantly share code, notes, and snippets.



Last active Dec 27, 2019
What would you like to do?
Fast + Simple 4chan Image Downloader
# Every time you use this, Moot sheds a single manly tear. Please use it sparingly if at all.
echo -e "(curl)\t\t Downloading thread"
curl -s$1 -o thread.html
echo -e "(grep -Po)\t Finding images "
cat thread.html | grep -Po '(?<=fileThumb" href=")\S+(?=")' > img
echo -e "(sed)\t\t Extracting image links"
sed -i "s/\/\///g" img
echo -e "(mkdir)\t Building directory from argument"
#imgdir=`echo $1 | sed "s/\//-/g"`
mkdir -p $1 2>/dev/null
cd $imgdir
echo -e "(curl)\t\t Downloading images, might take a few seconds"
xargs -n 1 curl -s -O < ../img
echo -e "(rm)\t\t Removing helper files"
rm ../thread.html
rm ../img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment