用于解析和下载4chan线程的轻量级工具。
chandl的Python项目详细描述
用于解析和下载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.jpg和def.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集成