A simple script for downloading all xkcd comics
Project description
xkcd
This is a script for downloading all the xkcd comics
How to use the script
clone the repo
$git clone https://xkcd.com/brayo-pip/xkcd.git
Run this code to install all the dependencies
$cd xkcd
$pip3 install -r requirements.txt
Then run the script.
$python xkcd/download.py
How this script is better than most of the other scripts
I can't say for sure that this is the best script for downloading xkcd comics there is, but I can say it's one of the fastest. The script uses persistent http connections which I haven't yet seen in another xkcd script. The script skips previously downloaded comics and skips non-image comics such as js-scripts, it however highlights you of this and provides you with a link should you wish to visit the site yourself and see the 'interactive comic'.
Other technical features
The script maintains a continuity file so that it can 'recall' the last comic it downloaded. It does updates the continuity file every 10 comics, I didn't want to update too often as this could be a bottleneck. The continuity file is also updated during this 'sleep' session.
The script also has an amateur network congestion control, simply sleeps for 0.5 seconds for every 10 comics downloaded.This may be necessary once I introduce multi-threading.
Upcoming features
I wish to introduce multi-threading so as to be able to fully utilize the a user's bandwidth. Requesting multiple comics simultaneously and writing them to disk/SSD simultaneously.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file xkcd-comics-0.0.1.tar.gz
.
File metadata
- Download URL: xkcd-comics-0.0.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b2c5d8854eea1f379374793a649d3bfec93b1fa888c55c861790f3000551791 |
|
MD5 | dc894d5f9d14474822f8a7b12f5e70d1 |
|
BLAKE2b-256 | 7c2a7f7a5710bcd52fd01638ef6d3ea4d70b451c701508c1af4fece9aa1c3bba |
File details
Details for the file xkcd_comics-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: xkcd_comics-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 509aa5d258d82786f0967b9a1a6af537c1ee5efe7cec19921ce427f6499435ea |
|
MD5 | e22a13a1e7e9290a41169cd08fa661cd |
|
BLAKE2b-256 | e69647f58599b85df7c982ff1d5843fee2f0fb640d516a9404f88d3bc4806685 |