How about you get to download all of the xkcd which have been uploaded till date? This does just that!
Now I don't know about you, but I just love reading
xkcd's! Had a
boring Sunday night looming over, thought why not create something like
youtube-dl but for downloading
And hence xkcd-dl
--download-range <START> <END>
- Option 1: installing through pip (Suggested way)
- Option 2: installing from source
- For Arch distributions
- Help menu
- Known Issues
- Can download all the xkcd's uploaded till date(1603 as I am writing this!).
- Download individual xkcd's and store them
- Download ranges of xkcd's and store them
- Download the latest issue xkcd
- No duplicacy in your XKCD database.
- Stores each xkcd in a separate file named as the
titleof the xkcd at your home directory
- Writes a
description.txtfor each xkcd. Storing meta-data like
- url value
- a small description of that xkcd
- written in uncomplicated
When running for the first time, do a
$ xkcd-dl --update-db XKCD link database updated Stored it in 'xkcd_dict.json'. You can start downloading your XKCD's! Run 'xkcd-dl --help' for more options $
This downloads the last uploaded xkcd comic and stores under the home directory of the user with a brief description
$ xkcd-dl --download-latest Downloading xkcd from 'http://imgs.xkcd.com/comics/flashlights.png' and storing it under '/home/tasdik/xkcd_archive/1603' $
If it has been downloaded, will not do anything
This command will work even if you have not run --update-db yet.
Downloads the particular
XKCDNUMBER(given that it exists and has not
been downloaded already) and stores it in the home directory
$ xkcd-dl --download=143 Downloading xkcd from 'http://xkcd.com/143/' and storing it under '/home/tasdik/xkcd_archive/143' $ xkcd-dl --download=1603 Downloading xkcd from 'http://xkcd.com/1603/' and storing it under '/home/tasdik/xkcd_archive/1603' xkcd number '1603' has already been downloaded! $
--download-range <START> <END> --------------------
Will take two number parameters and download all the xkcd's between the two, inclusive.
$ xkcd-dl --download-range 32 36 Downloading xkcd from 'http://xkcd.com/32/' and storing it under '/home/tasdik/xkcd_archive/32' Downloading xkcd from 'http://xkcd.com/33/' and storing it under '/home/tasdik/xkcd_archive/33' Downloading xkcd from 'http://xkcd.com/34/' and storing it under '/home/tasdik/xkcd_archive/34' Downloading xkcd from 'http://xkcd.com/35/' and storing it under '/home/tasdik/xkcd_archive/35' Downloading xkcd from 'http://xkcd.com/36/' and storing it under '/home/tasdik/xkcd_archive/36'
As the name suggests, will download all the xkcd's uploaded till date and store them under the home directory of the user.
$ xkcd-dl --download-all Downloading all xkcd's Till date!! Downloading xkcd from 'http://xkcd.com/1466' and storing it under '/home/tasdik/xkcd_archive/1466' Downloading xkcd from 'http://xkcd.com/381' and storing it under '/home/tasdik/xkcd_archive/381' Downloading xkcd from 'http://xkcd.com/198' and storing it under '/home/tasdik/xkcd_archive/198' Downloading xkcd from 'http://xkcd.com/512' and storing it under '/home/tasdik/xkcd_archive/512' Downloading xkcd from 'http://xkcd.com/842' and storing it under '/home/tasdik/xkcd_archive/842' Downloading xkcd from 'http://xkcd.com/920' and storing it under '/home/tasdik/xkcd_archive/920' .... ....
Each Comic is stored in it's own individual folder with a
description.txt placed in it. It contains meta-data like -
Here's a little example for the same
pip (Suggested way)Option 1: installing through
$ pip3 install xkcd-dl
If you are behind a proxy
$ pip3 --proxy [username:[email protected]]domain_name:port install xkcd-dl
Note: If you get
command not found then
$ sudo apt-get install python3-pip should fix that
Option 2: installing from source
$ git clone https://github.com/tasdikrahman/xkcd-dl.git $ cd xkcd-dl/ $ pip3 install -r requirements.txt $ python3 setup.py install
$ pip3 uninstall xkcd-dl
Here is the
AUR link for you
$ xkcd-dl --help Run `xkcd-dl --update-db` if running for the first time. Usage: xkcd-dl --update-db xkcd-dl --download-latest xkcd-dl --download=XKCDNUMBER xkcd-dl --downoad-range <START> <END> xkcd-dl --download-all xkcd-dl --version xkcd-dl (-h | --help) Options: --update-db Updates dictionary which stores all xkcd"s till date -h --help Show this screen -v --version Show version $
I hacked this up in one night, so its a little messy up there. Feel free to contribute.
- Fork it.
- Create your feature branch
git checkout -b my-new-awesome-feature)
- Commit your changes (
git commit -am 'Added <xyz> feature')
- Push to the branch (
git push origin my-new-awesome-feature)
- Create new Pull Request
Big shout out to
- Ian C for fixing issue #2 which stopped the download if a title of a comic had a special character in it and BlitzKraft for pointing it out.
- Braden Best for pointing out the issues when installing from source apart from his valuable input.
- [x] add
- [x] add
- [x] add
- [x] add
xkcd-dl download-range <START> <END>[ ] add path setting with
- [ ] Remove redundant code in
- [ ] Adding support to open a particular xkcd at the CLI itself. (Thinking of using img2txt for that)
- There have been issues when installed from source if you are using
python 2.*as discussed in #5. So using
- If you get
command not foundwhen installing, it may mean that you don't have
$ sudo apt-get install python3-pipshould fix that. To check your version of pip
$ pip3 --version pip 1.5.6 from /usr/lib/python3/dist-packages (python 3.4) $
Please report the bugs at the issue tracker
You can tweet me at @tasdikrahman if you can't get it to work. In fact, you should tweet me anyway.
You can find a copy of the License at http://prodicus.mit-license.org/