用于解析和下载4chan线程的轻量级工具。

chandl的Python项目详细描述


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

用于解析和下载4chan线程的轻量级工具。

功能

  • 用于以编程方式分析4chan内容的综合api。
  • 并发下载,并行性与可用内核数相关联。
  • 重写文件命名方案并指定线程下载的排除项。
  • 按扩展名或类别过滤文件(如图像、视频)。

安装

要安装chandl,只需运行:

$ pip install chandl

示例

如果可能,将<thread_url>中的所有文件下载到以线程命名的新目录中,否则其原始ID:

$ chandl <thread_url>

使用每个核心3个下载线程将<thread_url>中的所有图像和.webm文件下载到/dev/shm

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

使用自定义名称格式将<thread_url>中的所有文件(除了abc.jpgdef.jpg)下载到当前工作目录:

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

用法

$ 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

路线图

  • 实现对线程的跟踪,直到它们被删除为止
  • 提高测试覆盖率
  • Pylint或Flake8集成

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java检查整数是0还是检查变量是null更好?   java Android Kotlin(初学者)使用File(),并从ACTION\u GET\u内容返回Uri   java JavaFx在“内部场景”和根场景之间切换   spring将XMLBean配置转换为java配置   java JPA HIBERNATE映射列两次(embeddedID和POJO)   c#单态模式模型在什么情况下适用?   java请求。getRemoteUser在特定时间后返回null?   spring boot中PUT api控制器的java my单元测试用例失败   java在字符串中互换地解析和替换值   java Android JNI在应用程序中检测到错误:调用JNI GetMethodID时出现挂起异常   JavaSpringDataMongo:使用非简单键持久化映射   爪哇玻璃鱼连接被拒绝   java如何在用户注册时发送特定电子邮件id的自动回复?   Java列表:实例化时和之后的赋值之间的差异