gmn / 4chget

A script for downloading images from 4chan threads for Unix

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

4chget

A super simple bash script to download images from a 4chan thread.  

Usage is simple: copy the url from the browser to the clip board of any 
4chan thread; paste it into the command line like such:

~$ 4chget http://boards.4chan.org/fit/res/4820056 directory_to_dl_to

Optionally, append a name of a directory to save the images to.
If the supplied directory name doesn't exist, it will be created. Leave the
dirname argument off, and it will dump the images to the current working
directory. 

If the '-A' option is applied, the entire page will be archived to the local 
folder along with thumbnails.

The script itself runs only on a *NIX environment, and uses the following 
(usually pre-installed) tools:
    bash (or similar)
    curl
    tr
    sed
    grep
    uniq


Probably the coolest single feature of 4chget is that you can run it repeatedly 
using your bash history (the up arrow), to check if any new stuff has been added 
to the thread.  4chget will only download the new images that show up.

All work is the original creation of Greg Naughton (C) 2011-, but is placed
into the public domain by whatever license you choose, so long as you keep
the author's name intact, along with the source file.


INSTALLATION INSTRUCTIONS:

to install on a unix environment, such as your Mac or Linux box, type:

~$ sudo cp 4chget /usr/bin

That's it. Have fun!  4chan isn't just for Windozefags.


TODO
- fetch filesize to continue/complete partial image downloads
- add '-P' flag to poll a source at regular intervals using the
    'while true; do ...' idiom
- double check '-A' flag does existent file checking the way it does
    when you don't use it. (doesn't download image if you already have it.) 

About

A script for downloading images from 4chan threads for Unix


Languages

Language:Python 61.7%Language:Shell 38.3%