从pixiv下载图像的命令行工具。
pixi的Python项目详细描述
PIXI
下载Pixv插图的命令行工具。
Usage: pixi [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
artist Download illustrations of an artist by URL or ID.
auth Log into Pixiv and generate a refresh token.
bookmarks Download illustrations bookmarked by a user.
config Edit the config file.
failed View illustrations that failed to download.
illust Download an illustration by URL or ID.
migrate Upgrade the database to the latest migration.
wipe Wipe the saved history of downloaded illustrations.
用法
此工具可以从pypi安装为pixi
。
$ pip install --user pixi
安装后,创建数据库并使用以下配置PixI 命令。
$ pixi migrate # Migrate the database $ pixi config # Configure pixi
有关各种 配置选项。
现在你可以开始下载了!
例如,以下命令下载一个插图。PIXI同时接受 插图的URL以及插图ID。同样适用 所有接受id值的输入。
$ pixi illustration https://www.pixiv.net/member_illust.php?mode=medium&illust_id=64930973
$ pixi illustration 64930973
下载艺术家的所有插图可以通过以下操作完成 命令。
$ pixi artist https://www.pixiv.net/member.php?id=2188232
可以使用以下命令下载公共和私有书签。
$ pixi bookmarks
其他用户的公共书签也可以下载。
$ pixi bookmarks --user https://www.pixiv.net/member.php?id=2188232
下面的命令将下载与指定用户匹配的所有书签 书签标签。
$ pixi bookmarks --tag "has cats"
要查看特定命令可用的所有选项,请使用
--help
标志。例如,illustration
的选项可以用
服从命令。
$ pixi --help illustration
从艺术家或用户的书签下载许多图像时, 有时可能无法下载。如果图像下载失败 重试,将记录并跳过。可以使用 服从命令。
$ pixi failed
如果成功下载失败列表中的图像,则它将 自动从列表中删除。要清除整个失败列表, 应运行以下命令。
$ pixi wipe --table=failed
PIXI还记录了哪些插图已被下载并将避免。
下载重复的插图。但是,如果您想重新下载
插图,传递--allow-duplicates
(或-a
)标志。
默认情况下,如果插图下载被下载到
默认的下载目录,如果没有,则不跟踪。此行为
可以使用--track/--no-track
(或-t/-T
)标志手动设置。
如果要清除跟踪下载的数据库,请运行以下命令 命令并确认操作。
$ pixi wipe --table=downloads
配置
配置文件采用ini
格式。包含演示配置
下面。要运行PixI,必须配置默认下载目录。
[pixi]; Leave this blank; the script will auto-populate it.refresh_token=; The default directory for iillustrations to be downloaded to.download_directory=/home/dazzler/images/pixiv