Skip to main content

chandl

https://img.shields.io/pypi/status/chandl.svg https://img.shields.io/pypi/v/chandl.svg https://img.shields.io/pypi/pyversions/chandl.svg https://travis-ci.org/gebn/chandl.svg?branch=master https://scan.coverity.com/projects/11734/badge.svg https://coveralls.io/repos/github/gebn/chandl/badge.svg?branch=master

A lightweight tool for parsing and downloading 4chan threads.

Features

  • A comprehensive API for programmatically analysing 4chan content.

  • Concurrent downloading, with parallelism linked to the number of available cores.

  • Override the file naming scheme and specify exclusions for thread downloads.

  • Filter files by extension or category (e.g. images, videos).

Installation

To install chandl, simply run:

$ pip install chandl

Examples

Download all files in <thread_url>, to a new directory named after the thread if possible, otherwise its raw id:

$ chandl <thread_url>

Download all images and .webm files in <thread_url> to /dev/shm, using 3 download threads per core:

$ chandl -f images,webm -o /dev/shm -p 3 <thread_url>

Download all files in <thread_url>, except abc.jpg and def.jpg to the present working directory, using a custom name format:

$ chandl -e abc.jpg,def.jpg -t . -n "{board} - {file.name}.{file.extension}" <thread_url>

Usage

$ chandl -h
usage: chandl [-h] [-V] [-v] [-f [FILTER]] [-e [EXCLUDE]] [-o [OUTPUT_DIR]]
              [-t [THREAD_DIR]] [-n [NAME]] [-p PARALLELISM]
              url

A lightweight tool for parsing and downloading 4chan threads.

positional arguments:
  url                   the URL of the thread to download

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -v, --verbosity       increase output verbosity
  -f [FILTER], --filter [FILTER]
                        file types or extensions to download, value either
                        comma-separated or option passed multiple times
  -e [EXCLUDE], --exclude [EXCLUDE]
                        file names to exclude, value either comma-separated or
                        option passed multiple times
  -o [OUTPUT_DIR], --output-dir [OUTPUT_DIR]
                        the directory to create the `thread-dir` within
  -t [THREAD_DIR], --thread-dir [THREAD_DIR]
                        relative to the `output-dir`, this will contain
                        downloaded files
  -n [NAME], --name [NAME]
                        the format to use for downloaded file names
  -p PARALLELISM, --parallelism PARALLELISM
                        the maximum number of download threads to use per core

Roadmap

  • Implement tracking of threads until they are deleted

  • Improve test coverage

  • Pylint or flake8 integration

Metadata

Release files for chandl 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chandl 0.3.0
File Size Uploaded
chandl-0.3.0.tar.gz 16.8 kB Details

Release files / chandl-0.3.0.tar.gz

Download URL chandl-0.3.0.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7fcfb2edb525e8e456bce9b5f86432e692ce9ec277e7d8d505f7653a27d257bd
BLAKE2b-256 checksum
How to use checksums
6b902e4f095de1b90d448a1dd89dd4ef4b9abd766e460adbcd80e0344b671ba0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.3

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page