Library / SDK
Nandaka/PixivUtil2 avatar
Nandaka/PixivUtil2

PixivUtil2: a command-line bulk downloader for Pixiv and FANBOX

Download images from Pixiv and more!

2,698 stars289 forksPythonBSD-2-Clause

At a glance

What is it?
PixivUtil2 is a Python 3.10+ tool that downloads Pixiv artwork by member, image, tag or bookmark, keeps a local SQLite history, and can convert ugoira to video with FFmpeg. It is for people who want a scriptable archive rather than a browser extension.
Who is it for?
Adopt PixivUtil2 if you want a scriptable, history-aware archive of Pixiv and FANBOX work and you are comfortable editing config.ini and running a Python program from a terminal. Do not adopt it if you need a GUI-first experience on a phone, or if you cannot accept the IP-blocking risk that the README warns about.
Can I use it commercially?
Yes. BSD-2-Clause is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 12 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 24, 2026, and from our analysis. They are not legal advice.

Editorial analysis

What PixivUtil2 solves for people archiving Pixiv accounts

Pixiv has no first-party bulk export. If you follow an artist who has posted for a decade, the only built-in way to keep a copy is to open each work and save it by hand. PixivUtil2 exists to remove that loop. It is a Python program with a text menu, and its documented capabilities include downloading by member_id, by image_id, by tags, from a list.txt file, from bookmarked artists (including private and hidden bookmarks), from bookmarked images, from a tags.txt list, and from bookmark_new_illust.php for new illustrations from artists you follow. The same list extends to FANBOX: supported artists, artist or creator id, post id, followed artists, and latest posts.

That breadth is the point. A browser extension can save the page you are looking at. PixivUtil2 is aimed at the person who wants the whole back catalogue of several accounts, plus a record of what has already been fetched so the next run does not repeat the work. The README frames it around Pixiv and FANBOX downloads, and the repository ships PixivUtil2.py for the terminal, PixivUtilGUI.py for a graphical shell, and PixivDBManager.py for the database. If you have ever tried to keep a folder in sync with a Pixiv account manually, the target user is you.

How the downloader, the SQLite history and FFmpeg fit together

The architecture is a Python application over a local SQLite database, with an optional FFmpeg step for animation. PixivUtil2.py drives the menu and the download logic; the database (db.sqlite, as the FAQ names it) stores members and downloaded images so later runs can skip what is already present. The Manage Database menu exposes that store directly: show all members, show all downloaded images, export a member_id list, export a detailed list, export the local database by image_id, show members by last downloaded date, show images by image_id or member_id, delete a member, delete an image, cascade delete, blacklist an image by image_id, show deleted members, export a FANBOX post list, delete FANBOX or Sketch history by member_id or post_id, and clean up the database by removing entries whose downloaded file is missing.

That last item is the tell. The database is a claim about what is on disk, and the clean-up command exists because the two drift apart when files are moved or deleted. Treat db.sqlite as state you may need to repair, not as a source of truth.

Ugoira, Pixiv's frame-animation format, is handled by conversion rather than by storing raw frames: the README lists FFmpeg as dependent software used for converting ugoira to video, and there is a menu item to re-encode all ugoira present in a folder. The dependencies in pyproject.toml tell the rest of the story: beautifulsoup4 and mechanize for parsing and session handling, cloudscraper and curl-cffi for getting past bot checks, browser-cookie3 for pulling cookies from a local browser, Pillow for image handling, and demjson3 for the loose JSON Pixiv sometimes returns.

Installing PixivUtil2 and running a first download

The README lists Python 3.10+ as the requirement for running from source, with archive mode needing Python 3.13+, plus the libraries in requirements.txt. FFmpeg is only needed for ugoira conversion, and the Windows VC++ Redistributable is needed for pyexiv2 to write XMP metadata if that is enabled. The repository also ships a Dockerfile, which is the cleanest way to try it without touching your system Python.

Build the image from the repository root, then run the container with your current directory mounted at /workdir so downloaded files land on the host. The README gives exactly this:

bash
docker build -t pixivutil2 .
docker run -it --rm \
  -v $(pwd):/workdir \
  -w /workdir \
  pixivutil2 \
  /bin/bash -c "python PixivUtil2.py"

Inside the container you should see the PixivUtil2 text menu. From there the first useful step is authentication. The FAQ says that if login fails you can put credentials in the [Authentication] section of config.ini, and that a PHPSESSID cookie copied from a logged-in browser session can be pasted into the cookie field of that section. Once authenticated, the menu offers the download modes listed in the README, and the database records what was fetched.

If you would rather run from source, install the dependencies and start the program:

bash
pip install -r requirements.txt
python3 PixivUtil2.py

The README warns that overuse can lead to Pixiv blocking your IP for a few hours, so a first run against one artist is a more sensible test than a thousand-page tag sweep.

Where PixivUtil2 breaks down

The most concrete limitation is stated by the project itself: overuse can lead to Pixiv blocking your IP for a few hours. There is no documented rate-limit configuration in the README, so the only control is how much you ask for and how often. If your IP is shared, an office or a VPN exit, that block is not only yours.

Search coverage is the second. The FAQ explains that Pixiv only allows searching up to 1000 pages without Pixiv Premium, so a tag download is not a complete archive of that tag. The same FAQ points at account settings and the r18mode value in config.ini: setting r18mode to True means only R-18 images are downloaded, which is the opposite of what a user who wants everything might assume from the name.

Corrupted downloads are handled by re-downloading rather than by a repair command. The FAQ suggests either deleting the image id from the database (menu d, then 10) or setting alwaysCheckFileSize = True and verifyimage = True in config.ini and retrying. There is no documented rollback for a bad batch, and no documented undo for a cascade delete.

Finally, the environment matters more than it should. The FAQ documents that PuTTY sessions need LANG=en_US.UTF-8 and PYTHONIOENCODING=utf-8, that Japanese tag pasting in a console may require changing the non-Unicode language setting or using an online URL encoder, and that Windows consoles may need a Unicode-capable font since the 20161114+ version. Cloudflare on FANBOX is worked around by copying your browser user agent into the useragent field of config.ini and by using curl-cffi's browser impersonation. None of this is hidden, but it is friction that a hosted service would not have.

PixivUtil2 versus gallery-dl and browser extensions

The obvious alternative in the same space is gallery-dl, which is also a command-line downloader for image sites and also uses a configuration file and a per-site extractor model. The difference in approach is where the state lives and how much is site-specific. PixivUtil2 keeps its own SQLite database with a dedicated manager program and menu, and it treats Pixiv and FANBOX as the whole world, with named menu entries for bookmark types, Sketch history, FANBOX post lists and ugoira re-encoding. gallery-dl is broader across sites and keeps its state in a download archive file rather than a queryable database with delete, blacklist and cascade operations.

That means the choice is about what you want to do after the download. If you want to ask questions of your history, export member lists, or remove a single image id from the record, PixivUtil2's database manager is the reason to pick it. If you download from a dozen different sites and want one tool, PixivUtil2 is the wrong shape. A browser extension is the third option, and it is a different product category: it saves what you are looking at, in the moment, with no batch history and no ugoira conversion.

Licence, maintenance and what an upgrade costs you

PixivUtil2 is released under BSD-2-Clause, which is a permissive licence: it allows use and redistribution provided the copyright notice and licence text are kept. That is a statement about the licence text, not legal advice, and it says nothing about Pixiv's terms of service or about the rights of the artists whose work you download. The repository has no LICENSE implication beyond the identifier, and the README does not discuss redistribution of downloaded works.

The last push to the default branch was on 2026-09-18, and the most recent release listed is v20251112 from 2025-11-12, following v20250426 and v20240703. The repository is not archived. Release cadence is irregular rather than monthly, so an upgrade is an event you schedule, not a background process.

Upgrade cost is real because of the dependency set. pyproject.toml declares requires-python >=3.11 while the README says Python 3.10+ for running from source and 3.13+ for archive mode, and the dependency list includes curl-cffi, cloudscraper and browser-cookie3, all of which track browser and anti-bot behaviour. When Pixiv changes a page or a check, those libraries are where the fix lands. The FAQ's Cloudflare workaround, copying a user agent and using curl-cffi impersonation, is exactly the kind of thing that needs revisiting after an upgrade. Budget for reading changelog.txt after each release.

Editorial conclusion

Adopt PixivUtil2 if you want a scriptable, history-aware archive of Pixiv and FANBOX work and you are comfortable editing config.ini and running a Python program from a terminal. Do not adopt it if you need a GUI-first experience on a phone, or if you cannot accept the IP-blocking risk that the README warns about. Before committing, verify the Python version you have against the 3.10+ requirement (3.13+ for archive mode), confirm FFmpeg is on your PATH if you want createwebm, and check that your Pixiv account settings and r18mode value match the content you expect to download.

Frequently asked questions

What is PixivUtil2 and who is it for?

PixivUtil2 is a Python program that downloads images from Pixiv and FANBOX, with a text menu, a SQLite download history and optional FFmpeg-based ugoira to video conversion. It is aimed at people who want to archive whole accounts or bookmark sets from a terminal rather than save pages one at a time in a browser.

How do I download and install PixivUtil2?

The README documents two routes: run from source with Python 3.10+ and pip install -r requirements.txt, or build the included Dockerfile with docker build -t pixivutil2 . and run the container with your working directory mounted at /workdir. FFmpeg is only required for ugoira conversion.

How do I use PixivUtil2 to download from Pixiv?

Start PixivUtil2.py to get the text menu, authenticate either through the [Authentication] section of config.ini or by pasting a PHPSESSID cookie from a logged-in browser session, then choose one of the documented modes such as download by member_id, by image_id, by tags, from list.txt, or from bookmarked artists. The README warns that overuse can lead to Pixiv blocking your IP for a few hours.

Does PixivUtil2 run on Android?

The README does not mention an Android build. It describes running from source with Python 3.10+ and a Dockerfile based on python:3.11, and the repository contains PixivUtil2.py, PixivUtilGUI.py and PixivDBManager.py, so the supported environments described are desktop and container.

Why does PixivUtil2 not download all the images for a tag?

The FAQ states that Pixiv only allows searching up to 1000 pages without Pixiv Premium, so a tag search cannot reach everything. It also suggests checking your Pixiv website settings, deleting the cookie value in config.ini and retrying, and checking whether r18mode in config.ini is set to True, which would restrict downloads to R-18 images.

Official sources

  1. License: BSD-2-Clause
  2. Nandaka/PixivUtil2 on GitHub
  3. Project website
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nandaka-pixivutil2.svg)](https://hysenlabs.com/projects/nandaka-pixivutil2)