当前官方提供的页面选中下载只支持批量100张,如果照片很多的话下载很费劲,所以有了这个小工具。
下载流程
- 登陆网页版的一刻相册。
- 拿到Cookie和bdstoken,下载的时候需要这两个参数。
- 配置好目标路径targetRootPath,所有图片会自动下载到这个路径。
- 以上三个参数配置完,运行Client的main方法就可以了,日志会输出当前运行到几个文件了。
- 在目标路径会创建两个文件,__doneFsids.txt里面记录的是下载成功的fsid,__errorFsids.txt里面记录的是失败的fsid。
public class Client {
public static void main(String[] args) throws IOException {
// Cookie
String cookie = "";
// bdstoken
String bdstoken = "";
// 目标路径
String targetRootPath = "";
// 并发下载线程数
int threadCount = 40;
log.info("开始下载, 请关注日志。");
new CursorTraverser(
threadCount,
bdstoken,
cookie,
targetRootPath
).traverse();
}
}
可调参数
- 并发线程数,默认值可以轻松打满机器下行带宽。
- 目标存储,目前只支持本地路径,未来支持smb协议/webdav协议。