Download images from Pixiv and more!
Running from source code:
Dependent software
$ docker build -t pixivutil2 .
$ docker run -it --rm \
-v $(pwd):/workdir \
-w /workdir \
pixivutil2 \
/bin/bash -c "python PixivUtil2.py"Overusage can lead to Pixiv blocking your IP for a few hours.
………Please refer run with --help for latest information.
…username
Your pixiv username. Needed for OAuth. Please make sure the combination of username and password is valid in case of OAuth error. If you get error 103, please try changing username from pixiv ID to email address or the other way around.
password
Your pixiv password, in clear text! Needed for OAuth. Please make sure the combination of username and password is valid in case of OAuth error.
cookie
Your cookies for pixiv login, will be automatically updated in the login. See https://github.com/Nandaka/PixivUtil2/issues/814#issuecomment-711182644 for details.
cookieFanbox
Cookie for fanbox.cc, normally no need to fill in.
cookieFanboxTemp
Workaround for Fanbox's TLS fingerprinting blacklist. See Q.12 of Usage for instructions.
refresh_token
Used for OAuth refresh token to avoid relogin too many time. Automatically generated upon succesful OAuth login.
userAgentImpersonation
Parametrised argument to customise which browser PixivUtil2 will impersonate when downloading from Fanbox. Defaults to firefox135.
numberofpage
Number of page to be processed, put 0 to process all pages.
r18mode
Only list images tagged R18, for member, member's bookmark, and search by tag. Set to True to enable.
r18Type
Allow filtering for R-18 type (R-18 or R-18G)
Set r18Type with value 0 = both R18 and R-18G, 1 = only R18, or 2 = only R18G
dateformat
Pixiv DateTime format, leave blank to use default format (YYYY-MM-DD). Refer to http://strftime.org/ for syntax. Quick Reference:
autoAddMember
Automatically save member id to db for all download.
autoAddTag
Automatically add image tags for db for all downloads.
autoAddCaption
Automatically save captions for db for all downloads.
autoAddStats
Automatically save an artwork's engagement stats (view, like, bookmark, comment and response counts).
aiDisplayFewer
if true, filter out AI-generated images from downloading.
filenameFormatFanboxContent
Similar to filename format, but for files inside FANBOX posts.
filenameFormatFanboxCover
Similar to filename format, but for FANBOX post cover images
filenameFormatFanboxInfo
Similar to filename format, but for info dumps.
writeHtml
A switch to decide whether to write FANBOX posts into HTMLs or not.
True, article type posts will for sure be written into HTMLs, while non-article type posts are controlled with minTextLengthForNonArticle and minImageCountForNonArticle.False, no post will be written into HTMLs.filenameFormatFanboxInfo will be used for filename.minTextLengthForNonArticle
Works with minImageCountForNonArticle.
When 'writeHtml' is True, a non-article post should contain text longer than this value to be written into HTML.
minImageCountForNonArticle
Works with minTextLengthForNonArticle.
When writeHtml is True, a non-article post should contain at least this many files/images to be written into HTML.
useAbsolutePathsInHtml
Set to True to use absolute paths in HTMLs.
Set to False to use relative paths.
downloadCoverWhenRestricted
Set to True to download FANBOX post cover images even if they are restricted.
checkDBProcessHistory
Each FANBOX post has a updated_date value, which will be recorded/updated in database after it is processed.
True, the values in database would be checked when processing each post. If record is no earlier than the newly retrieved date, which means that the post has not been processed at all or changed since last time, the post would be skipped.checkUpdatedLimitFanbox to stop checking more posts for the current FANBOX member after enough unchanged/already-processed posts are encountered.False, posts will be processed anyways.checkUpdatedLimitFanbox
Skip to next FANBOX member if a number of consecutive previously processed/unchanged posts are encountered for the current member while checkDBProcessHistory is enabled.
Set to 0 to disable.
listPathFanbox
The list file for fanbox creators. One creator per line. Doesn't support custom path.
useproxy
Set True to use proxy server, or False to disable it.
proxyaddress
Proxy server address, use this format:
http://<username>:<password>@<proxy_server>:<port> orsocks5://<username>:<password>@<proxy_server>:<port> orsocks4://<username>:<password>@<proxy_server>:<port>useragent
Browser user agent to spoof. You can check it from https://www.whatismybrowser.com/detect/what-is-my-user-agent
userobots
Download robots.txt for mechanize.
timeout
Time to wait before giving up the connection, in seconds.
retry
Number of retries.
retrywait
Waiting time for each retry, in seconds.
downloadDelay
Set random delay up to n seconds for each image post. Set to 0 to disable.
checkNewVersion
Set to True to check new releases in github.
notifyBetaVersion
Set to False to ignore beta releases.
openNewVersion
Set to False to disable opening new releases in browser.
enableSSLVerification
Enable SSL verication, only set to False if you always encounter SSL Error (this disable the security)
logLevel
Set log level, valid values are CRITICAL, ERROR, WARNING, INFO, DEBUG, and NOTSET
Two log files are written next to the application: pixivutil.log with everything
at the configured level, and pixivutil_error.log with only warnings and errors,
so a failed run can be reviewed without searching the full log. Both rotate at
10MB, keeping 10 backups, and both are suppressed by disableLog.
enableDump
Enable HTML Dump. Set to False to disable.
skipDumpFilter
Skip HTML Dump based on error code (using regex format). E.g.: 1.|2. => skip all HTML dump for error code 1xxx/2xxx.
dumpMediumPage
Dump all medium page for debugging. Set to True to enable.
dumpTagSearchPage
Dump tags search page for debugging.
debughttp
Print http header, useful for debuggin. Set 'False' to disable.
IrfanViewPath
Set directory where IrfanView is installed (needed to start IrfanView)
startIrfanView
Set to True to start IrfanView with downloaded images when exiting pixivUtil
startIrfanSlide
Set to True to start IrfanView-Slideshow with downloaded images when exiting pixivUtil.
createDownloadLists
Set to True to automatically create download-lists.
downloadlistdirectory
list.txt path, also used for download-lists needed for createDownloadLists and IrfanView-Handling
If leaved blank it will create download-lists in pixivUtil-directory.
uselist
Set to True to parse list.txt.
This will update the DB content from the list.txt (member_id and custom folder).
processfromdb
Set True to use the member_id from the DB.
rootdirectory
Your root directory for saving the images.
downloadavatar
Set to True to download the member avatar as 'folder.jpg'
usesuppresstags
Remove the suppressed tags from %tags% meta for filename. The list is taken from suppress_tags.txt, each tags is separated by new line.
tagsLimit
Number of tags to be used for %tags% meta in filename. Use -1 to use all tags.
writeImageJSON
Set to True to export the compact image information to JSON file.
The filename is following filename(Manga)Infoformat + .json.
If you want the original info from source, use with writeRawJSON.
writeimageinfo
Set to True to export the compact image information to text file.
The filename is following filename(Manga)Infoformat + .txt.
If you want the original info from source, use with writeRawJSON.
writeRawJSON
Set to True to export the original JSON untouched of the image for writeImageJSON.
RawJSONFilter
Enter the JSON keys which you want to filter out for writeRawJSON. Keys are seperated by a comma.
includeSeriesJSON
Set to True to export the series information
No open issues yet, or sync has not completed.