微博图片爬虫,极速下载、高清原图、多种命令、简单实用。
- 极速下载:多线程异步下载,可以根据需要设置线程数
- 异常重试:只要重试次数足够多,就没有下载不下来的图片 (^o^)/!
- 增量下载:用户有新的上传,再跑一遍程序就行了 O(∩_∩)O 嗯!
- 高清原图:默认下载高清原图,可以使用参数
--thumbnail
下载缩略图(宽最大690px)
python3.6
及以上
$ git clone https://github.com/lonsty/weibo-image-spider.git
$ cd weibo-image-spider
$ pip3 install -r requirements.txt
下载用户昵称为 nickname
的最新 2000(默认) 张图片到路径 dest
下:
$ python3 main.py -u <nickname> -d <dest>
运行截图
爬取结果
- 部分图片下载失败或有更新,再执行相同的命令,对失败或新增的图片进行下载
$ python3 main.py -u <nickname> -d <dest>
$ python3 main.py --help
Usage: main.py [OPTIONS]
A Weibo image spider, visit https://github.com/lonsty/weibo-image-spider.
Options:
-u, --nickname TEXT Nickname
-d, --destination TEXT Directory to save images [default:
weibo_images/]
-o, --overwrite Overwrite existing files [default: False]
-t, --thumbnail Download thumbnails with a maximum width of 690px
[default: False]
-n, --max-images INTEGER Maximum number of images to download [default:
2000]
-w, --max-workers INTEGER Maximum thread workers [default: 15]
-P, --proxies TEXT Use proxies to access websites. Example:
'{"http": "user:passwd@www.example.com:port",
"https": "user:passwd@www.example.com:port"}'
--help Show this message and exit.
-
主要功能:
- 极速下载:多线程异步下载,可以根据需要设置线程数
- 异常重试:只要重试次数足够多,就没有下载不下来的图片 (^o^)/!
- 增量下载:用户有新的上传,再跑一遍程序就行了 O(∩_∩)O 嗯!
- 高清原图:默认下载高清原图,可以使用参数
--thumbnail
下载缩略图(宽最大690px)
此项目使用 MIT 开源协议
注意:使用此工具下载的所有内容,版权归原作者所有,请谨慎使用!