book118文档下载器
Project description
文档下载器
可用于下载book118的PDF文档
思路
- 爬虫爬取图片链接
- 下载图片
- 将图片拼合成pdf文件
参数说明
参数 | 解释 | 必备参数 |
---|---|---|
-h 、--help |
显示帮助 | ❌ |
-i 、--id |
要下载的文件id(或网页地址) | ✔ |
-o 、--output |
文件保存名,默认是book118.pdf |
❌ |
-p 、--proxy |
设置要使用的代理地址(默认使用环境变量中HTTP_PROXY 和HTTPS_PROXY 设置的值),可以使用-p '' 强制设置不走代理 |
❌ |
-f 、--force |
强制重新下载,不使用缓存 | ❌ |
-t 、--thread |
要使用的线程数 | ❌ |
使用模块
使用已上传到 PyPI 的包
python3 -m pip install documentDownloader
安装完成后即可直接使用 documentDownloader
命令
如:documentDownloader -i https://max.book118.com/html/2020/0109/5301014320002213.shtm -o '单身人群专题研究报告-2019.pdf' -p http://127.0.0.1:1080 -f -t 20
直接使用源码中的 main.py
克隆该项目,或在releases页面选择版本下载
- 安装Python3
- 安装依赖模块(Pillow、reportlab、requests)
python -m pip install -r requirements.txt
- 使用
python3 main.py
执行
如:python main.py -i https://max.book118.com/html/2020/0109/5301014320002213.shtm -o '单身人群专题研究报告-2019.pdf' -p http://127.0.0.1:1080 -f -t 20
仅供学习爬虫及相关知识,请支持正版图书
虽然book118上的好多pdf也是盗版吧
贡献列表
更新
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.