- Notifications
You must be signed in to change notification settings - Fork19
⏬ Download ALL xkcd's which have been uploaded till date. Ever!
License
tasdikrahman/xkcd-dl
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Download each and everyxkcd comic uploaded! Like ever!
Author: | Tasdik Rahman |
---|
- Can download all the xkcd's uploaded till date(1603 as I am writingthis!).
- Download individual xkcd's and store them
- Download ranges of xkcd's and store them
- Download the latest issue xkcd
- Download the meta text inside each xkcd and store it
- No duplicacy in your XKCD database.
- Stores each xkcd in a separate file named as the
title
of thexkcd at your home directory - Writes a
description.txt
for each xkcd. Storing meta-data likedate-publised
- url value
- a small description of that xkcd
- The alt text on the comic
- written in uncomplicated
python
.
Each Comic is stored in it's own individual folder with adescription.txt
placed in it. It contains meta-data like -img-link
-title
-date-published
-alt
Here's a little example for the same
When running for the first time, do axkcd-dl --update-db
$ xkcd-dl --update-dbXKCD link database updatedStored itin'xkcd_dict.json'. You can start downloading your XKCD's!Run'xkcd-dl --help' for more options$
$ xkcd-dl --helpusage: xkcd-dl [-h] [-u] [-l] [-d XKCD_NUM|-a] [-r [DOWNLOAD_RANGE [DOWNLOAD_RANGE ...]]] [-v] [-P PATH] [-s XKCD_NUM]Run`xkcd-dl --update-db`if runningfor the first time.optional arguments: -h, --help show thishelp message andexit -u, --update-db Update the database -l, --download-latest Download most recent comic -d XKCD_NUM, --download XKCD_NUM Download specified comic by number -a, --download-all Download all comics -r [DOWNLOAD_RANGE [DOWNLOAD_RANGE ...]], --download-range [DOWNLOAD_RANGE [DOWNLOAD_RANGE ...]] Download specified range -v, --version show program's version number and exit -P PATH, --path PATH set path -s XKCD_NUM, --show XKCD_NUM Show specified comic by number
This downloads the last uploaded xkcd comic and stores under the homedirectory of the user with a brief description
$ xkcd-dl --download-latestDownloading 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 particularXKCDNUMBER
(given that it exists and hasnot been downloaded already) and stores it in the home directory
$ xkcd-dl --download=143Downloading xkcd from'http://xkcd.com/143/' and storing it under'/home/tasdik/xkcd_archive/143'$ xkcd-dl --download=1603Downloading xkcd from'http://xkcd.com/1603/' and storing it under'/home/tasdik/xkcd_archive/1603'xkcd number'1603' has already been downloaded!$
Will take two number parameters and download all the xkcd's betweenthe two, inclusive.
$ xkcd-dl --download-range 32 36Downloading 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 dateand store them under the home directory of the user.
$ xkcd-dl --download-allDownloading 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'........
To use a custom directory to store your xkcd_archive, you can append--path=./any/path/here to the end of any download method. Absolute and relativepaths work, but the directory must already exist.
$ xkcd-dl --download=3 --path=comicDownloading xkcd from'http://xkcd.com/3/' and storing it under'/home/tasdik/comic/xkcd_archive/3'$ xkcd-dl --download-range 54 56 --path=/home/tasdik/xkcdDownloading xkcd from'http://xkcd.com/54/' and storing it under'/home/tasdik/xkcd/xkcd_archive/54'Downloading xkcd from'http://xkcd.com/55/' and storing it under'/home/tasdik/xkcd/xkcd_archive/55'Downloading xkcd from'http://xkcd.com/56/' and storing it under'/home/tasdik/xkcd/xkcd_archive/56'
Opens the specified comic. Downloads it, if not downloaded already. Prints the alt text and metadata to stdout.
$ xkcd-dl --show 32Downloading xkcd from'http://xkcd.com/32/' and storing it under'/home/bk/Documents/xkcd-dl/xkcd_dl/xkcd_archive/32'title: Pillardate-publised: 2006-1-1url: http://xkcd.com/32/alt: A comic by my brother Doug, redrawn and rewritten by me$ xkcd-dl -s 1000Downloading xkcd from'http://xkcd.com/1000/' and storing it under'/home/bk/Documents/xkcd-dl/xkcd_dl/xkcd_archive/1000'xkcd number'1000' has already been downloaded!title: 1000 Comicsdate-publised: 2012-1-6url: http://xkcd.com/1000/alt: Thank youfor making me feel less alone.
4.1 Option 1: installing throughpip (Suggested way)
$ pip3 install xkcd-dl
If you are behind a proxy
$ pip3 --proxy [username:password@]domain_name:port install xkcd-dl
Note: If you getcommand not found
then$ sudo apt-get install python3-pip
should fix that
$ git clone https://github.com/tasdikrahman/xkcd-dl.git$cd xkcd-dl/$ pip3 install -r requirements.txt$ python3 setup.py install
$ pip3 install -U xkcd-dl
$ pip3 uninstall xkcd-dl
Here is theAUR
link for you
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 andBlitzKraft for pointing it out.
- BlitzKraft for adding the feature to download the alt-text from the the xkcdand major clean ups!
- Braden Best for pointing out the issues when installing from source apart from his valuable input.
- [x] add
xkcd-dl --download-latest
- [x] add
xkcd-dl --download=XKCDNUMBER
- [x] add
xkcd-dl --download-all
- [x] add
xkcd-dl download-range <START> <END>
- [x] add path setting with
[--path=/path/to/directory]
option - [x] add exclude list to easily recognize and ignore dynamic comicsi.e. comics without a default image.
- [x] Remove redundant code in
download_xkcd_number()
,download_latest()
anddownload_all()
(Refactoring!!) - [x] Adding support to open a particular xkcd at the CLI itself.Implemented using xdg-open. Opens using your default image viewer.
- [x] Add tests
- There have been issues when installed from source if you are using
python 2.*
as discussed in#5.So usingpython3.*
is suggested. - If you get
command not found
when installing, it may mean thatyou don't havepip3
installed.$ sudo apt-get install python3-pip
should fix that. To check yourversion of pip - Dynamic comics have to be added manually using the excludeList
$ pip3 --versionpip 1.5.6 from /usr/lib/python3/dist-packages (python 3.4)$
Please report the bugs at theissuetracker
OR
You can tweet me at@tasdikrahman if you can't get it to work. In fact, you should tweet me anyway.
0.1.2
:- bug: fixed relative import error in setup.pyadded support for gif files when renaming downloaded image (#38)
xkcd-dl
is inspired by an awesome package calledyoutube-dl written byDaniel Bolton (Much respect!)
How about you get to download all of the xkcd which have been uploadedtill date? This does just that!
Now I don't know about you, but I just love readingxkcd
's! Had a boring Sunday night looming over, thought why not create something likeyoutube-dl
but for downloadingxkcd
's!
And hencexkcd-dl
Cheers to a crazy night!
Built with ♥ byTasdik Rahman(@tasdikrahman) andothers released underMIT License
You can find a copy of the License athttp://prodicus.mit-license.org/
If you have found my little bits of software of any use to you, you can help me pay my internet bills :)
About
⏬ Download ALL xkcd's which have been uploaded till date. Ever!