图片爬取下载工具,极速爬取下载 站酷https://www.zcool.com.cn/, CNU 视觉 http://www.cnu.cc/ 设计师/用户 上传的 图片/照片/插画。
图片爬取下载工具,极速爬取下载 站酷(https://www.zcool.com.cn/)、CNU 视觉(http://www.cnu.cc/)设计师/用户
上传的 图片/照片/插画
。
:tada: :tada: :tada: 站酷下载工具已发布到 PyPI
pip install -U zcooldl
zcooldl -u <username>
scraper
本来是规划用来存放各式各样的爬虫程序的。站酷仅仅是当初构想中的一个,因为太懒而没有新增其他爬虫。
想不到 zcool.py 竟然从原来的几十行代码,逐步增加到现在的 500+ 行 :joy: :joy: :joy:。
网站 | 入口 | 示例 |
---|---|---|
Zcool 站酷 | zcool.py | python zcool.py -u 叁乔居 |
CNU 视觉 | cnu.py | python cnu.py http://www.cnu.cc/users/142231 |
--thumbnail
下载缩略图(宽最大 1280px,约 500KB)New
:使用 -c <收藏夹 URL, ...>
下载收藏夹中的作品(收藏夹可自由创建)支持 3 类 URL 参数:
参数可接收多个 URL,且可随意组合,如:
$ python cnu.py http://www.cnu.cc/works/117783 http://www.cnu.cc/users/652629 http://www.cnu.cc/users/recommended/652629
python3.6
及以上首先克隆项目到本地,并安装依赖:
$ git clone https://github.com/lonsty/scraper.git
$ cd scraper
$ pip install -r requirements.txt
下载用户名为 username
的所有图片到路径 path
下:
$ python zcool.py -u <username> -d <path>
运行截图
爬取结果
python cnu.py <WORK_URLS> ...
$ python zcool.py -u <username> -t <topic1>,<topic2>,...
$ python zcool.py -u <username1>,<username2>,...
$ python zcool.py -u <username> -d <last-saved-path>
# Zcool 站酷
$ python zcool.py --help
Usage: zcool.py [OPTIONS]
ZCool picture crawler, download pictures, photos and illustrations of
ZCool (https://zcool.com.cn/). Visit https://github.com/lonsty/scraper.
Options:
-u, --usernames TEXT One or more user names, separated by commas.
-i, --ids TEXT One or more user IDs, separated by commas.
-c, --collections TEXT One or more collection URLs, separated by commas.
-t, --topics TEXT Specific topics to download, separated by commas.
-d, --destination TEXT Destination to save images.
-R, --retries INTEGER Repeat download for failed images. [default: 3]
-r, --redownload TEXT Redownload images from failed records (PATH of the
.json file).
-o, --overwrite Override the existing files.
--thumbnail Download thumbnails with a maximum width of 1280px.
--max-pages INTEGER Maximum pages to download.
--max-topics INTEGER Maximum topics per page to download.
--max-workers INTEGER Maximum thread workers. [default: 20]
--help Show this message and exit.
# CNU 视觉
$ python cnu.py --help
Usage: cnu.py [OPTIONS] START_URLS...
A scraper to download images from http://www.cnu.cc/
Arguments:
START_URLS... URLs of the works [required]
Options:
-d, --destination PATH Destination directory to save the images
[default: .]
-o, --overwrite / -no, --no-overwrite
Whether to overwrite existing images
[default: False]
-t, --thumbnail Whether to download the thumbnail images
[default: False]
-r, --retries INTEGER Number of retries when the download fails
[default: 3]
-w, --workers INTEGER Number of parallel workers [default: 2]
-c, --concurrency INTEGER Number of concurrency [default: 25]
--delay INTEGER Seconds to wait for the next request
[default: 0]
--retry-delay INTEGER Seconds to wait for the retry request
[default: 0]
--timeout INTEGER Seconds of HTTP request timeout [default:
20]
--install-completion [bash|zsh|fish|powershell|pwsh]
Install completion for the specified shell.
--show-completion [bash|zsh|fish|powershell|pwsh]
Show completion for the specified shell, to
copy it or customize the installation.
--help Show this message and exit.
-c <收藏夹 URL, ...>
,支持下载收藏夹中的作品。新功能:
--thumbnail
下载缩略图(宽最大 1280px,约 500KB)新功能:
BUG 修复:
主要功能:
此项目使用 MIT 开源协议
注意:使用此工具下载的所有作品,版权归原作者所有,请谨慎使用!